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

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberIvar Lumi2 Mar '11 - 19:17 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberSing52012 Mar '11 - 19:24 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberIvar Lumi2 Mar '11 - 19:26 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberSing52012 Mar '11 - 19:31 
In the client application has provide the password. Using other server, the server can get the password correctly.
But use the same configuration, in the sip proxy server can get the username, realm...only missing password.
So it will show the error 407 proxy authentication.
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberIvar Lumi2 Mar '11 - 19:51 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberSing52012 Mar '11 - 20:05 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client application [modified]memberSing52012 Mar '11 - 21:27 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberSing52013 Mar '11 - 14:26 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberSing52013 Mar '11 - 22:27 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberIvar Lumi3 Mar '11 - 22:45 
GeneralRe: SIP_Authenticate AuthContext cannot get the password of the client applicationmemberSing52014 Mar '11 - 3:00 
Generalvoipcorememberabhisoft_abto21 Dec '10 - 0:21 
GeneralSIP Stackmembersdfsdfsdfsdfdfgdf30 Sep '10 - 2:55 
QuestionHow to fix error?memberLý Tầm Hoan30 Jun '10 - 21:26 
Generalneed help for SIP to PSTN callmemberASGuru3 May '10 - 1:24 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi3 May '10 - 1:35 
GeneralRe: need help for SIP to PSTN callmemberASGuru4 May '10 - 0:31 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi4 May '10 - 0:36 
GeneralRe: need help for SIP to PSTN callmemberASGuru4 May '10 - 0:41 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi4 May '10 - 0:47 
GeneralRe: need help for SIP to PSTN callmemberASGuru4 May '10 - 1:00 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi4 May '10 - 1:35 
GeneralRe: need help for SIP to PSTN callmemberASGuru4 May '10 - 1:43 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi4 May '10 - 1:58 
GeneralRe: need help for SIP to PSTN callmemberASGuru4 May '10 - 18:57 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi4 May '10 - 20:02 
GeneralRe: need help for SIP to PSTN callmemberASGuru4 May '10 - 20:22 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi4 May '10 - 20:24 
GeneralRe: need help for SIP to PSTN callmemberASGuru4 May '10 - 20:28 
GeneralRe: need help for SIP to PSTN callmemberASGuru7 May '10 - 23:51 
GeneralRe: need help for SIP to PSTN callmemberIvar Lumi8 May '10 - 0:10 
GeneralRe: need help for SIP to PSTN callmemberASGuru8 May '10 - 0:16 
GeneralRe: need help for SIP to PSTN callmemberASGuru10 May '10 - 20:35 
Questionhow much client we can connect?memberASGuru23 Apr '10 - 21:12 
GeneralConfused about the basic settingsmemberfilipcz19 Apr '10 - 6:16 
Generalthe size of source codemembersntslm22 Mar '10 - 17:08 
GeneralSample is not working properly.,.membersajithkalady19 Mar '10 - 0:40 
Generalthanks from PHmembermdingalla18 Oct '09 - 20:09 
GeneralGeneral commentmembermapick3 Oct '09 - 6:36 
GeneralSIP Clientmemberbinnibinni2 Oct '09 - 2:53 
GeneralRe: SIP ClientmemberIvar Lumi2 Oct '09 - 3:00 
GeneralRe: SIP Clientmemberbinnibinni2 Oct '09 - 3:04 
QuestionUDP to TCP UAmemberrudacunhasilva24 Aug '09 - 6:34 
QuestionSIP TCPmemberrudacunhasilva20 Aug '09 - 14:48 
QuestionSIP_Gatewaymemberrudacunhasilva18 Aug '09 - 10:15 
AnswerRe: SIP_GatewaymemberIvar Lumi18 Aug '09 - 19:36 
QuestionHow to run both SIP Proxy and a client in the same computer?memberkaiwnyt10 Jul '09 - 15:36 
AnswerRe: How to run both SIP Proxy and a client in the same computer?memberIvar Lumi12 Jul '09 - 20:25 
GeneralRe: How to run both SIP Proxy and a client in the same computer?memberkaiwnyt14 Jul '09 - 17:32 
QuestionSystem.IndexOutOfRangeException:membergokhanuslu17 Jun '09 - 4:18 

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

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