Click here to Skip to main content
Licence CPOL
First Posted 20 Mar 2007
Views 387,419
Downloads 7,598
Bookmarked 131 times

SIP Stack with SIP Proxy - (VOIP)

By Ivar Lumi | 11 Jun 2007
C# implementation of SIP
1 vote, 2.8%
1
2 votes, 5.6%
2

3
5 votes, 13.9%
4
28 votes, 77.8%
5
4.89/5 - 36 votes
3 removed
μ 4.51, σa 1.71 [?]
Screenshot - proxy.jpg

SIP Overview

SIP is an application-layer control protocol that can establish, modify, and terminate multimedia sessions (conferences) such as Internet telephony calls. SIP can also invite participants to already existing sessions, such as multicast conferences. Normally SIP uses UDP and TCP port 5060 and TCP 5061 for SSL communication. SIP protocol is very similar to HTTP, so if you have some knowledge about HTTP, then it is easy to learn SIP. SIP doesn't transfer session data like audio, video. RTP(real time protocol) is used for that, SIP just helps to open RTP streams.

SIP Message Example

INVITE sip:john@domain.com SIP/2.0
From: <sip:doe@domain.com>;tag=2084442460
To: <sip:john@1domain.com>
Via: SIP/2.0/UDP domain.com:5060;branch=z9hG4bK2df7b9194cd51e25
Call-ID: john@domain.com-4524j
CSeq: 1 INVITE
Contact: <sip:doe@domain.com:5060>
Content-Length: 226
Content-Type: application/sdp

<session description data, like RTP description>

SIP Server Types

stateless SIP server doesn't store any transaction info.
statefull SIP server creates and holds SIP commands transaction state.
registrar/location Allows users to register their locations and later to use that info to forward calls to registered contact.
B2BUA SIP server is like statefull + holds active calls state.(This is needed if call billing or full control of call is needed)
presence Provides user availability services, like if user is online,offline, ... .
... There are some more, but not so important ones.

Basic SIP Commands

  • INVITE - Initiates a session. This method includes information about the calling and called users and the type of media that is to be exchanged.
  • ACK - Sent by the client who sends the INVITE. ACK is sent to confirm that the session is established. Media can then be exchanged.
  • BYE - Terminates a session. This method can be sent by either user.
  • CANCEL - Terminates a pending request, such as an outstanding INVITE. After a session is established, a BYE method needs to be used to terminate the session.
  • OPTIONS - Queries the capabilities of the server or other devices. It can be used to check media capabilities before issuing an INVITE.
  • REGISTER - Used by a client to login and register its address with a SIP registrar server.

Ok, some ABC done, there are many documents on the internet, so it is not a good idea to rewrite these there.

If want more advanced information, then see:

SIP Proxy Demo Overview

This SIP proxy example just implements fully functional simple stateless, statefull, b2bua proxy. You can use hardware SIP phones or soft phones to play with this proxy.This is an advanced example, code is well commented, so beginners don't hate me because no more text here. Just read RFC 3216, see information links I noted earlier. After you go through those, if you then look at the code, it is all nicer then.

Some free available softphones are:

Version:
    11.06.2007
        *) Added B2BUA support.
    07.04.2007 
        *) Many bug fixes. 
        *) SIP -> PSTN and PSTN -> SIP gateway support. 
        *) Non-SIP URI gateway support. 

Contact Details

License

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

About the Author

Ivar Lumi



Estonia Estonia

Member


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
AnswerRe: SIP_Gateway PinmemberIvar Lumi20:36 18 Aug '09  
QuestionHow to run both SIP Proxy and a client in the same computer? Pinmemberkaiwnyt16:36 10 Jul '09  
AnswerRe: How to run both SIP Proxy and a client in the same computer? PinmemberIvar Lumi21:25 12 Jul '09  
GeneralRe: How to run both SIP Proxy and a client in the same computer? Pinmemberkaiwnyt18:32 14 Jul '09  
QuestionSystem.IndexOutOfRangeException: Pinmembergokhanuslu5:18 17 Jun '09  
Generalis there is client Pinmemberel3ashe23:54 11 Jun '09  
GeneralRe: is there is client PinmemberIvar Lumi7:32 11 Jun '09  
Hi,
 
Opensource client ... i dont know to suggest.
 
But closed source ones, you may try X-Lite.
GeneralRe: is there is client Pinmemberel3ashe223:42 13 Jun '09  
GeneralRe: is there is client PinmemberIvar Lumi20:52 14 Jun '09  
GeneralRe: is there is client Pinmemberel3ashe22:54 15 Jun '09  
GeneralRe: is there is client PinmemberIvar Lumi3:35 15 Jun '09  
GeneralDoes it work without setting domain Pinmemberlliaolx_guilin15:10 10 Jun '09  
GeneralRe: Does it work without setting domain PinmemberIvar Lumi1:30 11 Jun '09  
GeneralRe: Does it work without setting domain Pinmemberlliaolx_guilin8:12 11 Jun '09  
GeneralRe: Does it work without setting domain PinmemberIvar Lumi8:19 11 Jun '09  
GeneralRe: Does it work without setting domain Pinmemberlliaolx_guilin13:53 11 Jun '09  
GeneralRe: Does it work without setting domain Pinmemberlliaolx_guilin8:57 11 Jun '09  
GeneralRe: Does it work without setting domain PinmemberIvar Lumi4:55 12 Jun '09  
Generalx-Lite connect sip server error Pinmemberliwei1983091617:25 3 Jun '09  
GeneralRe: x-Lite connect sip server error PinmemberIvar Lumi20:30 3 Jun '09  
GeneralRe: x-Lite connect sip server error Pinmemberliwei1983091622:01 3 Jun '09  
GeneralProblem freeing the channel PinmemberNIZAR200519836:28 1 Jun '09  
GeneralRe: Problem freeing the channel PinmemberIvar Lumi8:23 1 Jun '09  
GeneralQuestions Pinmembermiki23422:50 28 Apr '09  
GeneralRe: Questions PinmemberIvar Lumi0:14 29 Apr '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web01 | 2.5.120210.1 | Last Updated 11 Jun 2007
Article Copyright 2007 by Ivar Lumi
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid