Click here to Skip to main content
Click here to Skip to main content

SIP Stack with SIP Proxy - (VOIP)

By , 11 Jun 2007
 
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
No Biography provided

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.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questionstudy sip Pinmemberape1236 Apr '13 - 0:02 
Questioncalling bug Pinmembershadi2421 Nov '12 - 23:22 
Bugzero?o? [modified] PinmemberMember 883330021 Jun '12 - 16:43 
Bugbug PinmemberMember 883330017 Jun '12 - 0:46 
QuestionHow to Register IP Phone ??? Pinmemberkelibox23 Aug '11 - 1:04 
QuestionHow to set enviroenment Pinmemberbliznak220 Jul '11 - 3:31 
Generalvoip sip client with video Pinmemberwaelsys200724 May '11 - 1:33 
GeneralA question about RTCP Pinmemberywchen8 Apr '11 - 15:17 
GeneralSIP_Authenticate AuthContext cannot get the password of the client application PinmemberSing52012 Mar '11 - 18:07 14 
Generalvoipcore Pinmemberabhisoft_abto21 Dec '10 - 0:21 
GeneralSIP Stack Pinmembersdfsdfsdfsdfdfgdf30 Sep '10 - 2:55 
QuestionHow to fix error? PinmemberLý Tầm Hoan30 Jun '10 - 21:26 
Generalneed help for SIP to PSTN call PinmemberASGuru3 May '10 - 1:24 19 
Questionhow much client we can connect? PinmemberASGuru23 Apr '10 - 21:12 
GeneralConfused about the basic settings Pinmemberfilipcz19 Apr '10 - 6:16 
Generalthe size of source code Pinmembersntslm22 Mar '10 - 17:08 
GeneralSample is not working properly.,. Pinmembersajithkalady19 Mar '10 - 0:40 
Generalthanks from PH Pinmembermdingalla18 Oct '09 - 20:09 
GeneralGeneral comment Pinmembermapick3 Oct '09 - 6:36 
GeneralSIP Client Pinmemberbinnibinni2 Oct '09 - 2:53 
QuestionUDP to TCP UA Pinmemberrudacunhasilva24 Aug '09 - 6:34 
QuestionSIP TCP Pinmemberrudacunhasilva20 Aug '09 - 14:48 
QuestionSIP_Gateway Pinmemberrudacunhasilva18 Aug '09 - 10:15 
QuestionHow to run both SIP Proxy and a client in the same computer? Pinmemberkaiwnyt10 Jul '09 - 15:36 
QuestionSystem.IndexOutOfRangeException: Pinmembergokhanuslu17 Jun '09 - 4:18 
Generalis there is client Pinmemberel3ashe211 Jun '09 - 2:54 
GeneralDoes it work without setting domain Pinmemberlliaolx_guilin10 Jun '09 - 14:10 
Generalx-Lite connect sip server error Pinmemberliwei198309163 Jun '09 - 16:25 
GeneralProblem freeing the channel PinmemberNIZAR200519831 Jun '09 - 5:28 
GeneralQuestions Pinmembermiki23428 Apr '09 - 21:50 
GeneralSipx call traffic PinmemberAndreadakis Manolis24 Apr '09 - 1:50 
GeneralSend DTMF PinmemberMember 396896816 Apr '09 - 0:48 
GeneralImplement ivr in Sip Server Pinmembercodiebank7 Apr '09 - 0:18 
GeneralError with client connection PinmemberMember 13084626 Apr '09 - 17:58 
GeneralRegarding Route calls Pinmemberpinky2754 Apr '09 - 0:29 
General[Message Deleted] Pinmemberit.ragester28 Mar '09 - 5:31 
Generaltest sip registration Pinmembercodiebank9 Mar '09 - 2:44 
QuestionHow to do Routing in this sip server? Pinmemberpinky2758 Mar '09 - 19:40 
Questioncan anyone guide me how to use gateways in sip proxy demo? Pinmemberpinky2758 Mar '09 - 18:49 10 
QuestionHow The SIP Proxy Demo Work? PinmemberBryan Le4 Mar '09 - 6:19 
QuestionSSL Support PinmemberMember 36427642 Mar '09 - 16:18 
GeneralVery New to SIP and can use some guiedance Pinmembermhabib30 Jan '09 - 12:47 
Generalregistration with asterisk [modified] Pinmembercodiebank22 Jan '09 - 17:42 
Generalregistration error Pinmembermeenkshi21 Jan '09 - 20:22 
GeneralProblem in registering sip client Pinmemberbinnibinni21 Jan '09 - 20:00 
Generalabout licence problem Pinmemberhoikwan15 Jan '09 - 22:22 
GeneralNice Job Pinmemberejthill4 Jan '09 - 19:04 
QuestionForward Call? PinmemberBrendan Tompkins16 Oct '08 - 8:34 
GeneralSIP client Pinmemberledongpq14 Oct '08 - 22:21 
GeneralIt is a Great work!!! Pinmember_Armen13 Oct '08 - 10:16 

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 11 Jun 2007
Article Copyright 2007 by Ivar Lumi
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid