Aller au contenu principal

9. Grammaire SDP

Cette section fournit la syntaxe ABNF (Augmented Backus-Naur Form, forme de Backus-Naur augmentée) de SDP. L'ABNF est définie dans la [RFC 5234].

Définition de la syntaxe SDP

; SDP Syntax
session-description = proto-version
origin-field
session-name-field
information-field
uri-field
email-fields
phone-fields
connection-field
bandwidth-fields
time-fields
key-field
attribute-fields
media-descriptions

proto-version = %x76 "=" 1*DIGIT CRLF
;this memo describes version 0

origin-field = %x6f "=" username SP sess-id SP sess-version SP
nettype SP addrtype SP unicast-address CRLF

session-name-field = %x73 "=" text CRLF

information-field = [%x69 "=" text CRLF]

uri-field = [%x75 "=" uri CRLF]

email-fields = *(%x65 "=" email-address CRLF)

phone-fields = *(%x70 "=" phone-number CRLF)

connection-field = [%x63 "=" nettype SP addrtype SP
connection-address CRLF]

bandwidth-fields = *(%x62 "=" bwtype ":" bandwidth CRLF)

time-fields = 1*( %x74 "=" start-time SP stop-time
*(CRLF repeat-fields) CRLF)
[zone-adjustments CRLF]

repeat-fields = %x72 "=" repeat-interval SP typed-time
1*(SP typed-time)

zone-adjustments = %x7a "=" time SP ["-"] typed-time
*(SP time SP ["-"] typed-time)

key-field = [%x6b "=" key-type CRLF]

attribute-fields = *(%x61 "=" attribute CRLF)

media-descriptions = *( media-field
information-field
*connection-field
bandwidth-fields
key-field
attribute-fields )

media-field = %x6d "=" media SP port ["/" integer]
SP proto 1*(SP fmt) CRLF

; Sub-rules
username = non-ws-string
sess-id = 1*DIGIT
sess-version = 1*DIGIT
nettype = token
addrtype = token
media = token
port = 1*DIGIT
proto = token *("/" token)
fmt = token

Remarque : La définition complète de la syntaxe ABNF est très détaillée et comprend toutes les règles détaillées et les définitions des symboles terminaux pour chaque champ. Pour la syntaxe complète, veuillez consulter le document officiel RFC 4566, section 9.