5.8.1. Session-Level Parsing
5.8.1. Session-Level Parsing
First, the session-level lines are checked and parsed. These lines MUST occur in a specific order, and with a specific syntax, as defined in [RFC4566], Section 5. Note that while the specific line types (e.g., v=, c=) MUST occur in the defined order, lines of the same type (typically a=) can occur in any order.
The following non-attribute lines are not meaningful in the JSEP context and MAY be discarded once they have been checked.
-
The
c=line MUST be checked for syntax, but its value is only used for ICE mismatch detection, as defined in [RFC8445], Section 5.4. Note that JSEP implementations should never encounter this condition because ICE is required for WebRTC. -
The
i=,u=,e=,p=,t=,r=,z=, andk=lines MUST be checked for syntax, but their values are not otherwise used.
The remaining non-attribute lines are processed as follows:
-
The
v=line MUST have a version of 0, as specified in [RFC4566], Section 5.1. -
The
o=line MUST be parsed as specified in [RFC4566], Section 5.2. -
The
b=line, if present, MUST be parsed as specified in [RFC4566], Section 5.8, and the bwtype and bandwidth values stored.
Finally, the attribute lines are processed. Specific processing MUST be applied for the following session-level attribute (a=) lines:
-
Any
a=grouplines are parsed as specified in [RFC5888], Section 5, and the group's semantics and mids are stored. -
If present, a single
a=ice-liteline is parsed as specified in [RFC8839], Section 5.3, and a value indicating the presence of ice-lite is stored. -
If present, a single
a=ice-ufragline is parsed as specified in [RFC8839], Section 5.4, and the ufrag value is stored. -
If present, a single
a=ice-pwdline is parsed as specified in [RFC8839], Section 5.4, and the password value is stored. -
If present, a single
a=ice-optionsline is parsed as specified in [RFC8839], Section 5.6, and the set of specified options is stored. -
Any
a=fingerprintlines are parsed as specified in [RFC8122], Section 5, and the set of fingerprint and algorithm values is stored. -
If present, a single
a=setupline is parsed as specified in [RFC4145], Section 4, and the setup value is stored. -
If present, a single
a=tls-idline is parsed as specified in [RFC8842], Section 5, and the attribute value is stored. -
Any
a=identitylines are parsed and the identity values stored for subsequent verification, as specified in [RFC8827], Section 5. -
Any
a=extmaplines are parsed as specified in [RFC5285], Section 5, and their values are stored.
Other attributes that are not relevant to JSEP may also be present, and implementations SHOULD process any that they recognize. As required by [RFC4566], Section 5.13, unknown attribute lines MUST be ignored.
Once all the session-level lines have been parsed, processing continues with the lines in m= sections.