Click here to Skip to main content
13,832,357 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked
Posted 20 Aug 2012
Licenced CPOL

SIP Stack (1 of 3)

, 20 Aug 2012
Rate this:
Please Sign up or sign in to vote.
SIP Stack Implementation on the basis of RFC SIP 3261 Specification


In this article, I have presented the creation of SIP messages and its parsing on the basis of RFC 3261 specification for Session Initiation Protocol (SIP ).


In RFC 3261 specification, there are many modules that need to implement to work with SIP e.g SIP User Agent ( UA ), User Agent Client ( UAC ), User Agent Server( UAS ), SIP Client Transaction, SIP Server Transaction, Dialog, SIP Parsing, SIP Transport etc. Hence I thought to develop all these modules based on SIP 3261 specification in the form of libraries and share with the people who really working on SIP for implementing VOIP related applications.  And therefore I am creating libraries named as SIP Stack.

The SIP Stack mainly consist of 3 parts.

  1. SIP Parsers - Included in this article.
  2. SIP Core Modules  - Will be included in Part 2.
  3. SIP Soft Phone - Will be included in Part 3.

SIP Parsers  

This article of SIP Stack implements the parsing and the composition of SIP message's headers which are in the form of Augmented Backus-Naur Form (BNF) for the SIP Protocol.

Using the code  


To use this code, following are the open source libraries requires for its compilation.

  1. Boost Libraries Version 1.48.0 - Ensure to compile it with VC 2010.
  2. POSIX Threads Library for Win32 version 2.9.1 downloaded from link

In addition to above libraries, after compilation of SIP Parser, the libraries has to be tested on certain datasets that contains SIP headers and SIP messages, for its correct working. These dataset has been used from GNU based oSIP library on link along with some of the dataset that I have created.

Code Structure  

In the attached code, following are the folders has been provided

1. SIPParserDLL -  

The SIPParserDLL folder contains the project for creating SIP Parser Library

2. SIPParserTest -   

The SIP ParserTest folder contains the project for testing of SIPParserDLL library 

3. Lib -  

The Lib folder contains sub folder named "Debug". When the above two project once successfully compiled, then the SIPParserDLL related libraries and SIPParserTest.exe file have been created in this folder.

4. HHCoreDLL -     

The HHCoreDLL provide the basis functionality of creating log file and logging into it. This folder contains the Include files and libraries that are used by SIPParserDLL and SIPParserTest projects. 

5. DataSet -  

The DataSet folder contains text files based on SIP headers. These files contains the data in SIP headers format. This folder will be used by SIPParserTest project which will test the SIPParserDLL library.

6. Log  -

When SIPPaserTest application is running, it create the log file on each run on the basis of current date time stamp. The content of this log file will be the result of parsing SIP Messages and headers files that have been read from the DataSet folder one by one.  

Points of Interest 

During running of SIPParserTest application, it can be know whether the SIPParserDLL is parsing SIP message properly.  And during parsing of SIP message or header, if any header not parsed correctly then in that case the log file contains the error named "PARSE ERROR:". This error occurs because of the invalid SIP headers, URL or SIP messages. These type of incorrect headers/URL/SIP messages has been intentionally created for correct working of SIPParserDLL.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Hatim Haidry
India India
Hatim Haidry

VC++, Technical Architect


You may also be interested in...

Comments and Discussions

QuestionWhere is part 2 ? Pin
pa281408-Apr-15 12:49
memberpa281408-Apr-15 12:49 
Questionmissing project solution file Pin
AmirAlilou27-Sep-12 4:48
memberAmirAlilou27-Sep-12 4:48 
HHCoreDLL solution file not included.
Questionmy vote 5 Pin
AmirAlilou6-Sep-12 5:48
memberAmirAlilou6-Sep-12 5:48 
AnswerRe: my vote 5 Pin
Hatim Haidry6-Sep-12 20:08
memberHatim Haidry6-Sep-12 20:08 
QuestionJust curious - what is SIP / a SIP? Pin
Mike Diack20-Aug-12 22:50
memberMike Diack20-Aug-12 22:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.190114.1 | Last Updated 20 Aug 2012
Article Copyright 2012 by Hatim Haidry
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid