62

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.

User97693321
  • 3,336
  • 7
  • 45
  • 69
bobwienholt
  • 17,420
  • 3
  • 40
  • 48
  • Having done the same thing, you might consider looking at a C++ version and perhaps compiling to managed code. The managed solutions (as of a bit ago) weren't very good. (We ended up writing our own -- if its a proxy only, it's not that hard.) – MichaelGG Feb 05 '09 at 22:07

19 Answers19

22

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.

JayG
  • 4,339
  • 3
  • 23
  • 19
9

IMHO, one of the best stacks by far is PJSIP. It is written in very portable C and has a number of wrappers. Here is a .NET wrapper that works really well.

E Dominique
  • 1,535
  • 13
  • 17
  • 1
    Wrapper has moved to https://sites.google.com/site/sipekvoip/Home/documentation/pjsipwrapper – Quango Jan 23 '12 at 12:21
7

Here are a couple I came across:

http://www.independentsoft.com/sip/index.html

http://voipengine.googlepages.com/sipeksdk

Xaisoft
  • 45,655
  • 87
  • 279
  • 432
6

My sipsorcery project is another option. It contains a SIP stack written completely in C#.

sipsorcery
  • 30,273
  • 24
  • 104
  • 155
  • Only support uLaw. No selectable audio devices. – dkapa Apr 08 '15 at 18:06
  • dkapa, sipsorcery is a sip stack, not an rtp stack. Not appropriate (imho) for sip phones, however perfectly servicable for sip server projects, although one might need to integrate an rtp stack in to handle any media serving that might be needed. – Shayne Jul 23 '16 at 08:18
  • It has moved to github https://github.com/sipsorcery-org/sipsorcery – josibu Jan 28 '21 at 06:41
6

We use SIP.Net, works OK for us.
We use it to wait for SIP packets and keep the SIP flow very simple.
Note that sometimes its object model is too detailed, so the product itself is very flexible (if you need such flexibility). However, we wrote a higher level wrapper (a kind of a façade) just to make things easier for us. They're very responsive, but the documentation is not detailed enough IMO.
You can also check nsip (just a link, I haven't tried it myself)

Ron Klein
  • 9,178
  • 9
  • 55
  • 88
4

I needed this a while back and ended up writing my own B2BUA (a SIP proxy that also handles the audio and acts as an endpoint to both sides of the conversation).

The problem with the SIP spec (and RTP), is that it's very complicated, especially is you consider all of the optional additions that have been made to it over the years. Everyone implements it just a little bit differently, so if you go with shrink-wrapped software, you might run into problems with specific phones or servers.

In my case, I was trying to get Microsoft Speech Server to communicate with SIP terminators. Microsoft has an especially creative interpretation of the SIP spec (the most notable example being that they do not support UDP). Also, some VOIP gateways do not support REFER for supervised transfers, which is a necessity for many applications.

Several decent links have been provided in the other answers: my advice is to roll your own or go with something that is open source so you can tweak it as necessary when you run into the inevitable incompatibilites in SIP implementations.

Eric Z Beard
  • 37,669
  • 27
  • 100
  • 145
3

http://www.konnetic.com is a relatively new addition. Fully managed. Everything you need to work with SIP and SDP. They haven’t picked the low-hanging fruit in the standard like a lot of the others. Just as good but tied to Microsoft is the Microsoft Lync server.

jwri
  • 81
  • 2
3

Looks like a decent starting point might be this CodeProject article. I don't believe it handles the media stream, however.

Sean Bright
  • 118,630
  • 17
  • 138
  • 146
2

Perhaps you want to try lumisoft. Entirely build in C#. Completely open source and free. lumisoft

hannes
  • 21
  • 1
2

Try Voice Elements .

It is a .NET Telephony Tool and they have their own SIP Stack. Use C# or whatever .NET language of your choice.

i.am.michiel
  • 10,281
  • 7
  • 50
  • 86
2

Konnetic provide fully managed SIP components for .NET development.

Their .NET SIP SDK is probably the most comprehensive.

Otherwise, Microsoft's Lync server comes with a very good managed SIP library, available here: www.microsoft.com/en-us/lync/default.aspx

jnielsen
  • 192
  • 1
  • 4
2

Not sure what you're looking for here. Are you looking for a client-side VOIP application or a server side? If the latter, you might want to check out FreeSwitch. One feature they have is the ability to write extension code in Mono, which allows C#. Look for mod_mono support.

FreeSwitch

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
  • I renamed it to mod_managed, and it now supports Mono and CLR. And FreeSWITCH can run embedded, which allows some other interesting scenarios. – MichaelGG Feb 25 '09 at 04:15
1

The best i found was VoIP Video SIP SDK It provide as well video with high quality

1

LumiSoft.Net is a very good SIP stack for C#. It has all basic libraries such as SIP, RTP, SDP, DNS and many other libs to build a robust sip proxy server or SIP client very easily.

Lernkurve
  • 20,203
  • 28
  • 86
  • 118
1

I've seen (not used directly, just reviewed) a fairly large and stable VOIP system using a SIP stack from Radware. Very good (i.e. no problems), and I didn't find any security issues with it either...

The system I reviewed was in C#.

AviD
  • 12,944
  • 7
  • 61
  • 91
1

In the past, I've used Live Communications Server from MS (thought it was in 2003). The SDK associated was pretty bad.

There's now the new version, Office Communications Server. I haven't developed with the SDK but seen some demos that were pretty cool.

LB40
  • 12,041
  • 17
  • 72
  • 107
0

This looks interesting to me... http://developers.inova.si/sipobjects/Default.aspx?tabid=92 - it's not open source, but it's definitely .NET-centric. It's Avaya centric so it may not suit your purposes.

Also look at this: http://www.codeplex.com/mysipswitch

ankushnarula
  • 123
  • 8
0

LanScape: http://www.lanscapecorp.com/

All LanScape VOIP products including the LanScape VOIP Media Engine™ have been designed from the "ground up" to support all versions of Microsoft Windows® 2000 and XP up to and including the latest version of Windows Vista.

I also happen to personally know that it is C#-friendly.

-1

Read about Avaya DMCC. You can register in AvayaDev and download it for free. That C# framework let you leverage all the pbx features with AES and CM. You can check if you have SIP supported too.

MRFerocius
  • 5,509
  • 7
  • 39
  • 47