<title>Publishing Available Jingle Sessions</title>
<abstract>This specification defines an XMPP protocol extension that enables an XMPP entity to advertise the fact that it is willing accept a particular Jingle session request. The protocol is used mainly to inform other entities that a particular file is available for transfer via the Jingle File Transfer protocol defined in XEP-0234.</abstract>
<li>Changed payload to use one or more Jingle <description/> elements (this provides support for content with multiple media types, such as audio+video).</li>
<li>Removed 'app' attribute, since we include the application-format description as a child element.</li>
<li>Removed 'mime-type' attribute, since it can be signalled in the application-format description if needed.</li>
<li>Added <meta/> element to provide human-friendly information about the session.</li>
<li>Incremented the protocol version number from 0 to 1.</li>
</ul>
</remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2014-07-30</date>
<initials>ph/ls/psa</initials>
<remark>First draft.</remark>
</revision>
</header>
<section1topic='Introduction'anchor='intro'>
<p>This document defines a way for an entity that can initiate a Jingle session (often for the purpose of file transfer as specified in &xep0234;) to advertise that session, thus enabling a receiver to then request initiation of the session by the sender. In essence, this document defines the Jingle equivalent of &xep0137; (previously defined for &xep0095;).</p>
</section1>
<section1topic='Use Cases'anchor='usecase'>
<section2topic='Publishing a Jingle Session Request'anchor='usecase.publish'>
<p>A session owner uses the <jinglepub/> element to announce that it can initiate a specific Jingle session request. This element can be sent to a publish-subscribe node (see &xep0060; and &xep0163;), or sent directly to potential recipients within a &MESSAGE; stanza.</p>
<p>The format of the <jinglepub/> element is as follows:</p>
[<meta/> element(s) for human-friendly information]
[<description/> element(s) for application format(s)]
</jinglepub>
]]></example>
<p>The 'from' attribute MUST be present and MUST be the valid JID for the session owner.</p>
<p>The 'id' attribute is an opaque identifier. This attribute MUST be present, and MUST be a valid non-empty string. It uniquely identifies the published request at the session owner's JID.</p>
<p>The <jinglepub/> element MUST contain a <description/> element qualified by the namespace of the relevant Jingle application format (e.g., <description xmlns='urn:xmpp:jingle:apps:file-transfer:4'/> for file transfer).</p>
<p>The <jinglepub/> element MAY contain one or more <meta/> elements qualified by the jingle-pub namespace; if more than one element is included, each element MUST have a different value for the 'xml:lang' attribute.</p>
<p>The <jinglepub/> information is typically provided via pubsub.</p>
<p>The following example shows a possible payload for streaming of recorded audio/video sessions, here pushed out via PEP.</p>
<examplecaption='Sender advertises session via PEP'><![CDATA[
<p>The <jinglepub/> element MAY also be included directly within a &MESSAGE; stanza sent to another entity (or multiple entities, e.g., in &xep0045;). This can be especially useful for informing an offline entity about an available stream.</p>
<examplecaption='Advertising a stream in a message stanza'><![CDATA[
<section2topic='Triggering the Stream Initiation Request'anchor='usecase.trigger'>
<p>A potential receiver requests initiation of the session by sending an IQ-get to the sender, using the <start xmlns='urn:xmpp:jinglepub:1'/> element. This element contains the 'id' attribute to specify which published stream to retrieve:</p>
<examplecaption='Receiver requests start of session'><![CDATA[
<iqtype='get'
id='jinglepub-request-0'
from='juliet@capulet.com/balcony'
to='romeo@montague.net/pda'>
<startxmlns='urn:xmpp:jinglepub:1'
id='9559976B-3FBF-4E7E-B457-2DAA225972BB'/>
</iq>
]]></example>
<p>If the sender accepts the request, it responds with an IQ-result containing a <starting/> element. This element indicates the session identifier to be used:</p>
<examplecaption='Sender accepts request to start session'><![CDATA[
<iqtype='result'
id='jinglepub-request-0'
from='romeo@montague.net/pda'
to='juliet@capulet.com/balcony'>
<startingxmlns='urn:xmpp:jinglepub:1'
sid='851ba2'/>
</iq>
]]></example>
<p>Then the sender initiates the Jingle session:</p>
<p>This document introduces no security concerns beyond those specified in <cite>XEP-0060</cite> and the relevant Jingle application format in use.</p>