.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Articles >> C# >> Post New Resource Bookmark and Share   

 Subscribe to Articles

How to build your own C# Autodialer

Posted By:Evan Miller       Posted Date: July 06, 2011    Points: 200    Category: C#    URL: http://www.dotnetspark.com  

This article is inspired to present the building of a C# Autodialer. I hope it will help.

How to build your own C# Autodialer




Let me start with a short background story. One day, one of my oldest friends (who is a professional business man) came to me (the developer) for advice. He had a specific idea to boost his business: he wanted to install an Autodialer software. He asked for my expert opinion about how this could be done. That time I had a lot of work so I didn't have the time to come up with something brand new and write him a program. But I really wanted to help him, so in my freetime I was searching for a convenient solution. I've found it. We've done it. The business is on the wing ever since. My friend gave his approval to publish his story and the method he chose. I've thought this could be useful for many people and for many company.

The key to build an Autodialer, and also to the great success, was a software development kit. It has a sample program to have a look at its facilities. Here's how you configurate it, after downloading, extracting, and opening it:


Right click on MainForm.cs file and select View Code option (Figure 1).

Search for MainForm_Load method. You can find the configuration of the autodialer within this method.

1.       /// 


2.       /// Occurs when the user loads the form.  

3.       /// 


4.       ///   

5.       ///   

6.       void MainForm_Load(object sender, EventArgs e)  

7.       {  

8.           #region DataBinding  

9.           // See later  

10.                              #endregion  


12.                              #region Configuration  


14.                              autodialer = new Autodialer(GetLocalIP().ToString(), 5060, 5080, 5060, @"..\..\Resources\autodialer-example.wav");  

15.                              autodialer.ProcessingCompleted += autodialer_ProcessingCompleted;  

16.                              autodialer.PhoneLineStateChanged += autodialer_PhoneLineStateChanged;  


18.                              var sipAccount = new SIPAccount(true, "oz890", "oz890", "oz890", "oz890", "", 5060);  

19.                              autodialer.CreateAndRegisterPhoneLine(sipAccount);  

20.                              #endregion  


22.                              #region Copyright  

23.                       // Implementation.  

24.                              #endregion  


26.                          }  

Parameters for the autodialer:

1.    public Autodialer(string localIPAddress,   

2.                    int minPort,   

3.                    int maxPort,   

4.                    int localSIPPort,   

5.                    string wavPath)  


6.    localIPAddress:
This is the local IP address of the computer. If there are more network cards, then you need to enter the IP address of that network card here, with which you connect to the PBX or to the VoIP service provider.

7.    minPort:
This is the minimum port that can be used.

8.    maxPort:
This is the maximum port that can be used.

9.    localSIPPort:
This is the port reserved for SIP. SIP messages will be listened to via this port.

10.                       wavPath: This is the path for the audio file that will be played during the calls.

The SIP account includes information with which you can register in the PBX or the VoIP service provider successfully.

Parameters for SIP account:

1.    public SIPAccount(  

2.        bool registrationRequired,   

3.        string displayName,  

4.        string userName,   

5.        string registerName,   

6.        string registerPassword,   

7.        string domainServerHost,   

8.        int domainServerPort)  


9.    registrationRequired
The registration to the PBX is required. Please note that if you do not register in the PBX, you will only be able to make calls but you will not be able to receive calls.

10.                       displayName
This name will be displayed for the the called party during the calls.

11.                       userName
This is the username will be used during calls.

12.                       registerName
This is the name used for registration.

13.                       registerPassword
This password is needed for registration and for authentication during calls.

14.                       domainServerHost
This is the IP address or domain name of the PBX.

15.                       domainServerPort
This is the port number of the PBX.

After configuration, click on Build button in Visual Studio or click F5 on your keypad.

Now you see, that building an Autodialer isn't necessarily a hard thing. You only have to find the appropriate help. Here you can find the sample program for this sdk:


 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend