4.1.10. SessionDescriptionType
4.1.10. SessionDescriptionType
Session description objects (RTCSessionDescription) may be of type "offer", "pranswer", "answer", or "rollback". These types provide information as to how the description parameter should be parsed and how the media state should be changed.
"offer" indicates that a description MUST be parsed as an offer; said description may include many possible media configurations. A description used as an "offer" may be applied any time the PeerConnection is in a "stable" state or applied as an update to a previously supplied but unanswered "offer".
"pranswer" indicates that a description MUST be parsed as an answer, but not a final answer, and so MUST NOT result in the freeing of allocated resources. It may result in the start of media transmission, if the answer does not specify an inactive media direction. A description used as a "pranswer" may be applied as a response to an "offer" or as an update to a previously sent "pranswer".
"answer" indicates that a description MUST be parsed as an answer, the offer/answer exchange MUST be considered complete, and any resources (decoders, candidates) that are no longer needed SHOULD be released. A description used as an "answer" may be applied as a response to an "offer" or as an update to a previously sent "pranswer".
The only difference between a provisional and final answer is that the final answer results in the freeing of any unused resources that were allocated as a result of the offer. As such, the application can use some discretion on whether an answer should be applied as provisional or final and can change the type of the session description as needed. For example, in a serial forking scenario, an application may receive multiple "final" answers, one from each remote endpoint. The application could choose to accept the initial answers as provisional answers and only apply an answer as final when it receives one that meets its criteria (e.g., a live user instead of voicemail).
"rollback" is a special session description type indicating that the state machine MUST be rolled back to the previous "stable" state, as described in Section 4.1.10.2. The contents MUST be empty.