to build a C# open source VoIP softphone with WPF GUI
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.
First, 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
Step 2: Load it into Project Visual Studio 2010
3: Some changes are necessary. First, you need to replace some
parameters in the following section of PhoneWindow.xaml.cs
private void InitializeSoftPhone()
softPhone = SoftPhoneFactory.CreateSoftPhone("192.168.91.42", 5700, 5750, 5780);
softPhone.IncommingCall += new EventHandler>(softPhone_IncommingCall);
phoneLine = softPhone.CreatePhoneLine(new SIPAccount(true, "oz891", "oz891", "oz891", "oz891", "192.168.91.212", 5060));
phoneLine.PhoneLineInformation += new EventHandler>(phoneLine_PhoneLineInformation);
Then you need to
replace the local IP address of the running system instead of "your
local IP Address" section in this line:
softPhone = SoftPhoneFactory.CreateSoftPhone("your local IP Address", 5700, 5750, 5780);
Finally, you need to provide the user data of the
chosen SIP PBX as the data of the SIPAccount object, as you see in
phoneLine = softPhone.CreatePhoneLine(new SIPAccount(true, "oz891", "oz891",
"oz891", "oz891", "192.168.91.212", 5060));
a softphone is designed to behave like a traditional telephone,
sometimes appearing as an image of a phone, with a display panel and
buttons with which the user can interact. The Graphical
(GUI) of this sample program has been developed with Microsoft WPF
(Windows Presentation Foundation) technology, which allows great
flexibility regarding the appearance of the program. You can easily
customize its look according to your taste, the possibilities are
only limited by your fantasy. I think this is a great feature of this
software kit. But for now, you need to settle for seeing the
simpliest appearance (see the picture), because "designing a
softphone" is outside the question. Instead, let's get to know the
functions of the main buttons.
This softphone is set up with every function a basic
telephone should have.
You can answer to a call or (after dialing the number)
you can make a call pressing the "Pick Up" button.
If you want to end a call in progress you press the
"Hang Up" button.
As a normal phone, the softphone also can display call
statuses like: Ringing, InCall, Completed, Rejected, etc.
for those who are more interested in some techical details, let's see
a brief desription of the source
These are the devices of the SDK that are needed for making phone
public partial class PhoneWindow : Window
It represents a telephone, and its telephone
line is represented by the IphoneLine. There can be more telephone
lines which means that you can develop a multi line
It represents a telephone line
that can be registered to a SIP PBX, for example Asterisk, 3CX, or
maybe to other free PBXs that are offered by SIP providers.
Registration is made via a SIP account.
is an enum type that represents the status of the phone 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.
info: This is a very flexible SDK because it can be included into any
program that was developed in .Net. It is compatible with ATA and PBX
systems, too, they only need to support SIP protocol.
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 article.