【问题标题】:Can't set ttl in sdp as described in RFC 2327无法按照 RFC 2327 中的说明在 sdp 中设置 ttl
【发布时间】:2017-05-19 08:09:35
【问题描述】:

如果我尝试在 Microsoft.Rtc.Collaboration.dll 的帮助下解析以下 sdp:

v=0
o=- 0 0 IN IP4 192.168.253.202
s=session
c=IN IP4 224.2.36.42/127
t=0 0
m=message 5060 sip null
a=accept-types:text/plain

我正在使用以下代码:

Sdp<SdpGlobalDescription, SdpMediaDescription> sessionDescription2 = new Sdp<SdpGlobalDescription, SdpMediaDescription>();

var encodedText = Encoding.ASCII.GetBytes(text);  <---- text is the sdp above
if (sessionDescription2.TryParse(encodedText, 0, encodedText.Length, true))

但我得到:第 4 行:值不是有效的 IP 地址或主机名

在 RFC2327 中可以找到

The TTL for the session is appended to the address using a slash as
a separator.  An example is:

c=IN IP4 224.2.1.1/127

那么我该怎么做才能从 sdp 设置和读取 ttl?

【问题讨论】:

    标签: sip sdp ucma


    【解决方案1】:

    只是 Microsoft.Rtc 不理解这个扩展。很多 SIP/WebRTC/SDP 软件都不支持这个。

    我建议不要在 SDP 中使用 TTL 值,而是在信令中使用它。您可以在请求 URI 中指定它:

    sip:target@domain.com;maddr=224.2.1.1;ttl=127
    

    您可以使用 SetAddressInfo 进行设置:

    hr = myconnection->SetAddressInfo(uri,1,TTL);
    

    【讨论】:

    • 谢谢你的回答,但是我必须使用第三方软件的SDP,它使用c=定义中的TTL。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-14
    • 1970-01-01
    • 2012-02-03
    • 2013-12-14
    • 2019-07-29
    • 1970-01-01
    相关资源
    最近更新 更多