SDP协议

 

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。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值