Skip to main content

5.5. Processing a Local Description

5.5. Processing a Local Description

When a SessionDescription is supplied to setLocalDescription, the following steps MUST be performed:

  • If the description is of type "rollback", follow the processing defined in Section 5.7 and skip the processing described in the rest of this section.

  • Otherwise, the type of the SessionDescription is checked against the current state of the PeerConnection:

    • If the type is "offer", the PeerConnection state MUST be either "stable" or "have-local-offer".

    • If the type is "pranswer" or "answer", the PeerConnection state MUST be either "have-remote-offer" or "have-local-pranswer".

  • If the type is not correct for the current state, processing MUST stop and an error MUST be returned.

  • The SessionDescription is then checked to ensure that its contents are identical to those generated in the last call to createOffer/createAnswer, and thus have not been altered, as discussed in Section 5.4; otherwise, processing MUST stop and an error MUST be returned.

  • Next, the SessionDescription is parsed into a data structure, as described in Section 5.8 below.

  • Finally, the parsed SessionDescription is applied as described in Section 5.9 below.