跳到主要内容

6. SDP 属性

Attributes 是扩展 SDP 的主要方式. Attributes 可以被定义为用作 "session-level" attributes, "media-level" attributes, 或二者兼用.

媒体描述可以包含任意数量的 media-specific attributes ("a=" 字段). 这些被称为 "media-level" attributes, 用于添加关于媒体流的信息. 属性字段也可以添加在第一个媒体字段之前. 这些 "session-level" attributes 传达适用于整个会议而非单个媒体的附加信息.

属性字段可以采用两种形式:

  • 属性型 attribute 只是形如 "a=<flag>". 这些是二元 attributes, 该 attribute 的存在表示它是会话的一个属性. 示例可以是 "a=recvonly".
  • 值型 attribute 的形式为 "a=<attribute>:<value>". 例如, 白板可以具有值型 attribute "a=orient:landscape".

Attribute 的解释取决于被调用的媒体工具. 因此, 会话描述的接收方应能配置其对会话描述的一般解释方式, 尤其是对 attributes 的解释方式.

Attribute 名称 MUST 使用 UTF-8 的 US-ASCII 子集, 但 attribute 值是八位组字符串, MAY 使用除 0x00 (Nul), 0x0A (LF), 和 0x0D (CR) 之外的任意八位组值.

6.1. cat (类别)

a=cat:<category>

此 attribute 给出会话的以点分隔的层次化类别.

6.2. keywds (关键词)

a=keywds:<keywords>

此 attribute 提供一个以逗号分隔的关键词列表, 用于描述会话.

6.3. tool

a=tool:<name and version of tool>

此 attribute 给出用于创建会话描述的工具名称和版本号.

6.4. ptime (包时间)

a=ptime:<packet time>

此 attribute 给出一个包中的媒体所表示的时间长度, 以毫秒为单位.

6.5. maxptime (最大包时间)

a=maxptime:<maximum packet time>

此 attribute 给出每个包中可封装的最大媒体量, 以毫秒为单位的时间表示.

6.6. rtpmap (RTP 载荷类型映射)

a=rtpmap:<payload type> <encoding name>/<clock rate> [/<encoding parameters>]

此 attribute 将 RTP 载荷类型编号映射到一个编码名称, 该编码名称表示要使用的载荷格式.

6.7. recvonly (仅接收)

a=recvonly

这指定工具应以仅接收模式启动.

6.8. sendrecv (发送和接收)

a=sendrecv

这指定工具应以发送和接收模式启动. 这是默认值.

6.9. sendonly (仅发送)

a=sendonly

这指定工具应以仅发送模式启动.

6.10. inactive

a=inactive

这指定工具应以非活动模式启动.

6.11. orient (方向)

a=orient:<orientation>

通常这只用于白板或演示工具. 它指定屏幕上工作区的方向.

6.12. type (会议类型)

a=type:<conference type>

这指定会议的类型.

6.13. charset (字符集)

a=charset:<character set>

这指定用于显示会话名称和信息数据的字符集.

6.14. sdplang (SDP 语言)

a=sdplang:<language tag>

此 attribute 指定会话描述的语言.

6.15. lang (语言)

a=lang:<language tag>

此 attribute 指定媒体描述的语言.