Click here to Skip to main content
Licence CPOL
First Posted 20 Mar 2007
Views 422,690
Downloads 10,658
Bookmarked 140 times

SIP Stack with SIP Proxy - (VOIP)

By | 11 Jun 2007 | Article
C# implementation of SIP
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
QuestionSystem.IndexOutOfRangeException: Pinmembergokhanuslu4:18 17 Jun '09  
Generalis there is client Pinmemberel3ashe22:54 11 Jun '09  
GeneralRe: is there is client PinmemberIvar Lumi6:32 11 Jun '09  
GeneralRe: is there is client Pinmemberel3ashe222:42 13 Jun '09  
GeneralRe: is there is client PinmemberIvar Lumi19:52 14 Jun '09  
GeneralRe: is there is client Pinmemberel3ashe21:54 15 Jun '09  
GeneralRe: is there is client PinmemberIvar Lumi2:35 15 Jun '09  
>but I'm asking if i did that is there is any problem could happen to the service??
This again depends on your coding techinques and sikkls.
GeneralDoes it work without setting domain Pinmemberlliaolx_guilin14:10 10 Jun '09  
GeneralRe: Does it work without setting domain PinmemberIvar Lumi0:30 11 Jun '09  
GeneralRe: Does it work without setting domain Pinmemberlliaolx_guilin7:12 11 Jun '09  
GeneralRe: Does it work without setting domain PinmemberIvar Lumi7:19 11 Jun '09  
GeneralRe: Does it work without setting domain Pinmemberlliaolx_guilin12:53 11 Jun '09  
GeneralRe: Does it work without setting domain Pinmemberlliaolx_guilin7:57 11 Jun '09  
GeneralRe: Does it work without setting domain PinmemberIvar Lumi3:55 12 Jun '09  
Generalx-Lite connect sip server error Pinmemberliwei1983091616:25 3 Jun '09  
GeneralRe: x-Lite connect sip server error PinmemberIvar Lumi19:30 3 Jun '09  
GeneralRe: x-Lite connect sip server error Pinmemberliwei1983091621:01 3 Jun '09  
GeneralProblem freeing the channel PinmemberNIZAR200519835:28 1 Jun '09  
GeneralRe: Problem freeing the channel PinmemberIvar Lumi7:23 1 Jun '09  
GeneralQuestions Pinmembermiki23421:50 28 Apr '09  
GeneralRe: Questions PinmemberIvar Lumi23:14 28 Apr '09  
GeneralRe: Questions Pinmembermiki23423:16 28 Apr '09  
GeneralSipx call traffic PinmemberAndreadakis Manolis1:50 24 Apr '09  
GeneralRe: Sipx call traffic PinmemberIvar Lumi20:17 24 Apr '09  
GeneralSend DTMF PinmemberMember 39689680:48 16 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
Web02 | 2.5.120604.1 | Last Updated 11 Jun 2007
Article Copyright 2007 by Ivar Lumi
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid