5. SDP Specification
An SDP description is denoted by the media type "application/sdp" (See Section 8).
An SDP description is entirely textual. SDP field names and attribute names use only the US-ASCII subset of UTF-8 [RFC3629], but textual fields and attribute values MAY use the full ISO 10646 character set in UTF-8 encoding, or some other character set defined by the "a=charset:" attribute (Section 6.10). Field and attribute values that use the full UTF-8 character set are never directly compared, hence there is no requirement for UTF-8 normalization. The textual form, as opposed to a binary encoding such as ASN.1 or XDR, was chosen to enhance portability, to enable a variety of transports to be used, and to allow flexible, text-based toolkits to be used to generate and process session descriptions. However, since SDP may be used in environments where the maximum permissible size of a session description is limited, the encoding is deliberately compact. Also, since descriptions may be transported via very unreliable means or damaged by an intermediate caching server, the encoding was designed with strict order and formatting rules so that most errors would result in malformed session descriptions that could be detected easily and discarded.
An SDP description consists of a number of lines of text of the form:
<type>=<value>
where <type> is exactly one case-significant character and <value> is structured text whose format depends on <type>. In general, <value> is either a number of subfields delimited by a single space character or a free format string, and is case-significant unless a specific field defines otherwise. Whitespace separators are not used on either side of the "=" sign, however, the value can contain a leading whitespace as part of its syntax, i.e., that whitespace is part of the value.
An SDP description MUST conform to the syntax defined in Section 9. The following is an overview of the syntax.
An SDP description consists of a session-level section followed by zero or more media descriptions. The session-level section starts with a "v=" line and continues to the first media description (or the end of the whole description, whichever comes first). Each media description starts with an "m=" line and continues to the next media description or the end of the whole session description, whichever comes first. In general, session-level values are the default for all media unless overridden by an equivalent media-level value.
Some lines in each description are required and some are optional, but when present, they must appear in exactly the order given here. (The fixed order greatly enhances error detection and allows for a simple parser). In the following overview, optional items are marked with a "*".
Session description
v= (protocol version)
o= (originator 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 descriptions)
b=* (zero or more bandwidth information lines)
One or more time descriptions:
("t=", "r=" and "z=" lines; see below)
k=* (obsolete)
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)
z=* (optional time zone offset line)
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=* (obsolete)
a=* (zero or more media attribute lines)
The set of type letters is deliberately small and not intended to be extensible -- an SDP parser MUST completely ignore or reject any session description that contains a type letter that it does not understand. The attribute mechanism ("a=", described in Section 5.13) is the primary means for extending SDP and tailoring it to particular applications or media. Some attributes (the ones listed in Section 6) have a defined meaning, but others may be added on a media- or session-specific basis.
An SDP description may contain URIs that reference external content in the "u=", "k=", and "a=" lines. These URIs may be dereferenced in some cases, making the session description non-self-contained.
5.1. Protocol Version ("v=")
v=0
The "v=" line (version-field) gives the version of the Session Description Protocol. This memo defines version 0. There is no minor version number.
5.2. Origin ("o=")
o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
The "o=" line (origin-field) gives the originator of the session (her username and the address of the user's host) plus a session identifier and version number.
5.3. Session Name ("s=")
s=<session name>
The "s=" line (session-name-field) is the textual session name. There MUST be one and only one "s=" line per session description.
5.4. Session Information ("i=")
i=<session information>
The "i=" line (information-field) provides textual information about the session.
5.5. URI ("u=")
u=<uri>
The "u=" line (uri-field) specifies a Uniform Resource Identifier.
5.6. Email Address and Phone Number
e=<email-address>
p=<phone-number>
The "e=" line (email-field) and "p=" line (phone-field) specify contact information for the person responsible for the conference.
5.7. Connection Information ("c=")
c=<nettype> <addrtype> <connection-address>
The "c=" line (connection-field) contains connection data.
5.8. Bandwidth Information ("b=")
b=<bwtype>:<bandwidth>
The "b=" line (bandwidth-field) denotes the proposed bandwidth to be used by the session or media.
5.9. Time Active ("t=")
t=<start-time> <stop-time>
The "t=" line (time-field) specifies the start and stop times for a session.
5.10. Repeat Times ("r=")
r=<repeat interval> <active duration> <offsets from start-time>
The "r=" line (repeat-field) specifies repeat times for a session.
5.11. Time Zone Adjustment ("z=")
z=<adjustment time> <offset> <adjustment time> <offset> ...
The "z=" line (timezone-field) specifies time zone offset changes.
5.12. Encryption Keys ("k=")
k=<method>
k=<method>:<encryption key>
Note: The use of the "k=" field is obsolete.
5.13. Attributes ("a=")
a=<attribute>
a=<attribute>:<value>
The "a=" line (attribute-field) is used to extend SDP.
5.14. Media Descriptions ("m=")
m=<media> <port> <proto> <fmt> ...
A session description may contain a number of media descriptions. Each media description starts with an "m=" line (media-field).
5.14.1. <media>
The <media> is the media type. Defined media types are "audio", "video", "text", "application", and "message".
5.14.2. <port>
The <port> is the transport port to which the media stream is sent.
5.14.3. <proto>
The <proto> is the transport protocol.
5.14.4. <fmt>
The <fmt> is a media format description.