XEP-0358: Publishing Available Jingle Sessions

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.
Authors:Philipp Hancke, Lance Stout, Peter Saint-Andre
Copyright:© 1999 – 2017 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Experimental
Type:Standards Track
Version:0.3
Last Updated:2016-05-24

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.


Table of Contents


1. Introduction
2. Use Cases
    2.1. Publishing a Jingle Session Request
    2.2. Triggering the Stream Initiation Request
    2.3. Jingle Session XMPP URI/IRI Query Type
3. Security Considerations
4. IANA Considerations
5. XMPP Registrar Considerations
    5.1. Protocol Namespaces
    5.2. XMPP URI/IRI Querytype registration
6. XML Schema

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

This document defines a way for an entity that can initiate a Jingle (XEP-0166) [1] session (often for the purpose of file transfer as specified in Jingle File Transfer (XEP-0234) [2]) 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 Publishing Stream Initiation Requests (XEP-0137) [3] (previously defined for Stream Initiation (XEP-0095) [4]).

2. Use Cases

2.1 Publishing a Jingle Session Request

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 Publish-Subscribe (XEP-0060) [5] and Personal Eventing Protocol (XEP-0163) [6]), or sent directly to potential recipients within a <message/> stanza.

The format of the <jinglepub/> element is as follows:

Example 1. Sample <jinglepub/>

  <jinglepub xmlns='urn:xmpp:jinglepub:1'
             from='sender-jid'
             id='someid'>
    [<uri/> element for an alternate or informational URI of the content]
    [<meta/> element(s) for human-friendly information]
    [<description/> element(s) for application format(s)]
  </jinglepub>

The 'from' attribute MUST be present and MUST be the valid JID for the session owner.

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.

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).

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.

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.

The <jinglepub/> information is typically provided via pubsub.

The following example shows a possible payload for streaming of recorded audio/video sessions, here pushed out via PEP.

Example 2. Sender advertises session via PEP

<iq from='bard@shakespeare.lit/globe' id='yhe51f39' type='set'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='scenes'>
      <jinglepub xmlns='urn:xmpp:jinglepub:1'
          from='bard@shakespeare.lit'
          id='9559976B-3FBF-4E7E-B457-2DAA225972BB'>
        <meta xml:lang='en'
              title='Act III, Scene I of Hamlet'
              summary='High-definition audio and video recording
                       for Act III, Scene I of Hamlet, captured
                       last week at the Globe Theatre, London.'/>
        <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
        <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='video'>
      </jinglepub>
    </publish>
  </pubsub>
</iq>

Example 3. Pubsub service pushes announcement to all subscribers

<message from='bard@shakespeare.lit' to='juliet@capulet.com/balcony'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='scenes'>
      <item id='current'>
        <jinglepub xmlns='urn:xmpp:jinglepub:1'
            from='bard@shakespeare.lit'
            id='9559976B-3FBF-4E7E-B457-2DAA225972BB'>
          <meta xml:lang='en'
                title='Act III, Scene I of Hamlet'
                summary='High-definition audio and video recording
                         for Act III, Scene I of Hamlet, captured
                         last week at the Globe Theatre, London.'/>
          <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
          <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='video'>
        </jinglepub>
      </item>
    </items>
  </event>
</message>

The <jinglepub/> element MAY also be included directly within a <message/> stanza sent to another entity (or multiple entities, e.g., in Multi-User Chat (XEP-0045) [7]). This can be especially useful for informing an offline entity about an available stream.

Example 4. Advertising a stream in a message stanza

<message from='romeo@montague.net/pda' to='juliet@capulet.com'>
  <jinglepub xmlns='urn:xmpp:jinglepub:1'
      id='9559976B-3FBF-4E7E-B457-2DAA225972BB'>
    <meta xml:lang='en'
          title='Act III, Scene I of Hamlet'
          summary='High-definition audio and video recording
                   for Act III, Scene I of Hamlet, captured
                   last week at the Globe Theatre, London.'/>
    <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
    <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='video'>
  </jinglepub>
</message>

2.2 Triggering the Stream Initiation Request

In general, the process to trigger a stream initiation request is as follows:

Requester                   Publisher
    |                           |
    |   <start/>                |
    |-------------------------->|
    |   <starting/>             |
    |<--------------------------|
    |   session-initiate        |
    |<--------------------------|
    |   [further jingle         |
    |    negotiation]           |
    |<------------------------->|
    |                           |

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:

