C# SIP 堆栈/库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/498056/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 05:43:46  来源:igfitidea点击:

C# SIP Stack/Library

c#voipsip

提问by bobwienholt

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?

我正在寻找用 C# 编写或提供 C# 包装器的良好 SIP 库。不一定需要免费。有人用过什么好东西吗?

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

澄清一下,我说的是 VoIP 协议 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.

为了进一步澄清,我正在寻找一个可以帮助我实现 SIP 代理服务器而无需手动构建 SIP 数据包的库。我不是在寻找星号、freeswitch 或任何其他 pbx 软件。

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.

我希望在 C# 中创建一个服务,它将等待 SIP 数据包并响应它们,我想要一个可以处理大部分细节的库。

回答by Sean Bright

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

看起来像一个不错的起点可能是这篇CodeProject 文章。但是,我不相信它处理媒体流。

回答by ankushnarula

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.

这对我来说看起来很有趣... http://developers.inova.si/sipobjects/Default.aspx?tabid=92- 它不是开源的,但它绝对是以 .NET 为中心的。它以 Avaya 为中心,因此可能不适合您的目的。

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

也看看这个:http: //www.codeplex.com/mysipswitch

回答by AviD

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...

我见过(没有直接使用,只是查看过)一个相当大且稳定的 VOIP 系统,它使用 Radware 的 SIP 堆栈。非常好(即没有问题),而且我也没有发现任何安全问题......

The system I reviewed was in C#.

我审查的系统是用 C# 编写的。

回答by Eric Z Beard

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).

不久前我需要这个并最终编写了我自己的 B2BUA(一个 SIP 代理,它也处理音频并充当对话双方的端点)。

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.

SIP 规范(和 RTP)的问题在于它非常复杂,尤其是您考虑了多年来对其进行的所有可选添加。每个人的实现方式都略有不同,因此如果您使用收缩包装的软件,您可能会遇到特定手机或服务器的问题。

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.

就我而言,我试图让 Microsoft Speech Server 与 SIP 终结器进行通信。Microsoft 对 SIP 规范有一个特别有创意的解释(最显着的例子是它们不支持 UDP)。此外,一些 VOIP 网关不支持 REFER 进行监督传输,这对于许多应用程序来说是必需的。

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.

其他答案中提供了几个不错的链接:我的建议是自己动手或使用开源的东西,这样当您遇到 SIP 实现中不可避免的不兼容问题时,您可以根据需要对其进行调整。

回答by Erik Funkenbusch

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.

不确定您要在这里寻找什么。您是在寻找客户端 VOIP 应用程序还是服务器端?如果是后者,您可能需要查看 FreeSwitch。他们拥有的一项功能是能够在 Mono 中编写扩展代码,这允许使用 C#。寻找 mod_mono 支持。

FreeSwitch

自由切换

回答by EnocNRoll - AnandaGopal Pardue

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

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.

所有 LanScape VOIP 产品,包括 LanScape VOIP 媒体引擎?是否从“头开始”设计以支持所有版本的 Microsoft Windows?2000 和 XP,包括最新版本的 Windows Vista。

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

我也碰巧个人知道它是 C# 友好的。

回答by JayG

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

7 年前,我经历了类似的探索,但正在寻找嵌入式 C 版本。我查看了oSIP库。它完成了将 SIP 数据包转换为结构并返回的所有工作。

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.

但是,文档中有一点让我印象深刻。作者建议您非常熟悉 SIP 规范 ( RFC 3261) 以有效地使用该库。多次阅读规范后,我最终编写了自己的解析器和调用控制应用程序。

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

请记住,SIP 仍然是一个不断发展的标准。有一个活跃的SIPForum组目前正在开发SIPConnect 1.1以标准化 SIP 服务提供商(例如 Vonage)和 SIP-PBX 之间的接口。还有一个名为BLISS的活动,用于定义在用户代理之间实现 SIP 功能的“最佳实践”。

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.

互操作性很难。有数百个与 SIP 相关的 RFC。不同的端点使用不同的端点,并且规范的解释并不总是兼容的。有几种不同的互操作性“测试事件(如SIPit),以确保您的实现与其他人一起工作。

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.

无论您选择什么,请确保您对正在实施的功能的规范有很好的了解。此外,规范和库将有助于数据包方面,但您仍然需要一个“呼叫控制”库(更高级别的“大脑”来决定如何处理 SIP 请求/响应)。您还需要一个媒体层来处理音频,除非您的应用程序纯粹是一个 SIP 代理。

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

尽管如此,一些互联网电话服务提供商 (ITSP) 已使用SIP Express 路由器作为其服务的前端代理。它是非常可配置的,并且具有很高的兼容性成功率。

回答by E Dominique

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 wrapperthat works really well.

恕我直言,迄今为止最好的堆栈之一是PJSIP。它是用非常便携的 C 语言编写的,并且有许多包装器。这是一个非常有效的.NET 包装器

回答by Ron Klein

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)

我们使用SIP.Net,对我们来说工作正常。
我们使用它来等待 SIP 数据包并保持 SIP 流非常简单。
请注意,有时它的对象模型过于详细,因此产品本身非常灵活(如果您需要这种灵活性)。然而,我们编写了一个更高级别的包装器(一种外观)只是为了让我们更容易。他们非常敏感,但 IMO 文档不够详细。
也可以查nsip(只是一个链接,我自己没试过)