Ozeki VoIP SDK - Product Guide
Developers Guide
How to inject SIP messages into a communication
Explanation
Prerequisities
| Name: | WinForms Message Manipulator Example Program |
| Download: | MessageManipulatorExample .zip |
This article is a detailed guide about injecting SIP messages into a VoIP communication in relation with Ozeki VoIP SIP SDK. After reading through this page you will be fully familiar with all the essential terms concerning SIP message injection and what you will need for creating your own solution using Ozeki VoIP SIP SDK.
Introduction
VoIP communication is based on Session Initiation Protocol that is used by the PBX (private branch exchange) for establishing the communication line between two VoIP clients. The line establishment basically means sending certain SIP messages between the clients and the PBX.
Figure 1 - Injected SIP message
The VoIP clients usually send the SIP messages automatically, but in some cases you can modify the sent messages or inject a special message into the call. Ozeki VoIP SIP SDK provides the possibility for you to create and send your own SIP messages if needed, but you can also use the in built message sending methods for a standard SIP communication establishment.
The following program code uses the background support of Ozeki VoIP SIP SDK, therefore you will need to download and install the SDK on your computer before starting to use the program code. You will also need to have Visual Studio 2010 or compatible IDE and .NET Framework installed on your system, as the program code below is written in C# language.
You can download Ozeki VoIP SIP SDK from the download page:
| Ozeki VoIP SIP SDK can be obtained by opening the download page: Download Ozeki VoIP SIP SDK! |
For information about integrating Ozeki VoIP SIP SDK into your system, check the quick start guide.
If you have downloaded and installed Ozeki VoIP SIP SDK on your computer, you can start working with it in your own solution. As Ozeki VoIP SIP SDK provides great background support, you will only need to call some methods, set some parameters and your application will run properly.
The example program this article introduces contains more functionalities than the one this article covers. If you want to learn more about the example program and its possibilities, it is recommended to read the following articles as well:
- Working with SDP in VoIP calls
- Operating with incoming SIP messages
- Operating with outgoing SIP messages
Figure 2 shows the Windows Forms graphical user interface of the example program. You can see that the program uses tabs for the different functions. The SIP manipulation functionalities are shown in the first tab that is labeled "Custom SIP Message".
Figure 2 - The GUI of the Message manipulation example program
This example program uses the ISIPMessageManipulator of Ozeki VoIP SIP SDK as the basic tool for SIP message manipulation. This interface defines methods for sending and receiving custom SIP messages. In this example, there is a class that implements this interface for SIP message manipulation (Code 1).
class SIP_CustomMessageManipulator : ISIPMessageManipulator
Code 1 - The definition of a SIP manipulation class
The SIP manipulator class needs to have two properties for the incoming and outgoing SIP messages. These need to have basic set and get methods to modify and check their values (Code 2).
public string CustomIncomingMessage { get; set; }
public string CustomOutgoingMessage { get; set; }
Code 2 - The properties for the incoming and outgoing SIP messages
When you want to send a custom SIP message, you will need to implement the following method shown in Code 3. There is a similar method for received messages too in the interface that needs to be implemented.
public string PerformSendMessage(string outGoingMessage)
{
if (string.IsNullOrEmpty(CustomOutgoingMessage))
return null;
return CustomOutgoingMessage;
}
Code 3 - Sending custom SIP messaged
On the GUI, you can modify the incoming and outgoing messages or even type in your own custom messages on the textboxes. If you want to inject a SIP message into the call, you need to define an outgoing SIP message and press the Apply button. This will set the outgoing message you have defined.
The SIP message manipulation is done through a manipulator object that has to be set for the softphone that performs the call (Code 4). This one manipulator can handle both incoming and outgoing SIP messages.
private void SetCustomMessageManipulators()
{
if (softPhone != null)
{
softPhone.SetSIPMessageManipulator(sipMessageManipulator);
...
Code 4 - Setting the SIP manipulator object for the softphone
The same functionalities can be defined for not only SIP but also for SDP messages in the same way. If you want to know more about that topic, pleas read the following article too: Operating with SDP messages.
This article introduced you the basic knowledge about injecting SIP messages into a VoIP call and showed how Ozeki VoIP SIP SDK can help you to fulfill your wishes about this topic. If you have read through this page carefully, you already have all the knowledge you need to start on your own solution.
As you are now familiar with all the terms concerning this topic, now it is time to take a step further and explore what other extraordinary solution Ozeki VoIP SIP SDK can provide to you.
If you have any questions or need assistance, please contact us at info@voip-sip-sdk.com
You can select a suitable Ozeki VoIP SIP SDK license for your project on Pricing and licensing information page
Related Pages
- Setup Ozeki VoIP SIP SDK efficiently: Quick start guide
- Download Ozeki VoIP SIP SDK form the Ozeki VoIP SIP SDK download page
- You can find licensing information of Ozeki VoIP SIP SDK on Pricing and licensing information page
| Operating system: | Windows 8, Windows 7, Vista, 200x, XP |
| Development environment: | Visual Studio 2010 (Recommended), Visual Studio 2008, Visual Studio 2005 |
| Programming language: | C#.NET |
| Supported .NET framework: | .NET Framework 4.5, .NET Framework 4.0, .NET Framework 3.5 SP1 |
| Software development kit: | OZEKI VoIP SIP SDK (Download) |
| VoIP connection: | 1 SIP account |
| System memory: | 512 MB+ |
| Free disk space: | 100 MB+ |
INTERMEDIATE
VoIP technology walkthrough
Softphone development
Webphone development
Mobile development
Voice recording
GETTING AROUND
Sitemap
Search the manual
API documentation
FAQ
Appendix

