Softphone development from firsthand
Submitted By: NikoJarvi68
Rating: (Not rated)
Several months ago I started a new VoIP project. I wanted to create an own softphone with the help of Ozeki VoIP SIP SDK library. I have collected some useful codes which were really important in the beginning of my work.
1.) Softphone object
You can get a softphone object from the SoftPhoneFactory class. The IP address and the port numbers
need to be set.
//softPhone = SoftPhoneFactory.CreateSoftPhone(SoftPhoneFactory.GetLocalIP(), 4700, 4750, 4700);
2.) How to make connection with other networks
You need to set the Network Address Translation (NAT) traversal method. The server address, the user name and the password are required.
// phoneLine = softPhone.CreatePhoneLine(new SIPAccount(true, "ms928", "ms928", "ms928", "ms928", "192.168.245.185", 5060), new NatConfiguration(NatTraversalMethod.None));
3.) Register to incoming call events
// softPhone.IncomingCall += new EventHandler<VoIPEventArgs<IPhoneCall>> softPhone_IncomingCall);
4.) Define a phone line for the PBX
// phoneLine.PhoneLineStateChanged += new EventHandler<VoIPEventArgs<PhoneLineState>>(phoneLine_PhoneLineInformation);
5.) Register the state change
To be informed about the line state you have to sign up for the EventHandler.
After that you have initialized your softphone, you need to register it to the PBX with the next code:
I can say that it was only a little crumb from the whole code but I also wish to mention some curiosities which I can solve only with Ozeki SDK what I could not do with others:
- I can play a wav file into a call and into the speaker and via a filter at the same time with Ozeki SDK.
- The noise reduction tool of Ozeki VoIP SIP SDK can be used with every device (speaker, microphone, any noisy wave file etc). If there is a wav file, which is a little noisy, then it can be filtered before forwarding to the call.
I hope this information was useful for you.
Add Your Rating