Example 5. Receiver requests start of session

  <iq type='get'
      id='jinglepub-request-0'
      from='juliet@capulet.com/balcony'
      to='romeo@montague.net/pda'>
    <start xmlns='urn:xmpp:jinglepub:1'
           id='9559976B-3FBF-4E7E-B457-2DAA225972BB'/>
  </iq>

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:

Example 6. Sender accepts request to start session

  <iq type='result'
      id='jinglepub-request-0'
      from='romeo@montague.net/pda'
      to='juliet@capulet.com/balcony'>
    <starting xmlns='urn:xmpp:jinglepub:1'
              sid='851ba2'/>
  </iq>

Then the sender initiates the Jingle session:

Example 7. Sender starts negotiation

<iq from='romeo@montague.lit/orchard'
    id='nzu25s8'
    to='juliet@capulet.lit/balcony'
    type='set'>
  <jingle xmlns='urn:xmpp:jingle:1'
          action='session-initiate'
          initiator='romeo@montague.lit/orchard'
          sid='851ba2'>
    <content creator='initiator' name='scene-audio'>
      <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
        <payload-type id='101' name='opus' clockrate='48000'>
          <parameter name='stereo' value='1'/>
          <parameter name='sprop-stereo' value='1'/>
        </payload-type>
        <payload-type id='97' name='speex' clockrate='8000'/>
        <payload-type id='18' name='G729'/>
      </description>
      <transport xmlns='urn:xmpp:jingle:transports:ice-udp:1'>
        <candidate component='1'
                   foundation='1'
                   generation='0'
                   id='or2ii2syr1'
                   ip='192.0.2.1'
                   network='0'
                   port='3478'
                   priority='2130706431'
                   protocol='udp'
                   type='host'/>
      </transport>
    </content>
    <content creator='initiator' name='scene-video'>
      <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='video'>
        <payload-type id='98' name='theora' clockrate='90000'>
          <parameter name='height' value='600'/>
          <parameter name='width' value='800'/>
          <parameter name='delivery-method' value='inline'/>
          <parameter name='configuration' value='somebase16string'/>
          <parameter name='sampling' value='YCbCr-4:2:2'/>
        </payload-type>
        <payload-type id='28' name='nv' clockrate='90000'/>
        <payload-type id='25' name='CelB' clockrate='90000'/>
        <payload-type id='32' name='MPV' clockrate='90000'/>
        <bandwidth type='AS'>128</bandwidth>
      </description>
      <transport xmlns='urn:xmpp:jingle:transports:ice-udp:1'/>
    </content>
  </jingle>
</iq>

If the requested identifier is not valid, the sender SHOULD respond with a <not-acceptable/> error:

Example 8. Sender denies because of invalid id

  <iq type='error'
      id='jinglepub-set-1'
      from='romeo@montague.net/pda'
      to='juliet@capulet.com/balcony'>
    <start xmlns='urn:xmpp:jinglepub:1'>9559976B-3FBF-4E7E-B457-2DAA225972BB</start>
    <error code='405' type='modify'>
      <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    </error>
  </iq>

If the receiver does not have permission to request the data stream, the sender SHOULD respond with a <forbidden/> error:

Example 9. Sender denies because receiver is forbidden

  <iq type='error'
      id='jinglepub-set-1'
      from='romeo@montague.net/pda'
      to='juliet@capulet.com/balcony'>
    <start xmlns='urn:xmpp:jinglepub:1'>9559976B-3FBF-4E7E-B457-2DAA225972BB</start>
    <error code='403' type='auth'>
      <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    </error>
  </iq>

2.3 Jingle Session XMPP URI/IRI Query Type

This document defines the 'jingle' XMPP URI/IRI querytype, which MUST posses an 'id' key/value pair, whose value is the "jinglepub identifier".

Example 10. Jingle Action: IRI/URI

xmpp:files.montague.net?jingle;id=9559976B-3FBF-4E7E-B457-2DAA225972BB

The information found in such an URI, an XMPP address and a "jinglepub identifier", can be used to trigger an an Jingle session initation request as specified in § 2.2. This Jingle session can be used to transfer files (Jingle File Transfer (XEP-0234) [2]), audio and video streams (Jingle RTP Sessions (XEP-0167) [8]) and other Jingle application formats.

