<abstract>This specification defines a Jingle application type for transport the Session Description Protocol (SDP) over Jingle.</abstract>
&LEGALNOTICE;
<number>xxxx</number>
<status>ProtoXEP</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0166</spec>
<spec>XEP-0176</spec>
<spec>XEP-0320</spec>
<spec>RFC 4566</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>jingle-sdp</shortname>
&fippo;
<revision>
<version>0.0.1</version>
<date>2013-09-05</date>
<initials>ph</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1topic='Introduction'anchor='intro'>
<p>The IETFs RTCWEB working group has decided to use &rfc4566; as the API surface for WebRTC. For XMPP this opened up a number of questions about the future of Jingle, XMPPs native signalling protocol, since Jingle does not use SDP. Various proposals have been made, including mappingSDP to Jingle and vice versa over to a dumb transport of SDP (called SoX) inside <message/> stanzas. This document proposes a way to transport SDP over Jingle which respects the established session model of Jingle.</p>
</section1>
<section1topic='Requirements'anchor='reqs'>
<ol>
<li>MUST use the Jingle session model defined in XEP-0166.</li>
<li>MUST be able to transport a WebRTC SDP in a lossless way.</li>
<li>MUST retain the separation of transport.</li>
<li>MUST use one <content> element per m-line.</li>
<p>This SDP consists of a session level section and has two media description. It can easily be transformed to the following session-initiate by splitting it at "\r\nm=":</p>
<p>Note that the a=ice-ufrag, a=ice-pwd and a=fingerprint lines are removed from the SDP (either in session level or all of the mediadescriptions) and put into the transport element. The same rule applies to any a=candidate lines.<note>FIXME: what about ice-options and rtcp-mux?</note></p>
<p>The receiver can reconstruct the SDP by first extracting the session section and then appending the media descriptions. When reconstructing the mediasections, the transport information can simply be appended to the raw SDP.</p>
<p>Sending individual ice candidates is done as described in &xep0176;:</p>
<examplecaption="Initiator sends a subsequent candidate"><![CDATA[
<p>The mapping of a=candidate lines to Jingle and vice versa is relatively simple and described in <cite>XEP-0176</cite>.</p>
</section1>
<section1topic='Adding and removing a content'>
<p>This section is actually where things get interesting. It should talk about adding or removing content which is a concept that has been known in Jingle for ages and is now coming to SDP with the "partial offer/partial answer" concept from Unified Plan. This is the reason why the individual m-lines are transported in separate <content/> elements.</p>
<p>The initiator starts with the offer SDP as described in the first section, but with audio only. Video is added later. Thus it sends the following session-initiate:</p>
<p>After the session is established, the initiator wants to add video from his webcam. It creates a new (full) SDP offer which will look like the one in example 1, but with candidates already added. It then calculates the difference between the new offer and the initial offer<note>At some point, the browser may do this.</note> which may consist of more than one mediaparts.</p>
<p>When BUNDLE is used this will typically also contain a=candidate lines which are omitted for simplicity. This is transformed to a content-add. Note that the session-part must be resent if BUNDLE is used in the session since the BUNDLE group has changed:</p>
<p>The receiver extracts the new session part and the additional media description(s) and constructs the new SDP based on the previous one<note>at some point, the browser may be able to do this, too</note>.</p>