Skip to main content

5.6. Processing a Remote Description

5.6. Processing a Remote Description

When a SessionDescription is supplied to setRemoteDescription, 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-remote-offer".

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

  • If the type is not correct for the current state, 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. If parsing fails for any reason, processing MUST stop and an error MUST be returned.

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