3. Security Considerations

This document introduces no security concerns beyond those specified in XEP-0060 and the relevant Jingle application format in use.

4. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [9].

5. XMPP Registrar Considerations

5.1 Protocol Namespaces

The XMPP Registrar [10] will be requested to include 'urn:xmpp:jinglepub:1' in its registry of protocol namespaces.

5.2 XMPP URI/IRI Querytype registration

As authorized by XMPP URI Query Components (XEP-0147) [11], the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see <https://xmpp.org/registrar/querytypes.html>).The following submission registers the 'jingle' querytype.

<querytype>
  <name>jingle</name>
  <proto>urn:xmpp:jinglepub:1</proto>
  <desc>enables retrieving Jingle sessions (file transfer, etc.)</desc>
  <doc>XEP-0358</doc>
  <keys/>
    <key>
      <name>id</name>
      <desc>The 'jinglepub' identifier</desc>
    </key>
  <keys/>
</querytype>

6. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    xmlns:xml='http://www.w3.org/XML/1998/namespace'
    targetNamespace='urn:xmpp:jinglepub:1'
    xmlns='urn:xmpp:jinglepub:1'
    elementFormDefault='qualified'>

  <xs:element name='jinglepub'>
    <xs:complexType>
      <xs:all>
        <xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
        <xs:element name='meta' type='metaElementType' minOccurs='0' maxOccurs='unbounded' />
        <xs:element name='uri' type='xs:anyURI' minOccurs='0' maxOccurs='1' />
      </xs:all>
      <xs:attribute name='description' type='xs:string' use='optional'/>
      <xs:attribute name='from' type='xs:string' use='required'/>
      <xs:attribute name='id' type='xs:string' use='required'/>
      <xs:attribute name='title' type='xs:string' use='optional'/>
    </xs:complexType>
  </xs:element>

  <xs:complexType name='metaElementType'>
    <xs:simpleContent>
      <xs:extension base='empty'>
        <xs:attribute name='summary'
                      type='xs:string'
                      use='optional'/>
        <xs:attribute name='title'
                      type='xs:string'
                      use='required'/>
        <xs:attribute ref='xml:lang' use='optional'/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:element name='start'>
    <xs:complexType>
      <xs:attribute name='id' type='xs:string' use='required'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='starting'>
    <xs:complexType>
      <xs:attribute name='sid' type='xs:string' use='required'/>
    </xs:complexType>
  </xs:element>

</xs:schema>

Appendices


Appendix A: Document Information

Series: XEP
Number: 0358
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.3
Last Updated: 2016-05-24
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0030, XEP-0234
Supersedes: None
Superseded By: None
Short Name: jinglepub
Source Control: HTML
This document in other formats: XML  PDF


Appendix B: Author Information

Philipp Hancke

Email: fippo@andyet.com
JabberID: fippo@goodadvice.pages.de

Lance Stout

Email: lance@andyet.com
JabberID: lance@lance.im

Peter Saint-Andre

Email: peter@andyet.net
JabberID: stpeter@stpeter.im
URI: https://stpeter.im/


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2017 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.


Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Appendix G: Notes

1. XEP-0166: Jingle <https://xmpp.org/extensions/xep-0166.html>.

2. XEP-0234: Jingle File Transfer <https://xmpp.org/extensions/xep-0234.html>.

3. XEP-0137: Publishing Stream Initiation Requests <https://xmpp.org/extensions/xep-0137.html>.

4. XEP-0095: Stream Initiation <https://xmpp.org/extensions/xep-0095.html>.

5. XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>.

6. XEP-0163: Personal Eventing Protocol <https://xmpp.org/extensions/xep-0163.html>.

7. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.

8. XEP-0167: Jingle RTP Sessions <https://xmpp.org/extensions/xep-0167.html>.

9. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

10. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

11. XEP-0147: XMPP URI Query Components <https://xmpp.org/extensions/xep-0147.html>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.3 (2016-05-24)

Add Jingle query type and XMPP registrar submission.

(fs)

Version 0.2 (2015-08-11)

Add <uri/> element.

(ls)

Version 0.1 (2015-06-29)

Initial published version approved by the XMPP Council.

(XEP Editor (psa))

Version 0.0.2 (2014-08-12)

(ls/psa/ph)

Version 0.0.1 (2014-07-30)

First draft. (ph/ls/psa)

END