.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Articles >> C# >> Post New Resource Bookmark and Share   

 Subscribe to Articles

How to build a C# SIP softphone client

Posted By:Evan Miller       Posted Date: July 07, 2011    Points: 200    Category: C#    URL: http://www.dotnetspark.com  

This article shows you how to build a SIP softphone client in C#.

The  Voice over Internet Protocol (VoIP) (telephoning on the internet) is a world-wide telecommunication technology in the corporated telecommunication systems and lately most internet suppliers offer VoIP communication solutions to their customers. Its spread can be attributable to the favorable configurating and maintaining costs. To realize VoIP communication many protocols were born, but the two most successful were the SIP (Session Initiation Protocol) and the H.323 standard made by the ITU-T (International Telecommunication Union). Because SIP offers a newer and simplier realization than H.323 the VoIP world is tending to the SIP VoIP solutions. SIP is a text based internet communication protocol. Its object is to build up the communication connections between the participants. Doing this by SIP messages in request-response form, with HTML-like header-fields.


I've already experienced every difficulty of developing a softphone client, so now I would like to suggest you the easier way. Building a softphone is not that hard if you use the convenient help. In this case it is a software development kit. Of all VoIP sdks I've found this one the best: http://www.voip-sip-sdk.com/p_193-how-to-build-a-c-sip-softphone-client-that-can-register-with-a-sip-service-provider-voip.html


To get to know it better, please take a look at the coding of the downloadable sample program:


SIP messages are text messages defining UTF-8 encoded requests and responses in client-server communication. Both message types are based on the same form. Each SIP messages consist of a start-line and one or more message headers, then one empty line (CRLF) that is followed by the optional message body. CLRF divides the message header from the message body. CLRF line is mandatory even in cases when there is no message body in the SIP message.

1.    generic-message = start-line  

2.    *message-headers  

3.    CRLF  

4.      [message-body]  

5.    start-line = Request-Line / Status-Line  

It can be obviously decided if the message is a request or a response on the basis of its start-line. The start-line is either a request-line or a status-line.

The structure of request-line:

1.    Request-Line = Method SP Request-URI SP SIP-Version CRLF  

- where SP is a single space character, CLRF is carriage-return line-feed
- where Method defines the method to be executed. A simple call can be handled with the following methods: REGISTER, INVITE, ACK, BYE and CANCEL
- where Request-URL is a SIP address
- where SIP-version is the version number of the used SIP

The structure of status line:

1.    Status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF  

- where Status-Code is a 3 digit "integer" number that identifies in which of the six response groups the given response message belongs (informative responses, successful connection responses, redirect, unsuccessful request, server errors, generic errors)
- where Reason Pharse is the text name that is related to status code


SIP protocol defines several message-header types. The information content of these message-header types and the syntax of providing this information mainly depend on the message-header type itself. Moreover the semantic interpretation of the same header-fields may also differ from the role the SIP message has in its environment. Considering the length of this article I will not deal more with the detailed syntax and semantics analysis regarding the header field types. I will only mention the ones that are needed to ring a telephone (via, to, from, call-id, CSeq, Contact, Content-Length).

The general form requirements of SIP header fields:

field-name: field-value

The requirements regarding the syntax and semantics of field-value can strongly differ according to the header type.


This was only a small fragment of programming a softphone. The starting is easy, but believe me, with the use of a good sdk you can save yourself a lot of time and avoid the nerves. If this short article wasn't enough for your curiousness, you should visit the site mentioned above. Thanks for your attention.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend