5,286,006 members and growing! (20,308 online)
Email Password   helpLost your password?
Languages » C# » General     Advanced

SIP stack with SIP proxy - (VOIP)

By Ivar Lumi

C# implementation of SIP
C# 2.0, C#, Windows, .NET, .NET 2.0VS2005, VS, Dev

Posted: 20 Mar 2007
Updated: 11 Jun 2007
Views: 53,123
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
23 votes for this Article.
Popularity: 5.99 Rating: 4.40 out of 5
1 vote, 4.3%
1
2 votes, 8.7%
2
0 votes, 0.0%
3
4 votes, 17.4%
4
16 votes, 69.6%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article
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 anf TCP 5061 for SSL communication. SIP protocol is very similar to HTTP, so who has some knowledge about http then 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: "mailto:john@domain.com-4524j">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 availabilty 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 net, so not good idea to rewrite these there.
If want more advanced info then see:
RFC 3261 (defines SIPv2)
http://www.iptel.org/sip/intro
http://www.sipdev.org/wiki/index.php/A_newcomer's_guide_to_SIP
http://www.tech-invite.com/

and also google.com is always your friend.

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 advanced example, code is well commeneted, so beginners don't hate me beacuse no more blaaa text here. Just read rfc 3216, see info links i noted before, if you then look
code all more nicer then.

Some free available softphones in www:
http://www.nch.com.au
http://www.counterpath.net

   
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:
email: ivar@lumisoft.ee
forum: http://www.lumisoft.ee/Forum

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Ivar Lumi



Location: Estonia Estonia

Other popular C# articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 141 (Total in Forum: 141) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralCompiling Source codemembersparadkar117:45 28 Jun '08  
GeneralRe: Compiling Source codememberIvar Lumi22:10 28 Jun '08  
GeneralRe: Compiling Source codemembersparadkar16:00 5 Jul '08  
QuestionNew to Net Sip...memberMember 44740141:08 15 May '08  
AnswerRe: New to Net Sip...memberIvar Lumi1:39 15 May '08  
GeneralRe: New to Net Sip...memberJim772:01 15 May '08  
GeneralRe: New to Net Sip...memberIvar Lumi2:06 15 May '08  
GeneralRe: New to Net Sip...memberJim772:18 15 May '08  
GeneralRe: New to Net Sip...memberIvar Lumi2:22 15 May '08  
GeneralRe: New to Net Sip...memberJim772:28 15 May '08  
Questionhimemberloayking22:02 5 May '08  
GeneralHow to send Notify SIP message to Softswitch?memberMyRitu2:16 1 Apr '08  
GeneralRe: How to send Notify SIP message to Softswitch?memberIvar Lumi3:53 1 Apr '08  
GeneralRe: How to send Notify SIP message to Softswitch?memberMyRitu4:00 1 Apr '08  
GeneralRe: How to send Notify SIP message to Softswitch?memberIvar Lumi4:23 1 Apr '08  
Question404 - Not foundmemberblueimage12:00 20 Dec '07  
GeneralRe: 404 - Not foundmemberIvar Lumi6:54 2 Jan '08  
GeneralRegister and 200 OKmemberlucnews10:46 13 Dec '07  
GeneralRe: Register and 200 OKmemberIvar Lumi8:30 17 Dec '07  
GeneralNAT and Media Servermemberlucnews10:05 13 Dec '07  
GeneralRe: NAT and Media ServermemberIvar Lumi8:29 17 Dec '07  
GeneralUse as client?memberbe-hahn3:44 27 Nov '07  
GeneralRe: Use as client?memberIvar Lumi4:51 27 Nov '07  
GeneralRe: Use as client?memberJoss#5:02 1 Jul '08  
GeneralRe: Use as client?memberIvar Lumi8:46 1 Jul '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 11 Jun 2007
Editor:
Copyright 2007 by Ivar Lumi
Everything else Copyright © CodeProject, 1999-2008
Web20 | Advertise on the Code Project