C# SIP Stack/Library

bobwienholt picture bobwienholt · Jan 31, 2009 · Viewed 69.5k times · Source

I am looking for a good SIP library either written in C# or that provides a C# wrapper. Does not necessarily need to be free. Has anyone used anything good?

To clarify, I am talking about the VoIP protocol SIP.

I am really looking for more than a google search on this one. I would like to someone to come back and say "We use ______, and it works great."

To clarify further, I am looking for a library that would help me to implement a SIP proxy server without having to manually construct the SIP packets. I'm not looking for asterisk, freeswitch or any other pbx software.

I am looking to create a service in C#, that will wait for SIP packets and respond to them and I would like a library that would handle most of the details.

Answer

JayG picture JayG · Feb 9, 2009

I went through a similar quest 7 years ago, but looking for an embedded C version. I looked at the oSIP library. It did all the work of converting SIP packets to structures and back.

However, one point in the documentation stuck with me. The author recommended that you become very familiar with the SIP specification (RFC 3261) to use the library effectively. After reading the specs several times, I ended up writing my own parser and call control application.

Keep in mind that SIP is still an evolving standard. There is an active SIPForum group that is currently developing SIPConnect 1.1 to standardize on an interface between a SIP Service provider (e.g. Vonage) and a SIP-PBX. There is also an activity called BLISS for defining the "best practices" to implement SIP features between User Agents.

Interoperability is tough. There are hundreds of RFCs related to SIP. Different end-points use different ones, and interpretations of the specs are not always compatible. There are several different interoperability "test events (like SIPit) to make sure your implementation works with others.

Whatever you select, make sure you have a good understanding of the specs for the features you are implementing. Additionally, the specs and libraries will help with the packet side, but you still need a "call control" library (higher level "brain" to decide how to process a SIP request/response). You also need a media layer to handle audio unless your application is purely a SIP proxy.

Having said all that, several Internet Telephony Service Providers (ITSPs) have used the SIP Express Router as a front-end proxy for their services. It is very configurable and has a high success rate for compatibility.