<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>
<p>This document defines a way for an entity that can initiate a &xep0166; 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>
<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>
<p>The 'id' attribute is an opaque identifier, called the "jinglepub 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/> element MAY contain a <uri/> element which contains a URI for an alternative way to access the content, or other information about the content. The resource provided by the URI SHOULD be meaningful for clients that do not directly support the included Jingle content definitions, and accessing the URI MAY result in a different experience than initiating the published Jingle session. For example, the URI could be to a content landing page of an image hosting service from which an image could be viewed instead of directly downloading the image file.</p>
<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[
<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>