<abstract>This specification provides a way for the initiator of a Jingle session to propose sending an invitation in an XMPP message stanza, thus taking advantage of message delivery semantics instead of sending IQ stanzas to all of the responder's online resources or choosing a particular online resource.</abstract>
<remark><p>Added explanatory text; defined more granular actions (propose, retract, accept, reject, proceed); mandated inclusion of description elements within the propose element, as in jingle-pub; defined schema.</p></remark>
<p>Because &xep0166; uses &IQ; stanzas for all interactions between the parties to a session, when sending an invitation the initiator needs to either pick one of the responder's resources (e.g., based on &xep0115; information) or send the invitation to all of the responder's resources that support Jingle. The first method is prone to error (e.g., in cases where more than one resource supports Jingle) and the second method requires sending a separate invitation to each resource. Neither of these is ideal. Although &xep0276; proposed a way to overcome the problem, it too has issues (e.g., dependency on a presence service and the need to reveal all supported XMPP features) and in any case has not been widely implemented.</p>
<p>This document proposes an alternative solution: exchanging a &MESSAGE; stanza before sending the Jingle invitation in an &IQ; stanza. (Indeed, in the early discussions leading up to the Jingle protocol the authors considered using &MESSAGE; stanzas instead of &IQ; stanzas, but chose the latter for their deterministic handling semantics.) This method effectively results in a kind of decloaking for Jingle purposes.</p>
</section1>
<section1topic='Requirements'anchor='reqs'>
<p>This protocol was designed with the following requirements in mind:</p>
<ul>
<li>Allow responder to choose the resource or device on which to take the call.</li>
<li>Result in "ring-on-all-devices" behavior.</li>
<li>Not rely on presence.</li>
<li>Make use of "forking" semantics for message stanzas.</li>
<li>Allow indication of session content.</li>
<li>Work with push notifications.</li>
</ul>
</section1>
<section1topic='Use Cases'anchor='usecases'>
<section2topic='Indicating Intent to Start a Session'anchor='intent'>
<p>In order to prepare for sending a Jingle invitation, the initiator (e.g., Romeo) sends a &MESSAGE; stanza containing a <propose/> element qualified by the 'urn:xmpp:jingle-message:0' namespace. The <propose/> element MUST possess an 'id' attribute that will be used for the session invitation and MUST contain one <description/> element for each media type associated with the intended session.</p>
<p>The server of the responder (e.g., Juliet) distributes this message stanza to all of Juliet's available resources (and to push resources as appropriate). Those devices might start ringing as a result.</p>
<examplecaption="Responder's Server Distributes Intent Message"><![CDATA[
<!-- delivered to juliet@capulet.example/desktop -->
<p>Consistent with the recommendation for one-to-one chat sessions in Section 5.1 of &rfc6121;, the initiator SHOULD also send directed presence to the responder if the two entities do not already share presence information; including Entity Capabilities (XEP-0115) information in this directed presence stanza enables the responder to know the availability of the initiator (e.g., in case the message is actually delivered quite a bit later because it is saved to offline storage) and also to know the XMPP feautures supported by the initiator.</p>
<section2topic='Disavowing Intent to Start a Session'anchor='retract'>
<p>It can happen that the initiator might want to disavow intent to send a session invitation (e.g., because the initiator has accepted another session). The initiator can do so by sending a message stanza containing a <retract/> element specifying the same session ID.</p>
<section2topic='Accepting Intent to Start a Session'anchor='accept'>
<p>Upon receiving the intent message, the responder's various devices will "ring" and the responder will answer the call on a particular device. Here we assume that since this is an audio-only call, Juliet chooses to take the call on the device associated with her "phone" resource.</p>
<p>As a first step, her "phone" resource informs all of her resources about accepting the call by sending a message to her own bare JID containing an <accept/> element specifying the session ID of the original <propose/> message.</p>
<examplecaption="One of Responder's Resources Accepts the Call"><![CDATA[
<p>Next, the device from which Juliet accepted the call tells Romeo to proceed with the session (via a message stanza containing a <proceed/> element), and also sends directed presence for the reasons described above.</p>
<examplecaption="Responder Sends Directed Presence and Start Message"><![CDATA[
<section2topic='Rejecting Intent to Start a Session'anchor='reject'>
<p>Instead of accepting the call, the responder might want to ignore the call and tell all of her devices to stop ringing (e.g., perhaps because Romeo is getting to be a bit of a nuisance). She does this by rejecting the call on one of her devices and having that device tell all of the other devices to stop ringing, in the form of a message to her own bare JID containing an <reject/> element specifying the session ID of the original <propose/> message.</p>
<examplecaption="One of Responder's Resources Rejects the Call"><![CDATA[
<p>Next, the responder MAY want to decline the call explicitly, in the form of a message to the sender’s full JID containing a <reject/> element specifying the session ID of the original <propose/> message.</p>
<examplecaption="Responder Rejects the Call Explicitly to the Sender"><![CDATA[
<p>Because exchanging messages with other entities is effectively is a presence leak, an XMPP client that implements the receiving side of this specification MUST disable sending of proceed messages by default and MUST enable the feature only as a result of explicit user confirmation. Such confirmation can be provided per request, by whitelisting requests received from Jingle initiators in the responder's contact list, or through some other suitable means as long as sending proceed messages does not occur by default.</p>