Click here to Skip to main content
13,404,627 members (36,267 online)
Click here to Skip to main content
Add your own
alternative version

Stats

929.5K views
24.8K downloads
162 bookmarked
Posted 20 Mar 2007

SIP Stack with SIP Proxy - (VOIP)

, 11 Jun 2007
Rate this:
Please Sign up or sign in to vote.
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

statelessSIP server doesn't store any transaction info.
statefullSIP 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.
B2BUASIP 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)

Share

About the Author

Ivar Lumi
Estonia Estonia
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralRe: Implement ivr in Sip Server Pin
Ivar Lumi7-Apr-09 1:27
memberIvar Lumi7-Apr-09 1:27 
GeneralError with client connection Pin
Member 13084626-Apr-09 18:58
memberMember 13084626-Apr-09 18:58 
GeneralRe: Error with client connection Pin
Ivar Lumi6-Apr-09 20:37
memberIvar Lumi6-Apr-09 20:37 
GeneralRegarding Route calls Pin
pinky2754-Apr-09 1:29
memberpinky2754-Apr-09 1:29 
GeneralRe: Regarding Route calls Pin
Ivar Lumi4-Apr-09 5:35
memberIvar Lumi4-Apr-09 5:35 
General[Message Deleted] Pin
it.ragester28-Mar-09 6:31
memberit.ragester28-Mar-09 6:31 
Generaltest sip registration Pin
codiebank9-Mar-09 3:44
membercodiebank9-Mar-09 3:44 
GeneralRe: test sip registration Pin
Ivar Lumi9-Mar-09 3:56
memberIvar Lumi9-Mar-09 3:56 
GeneralRe: test sip registration Pin
codiebank10-Mar-09 2:49
membercodiebank10-Mar-09 2:49 
GeneralRe: test sip registration Pin
Ivar Lumi10-Mar-09 2:58
memberIvar Lumi10-Mar-09 2:58 
GeneralRe: test sip registration Pin
codiebank30-Mar-09 4:32
membercodiebank30-Mar-09 4:32 
GeneralRe: test sip registration Pin
Ivar Lumi30-Mar-09 4:48
memberIvar Lumi30-Mar-09 4:48 
QuestionHow to do Routing in this sip server? Pin
pinky2758-Mar-09 20:40
memberpinky2758-Mar-09 20:40 
AnswerRe: How to do Routing in this sip server? Pin
Ivar Lumi8-Mar-09 21:43
memberIvar Lumi8-Mar-09 21:43 
GeneralRe: How to do Routing in this sip server? Pin
pinky2758-Mar-09 22:12
memberpinky2758-Mar-09 22:12 
Questioncan anyone guide me how to use gateways in sip proxy demo? Pin
pinky2758-Mar-09 19:49
memberpinky2758-Mar-09 19:49 
AnswerRe: can anyone guide me how to use gateways in sip proxy demo? Pin
Ivar Lumi8-Mar-09 21:42
memberIvar Lumi8-Mar-09 21:42 
AnswerRe: can anyone guide me how to use gateways in sip proxy demo? Pin
Ivar Lumi8-Mar-09 21:44
memberIvar Lumi8-Mar-09 21:44 
GeneralRe: can anyone guide me how to use gateways in sip proxy demo? Pin
pinky2758-Mar-09 22:11
memberpinky2758-Mar-09 22:11 
GeneralRe: can anyone guide me how to use gateways in sip proxy demo? Pin
Ivar Lumi8-Mar-09 22:20
memberIvar Lumi8-Mar-09 22:20 
GeneralRe: can anyone guide me how to use gateways in sip proxy demo? Pin
pinky2758-Mar-09 22:22
memberpinky2758-Mar-09 22:22 
GeneralRe: can anyone guide me how to use gateways in sip proxy demo? Pin
Ivar Lumi8-Mar-09 22:36
memberIvar Lumi8-Mar-09 22:36 
GeneralRe: can anyone guide me how to use gateways in sip proxy demo? Pin
pinky2758-Mar-09 22:44
memberpinky2758-Mar-09 22:44 
GeneralRe: can anyone guide me how to use gateways in sip proxy demo? Pin
Ivar Lumi8-Mar-09 22:47
memberIvar Lumi8-Mar-09 22:47 
GeneralRe: can anyone guide me how to use gateways in sip proxy demo? Pin
pinky2758-Mar-09 23:15
memberpinky2758-Mar-09 23:15 

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 | Terms of Use | Mobile
Web02 | 2.8.1802120.2 | Last Updated 11 Jun 2007
Article Copyright 2007 by Ivar Lumi
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid