softphone is a software program for making telephone calls over the Internet
using a general purpose computer, rather than using dedicated hardware.
Recently I've been thinking about building one. But with not much of developing
experience, I've started to look for the easiest way of creating a softphone.
Finally, I've found a software development kit, which has proved to be the
perfect choice for me. Now, I would like to share my experiences with you, because
I do believe this guide can be very useful for many of you.
let's see the step-by-step guide of configuring the sample program through of
which I would like to present my work.
1: Download and extract the sample program.
2: Load it into Project Visual Studio 2010.
3: Some changes are necessary. In the telephone initialization section of the
PhoneForm.vb file you need to replace the local IP address of the PC on which
the system runs instead of "your local IP Address". Below you can find this
step in details. This is the telephone initialization section of the
Private Sub InitializeSoftPhone()
softPhone = SoftPhoneFactory.CreateSoftPhone("your local IP Address", 5700, 5750, 5700 , Nothing)
softPhone.ChangeNATSettings(OzNat.NATTraversalMethodType.NONE, "", "", "")
AddHandler softPhone.IncommingCall, New EventHandler(Of VoIPEventArgs(Of IPhoneCall))(AddressOf softPhone_IncommingCall)
phoneLine = softPhone.CreatePhoneLine(New SIPAccount(True, "oz891", "oz891", "oz891", "oz891", "192.168.91.212", 5060))
AddHandler phoneLine.PhoneLineInformation, New EventHandler(Of VoIPEventArgs(Of PhoneLineInformation))(AddressOf phoneLine_PhoneLineInformation)
Catch ex As Exception
MessageBox.Show("You didn't give your local IP adress, so the program won't run properly.")
In this section search for the following line:
softPhone = SoftPhoneFactory.CreateSoftPhone("your local IP Address", 5700, 5750, 5780, Nothing)
In this line replace the local IP address of the PC on
which the system runs instead of "your local IP Address".
Also set that the NAT should be between the softphone and the SIP server. This
setting depends on the environment (depends on the construction of the
network). If this setting is specified incorrectly, audio data from the remote
end will not be received during the phone call.
As a next step you also need to provide the user data of your selected SIP PBX
as the SIP account object values. Then you need to provide the user data of
your selected SIP PBX as the SIP account object values similarly to the
phoneLine = softPhone.CreatePhoneLine(new SIPAccount(True, "oz891", "oz891", "oz891", "oz891", "192.168.91.212", 5060))
Where "true" is the
registrationRequired parameter: this is a true value and it allows to receive
calls (not just to initiate them) in case the registration is successful. (In
case of "False" value registration, calls can only be initiated).
In the sample program "oz891" marks the SipAccount displayname, the username,
the registername and the registerpassword.
The following two parameters are the IP address or domain address and the port
of the SIP PBX.
Step 4: When you are
finished you only need to build and run the program.
of this is being a developing article, you are probably interested in some
coding, too. So, let's take a sneak peek at the Source code for creating a
Windows Form softphone.
code-behind file belonging to the program interface describes the control
events related to the interface and connects the GUI with the logics. The
sample program focuses on simplicity and representativeness. The PhoneForm.vb
file includes the full logic of the sample program. By opening this
PhoneForm.vb file, you can see a few lines of declaration right the beginning
that are needed for the use of Ozeki VoIP SIP SDK.
Public Class PhoneForm
Private phoneCall As IPhoneCall
Private phoneLine As IPhoneLine
Private phoneLineInformation As PhoneLineInformation
Private softPhone As ISoftPhone
Private inComingCall As Boolean
Private ActiveAudioCallListener As ActiveAudio
Private Mixer As AudioMixer
It represents a telephone, and its telephone line is represented by the
IphoneLine. There can be more telephone lines which means that we can develop a
multi line phone.
It represents a telephone line that we can register to a SIP PBX for example,
Asterisk, 3CX, or maybe to other PBXs that are offered by SIP providers.
Registration happens through SIP account.
It is an enum type that represents the status of the telephone line with the
PBX. For example registered, not registered, successful/unsuccessful
It represents a call: the status of the call, the direction of the call, on
which telephone line it was created, the called person, etc.
It is an optional device and it helps in the processing of the incoming sound
data which comes from the other party.
It plays the received sound data on the speaker.
It processes the sound data which comes from the default input device
(microphone) of the operation system.
hope I could serve you with some useful information. Of course this article
only containes a few main issues connected to the subject, but I think there
are others who can explain these things more precisely. If you'd like to know
more, I suggest you to visit the website I've been using as the source of my