I'm writing this article because lately I've started
thinking about how we live in the world of fancy surfaces. Everywhere
you look there are these over-designed, fussy surfaces under which it
is hard to find the real content, the real functions, if there are
any. I'm an "old-fashioned" developer, and maybe there are more
of like me who prefer functionality over appearance. Those are who
really could appreciate my article beacuse it is about building a
simple command line caller, with the help of a software development
kit. Beginner developers can also utilize this guide if they don't
want to bother with creating a graphical user interface for their
applications but using a simple command to make phonecalls. At the
end of this article I will mention a site that I've used as the
source of my article to present my work. There you can download the
sample program I'm writing about. This way you can follow my train of
I don't want to repeat what the site says about the
process of installing and configurating this sdk example, so let's
skip to the build-up of the source code in which you are probably
starting the program check if the phone number you want to call was
given as an argument. If there is no phone number provided as
argument the user gets a notification. The following code section
demonstrate this case:
if (args.Length != 1)
Console.WriteLine("Parameter is not valid!");
In case the argumentum is
correct, the initialization block comes:
static void InitializeSoftPhone()
/* Create a real or a test softphone...
softPhone = SoftPhoneFactory.CreateSoftPhone(
GetLocalIP().ToString(), 5700, 5750, 5700);
/* Set the SIP Account settings..
SIPAccount acc = new SIPAccount(
/* Create a phone line using the softphone.
line = softPhone.CreatePhoneLine(acc);
/* Create event handler for the phone line.
line.PhoneLineInformation += Line_PhoneLineInformation;
activeAudioCallListener = ActiveAudio.Instance;
mixer = new AudioMixer();
Create an instance of the
phone via the 'softPhone'
object and give the IP address of your computer and the port domain
that can be used by the phone. Finally specify the port, at which the
SIM messages arriving from the PBX are listened, as the last
Create a phoneLine with a SIP account that can be
the user account of your corporate SIP PBX or a free SIP provider
account. To display the status of the created telephone line, sign up
to its 'phoneLine.PhoneLineInformation'
When these things are done you only need to register
the created 'phoneLine'
to the 'softPhone'.
In this example only one telephone line is registered but of course
multiple telephone line registration is also available.
these steps only the call needs to be started.
The code finally includes that section where you can
manage the event when the called party picked up the phone and the
voice communication started.
static void Line_PhoneLineInformation(object sender, VoIPEventArgs e)
IPhoneLine line = sender as IPhoneLine;
if (sender == null)
if (e.Item != PhoneLineInformation.NoRegNeeded &&
e.Item != PhoneLineInformation.RegistrationSucceded)
/* Create phone call, if the line was registered successfully.
Call = softPhone.CreateCallObject(line, phoneNumber);
Call.CallStateChanged += Call_CallStateChanged;
I hope my presentation was understandable for everyone,
I didn't want to overexplain anything. If you want to see it in
practice, or you simply want to know more, you should visit this
Thanks for your attention.