织梦CMS - 轻松建站从此开始!

罗索

SDP协议学习笔记

落鹤生 发布于 2010-05-25 14:37 点击:次 
在SIP协议的包含的内容是SDP时,应该把Content-Type设置成application/sdp。
TAG:

SDP:Session Description Protocol

SDP格式:
      Session description
         v=  (protocol version)
         o=  (owner/creator and session identifier)
         s=  (session name)
         i=* (session information)
         u=* (URI of description)
         e=* (email address)
         p=* (phone number)
         c=* (connection information - not required if included in all media)
         b=* (zero or more bandwidth information lines)
         One or more time descriptions ("t=" and "r=" lines, see below)
         z=* (time zone adjustments)
         k=* (encryption key)
         a=* (zero or more session attribute lines)
         Zero or more media descriptions

      Time description
         t=  (time the session is active)
         r=* (zero or more repeat times)

      Media description, if present
         m=  (media name and transport address)
         i=* (media title)
         c=* (connection information - optional if included at
              session-level)
         b=* (zero or more bandwidth information lines)
         k=* (encryption key)
         a=* (zero or more media attribute lines)

以上带"*"号的是可选的,其余的是必须的。一般顺序也按照上面的顺序来排列。


a=*是sdp协议扩展属性定义,除上面以外的,分解时其它的都可以扔掉。
a=charset属性指定协议使用的字符集。一般的是ISO-10646。


示例:
v=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
   其中:nettype是IN,代表internet,addrtype是IP4或IP6。unicast-address任务创建计算机的地址。
   整个这个属性,是唯一表示一个任务。


e=123@126.com 或 p=+1 616 555-6011
对于一个任务只能两者之中的一个,表示会议控制者的联系方式。邮件地址可以是[email]j.doe@example.com[/email] (Jane Doe)形式,括号里面的是描述联系人的名称,或者Jane Doe <[email]j.doe@example.com[/email]>,前面的是联系人的名称。


c=<nettype> <addrtype> <connection-address>
这个连接数据,可以是传话级别的连接数据,或者是单独一个媒体数据的连接数据。在是多播时,connection-address就该是一个多播组地址,当是单播时,connection-address就该是一个单播地址。对于addrtype是IP4的情况下,connection-address不仅包含IP地址,并且还要包含a time to live value(TTL 0-255),如:c=IN IP4 224.2.36.42/128,IP6没有这个TTL值。还允许象这样的<base multicast address>[/<ttl>]/<number of addresses>格式的connection-address。如:c=IN IP4 224.2.1.1/127/3等同于包含c=IN IP4 224.2.1.1/127, c=IN IP4 224.2.1.2/127, c=IN IP4 224.2.1.3/127三行内容。


b=<bwtype>:<bandwidth> bwtype可以是CT或AS,CT方式是设置整个会议的带宽,AS是设置单个会话的带宽。缺省带宽是千比特每秒。
t=<start-time> <stop-time>,这个可以有行,指定多个不规则时间段,如果是规则的时间段,则r=属性可以使用。start-time和stop- time都遵从NTP(Network Time Protocol),是以秒为单位,自从1900以来的时间。要转换为UNIX时间,减去2208988800。如果stop-time设置为0,则会话没有时间限制。如果start-time也设置为0,则会话被认为是永久的。


r=<repeat-interval> <active duration> <offsets from start-time>重复次数在时间表示里面可以如下表示:
      d - days (86400 seconds)
      h - hours (3600 seconds)
      m - minutes (60 seconds)
      s - seconds (allowed for completeness)
z=<adjustment time> <offset> <adjustment time> <offset> ....
k=<method>
k=<method>:<encryption key>
a=<attribute>
a=<attribute>:<value>
m=<media> <port> <proto> <fmt> ...
m=<media> <port>/<number of ports> <proto> <fmt> ...
其中:<media>可以是,"audio","video", "text", "application" and "message"。<port>是媒体传送的端口号,它依赖于c=和<proto>。<proto> 可以是,udp,RTP/AVP和RTP/SAVP。


a=cat:<category>分类,根据分类接收者隔离相应的会话
a=keywds:<keywords>关键字,根据关键字隔离相应的会话
a=tool:<name and version of tool>创建任务描述的工具的名称及版本号
a=ptime:<packet time>在一个包里面的以毫秒为单位的媒体长度
a=maxptime:<maximum packet time>以毫秒为单位,能够压缩进一个包的媒体量。
a=rtpmap:<payload type> <encoding name>/<clock rate> [/<encoding   parameters>]
a=recvonly
a=sendrecv
a=sendonly
a=inactive,
a=orient:<orientation>其可能的值,"portrait", "landscape" and "seascape" 。
a=type:<conference type>,建议值是,"broadcast", "meeting", "moderated", "test" and "H332"。
a=charset:<character set>
a=sdplang:<language tag>指定会话或者是媒体级别使用的语言
a=framerate:<frame rate>设置最大视频帧速率
a=quality:<quality>值是0-10
a=fmtp:<format> <format specific parameters>

在SIP协议的包含的内容是SDP时,应该把Content-Type设置成application/sdp。

(besti)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/201005/9494.html]
本文出处:besti.cublog.cn 作者:besti
顶一下
(4)
100%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容