XEP-0166: Jingle

This document defines a framework for initiating and managing peer-to-peer multimedia sessions (e.g., voice and video exchanges) between Jabber/XMPP clients in a way that is interoperable with existing Internet standards.


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 should not deploy implementations of this protocol until it advances to a status of Draft.


Document Information

Series: XEP
Number: 0166
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.12
Last Updated: 2006-12-21
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: TO BE ASSIGNED
Wiki Page: <http://wiki.jabber.org/index.php/Jingle (XEP-0166)>

Author Information

Scott Ludwig

Email: scottlu@google.com
JabberID: scottlu@google.com

Joe Beda

Email: jbeda@google.com
JabberID: jbeda@google.com

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org

Joe Hildebrand

Email: jhildebrand@jabber.com
JabberID: hildjj@jabber.org

Sean Egan

Email: seanegan@google.com
JabberID: seanegan@google.com

Robert McQueen

Email: robert.mcqueen@collabora.co.uk
JabberID: robert.mcqueen@collabora.co.uk

Legal Notice

This XMPP Extension Protocol is copyright 1999 - 2007 by the XMPP Standards Foundation (XSF) and is in full conformance with the XSF's Intellectual Property Rights Policy <http://www.xmpp.org/extensions/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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.

Conformance Terms

The following 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".


Table of Contents


1. Introduction
2. Requirements
3. Glossary
4. Concepts and Approach
    4.1. Overall Session Management
    4.2. Session Content
       4.2.1. Content Description Formats
       4.2.2. Content Transport Methods
5. Session Flow
    5.1. Resource Determination
    5.2. Initiation
    5.3. Receiver Response
    5.4. Redirection
    5.5. Decline
    5.6. Negotiation
    5.7. Acceptance
    5.8. Modifying an Active Session
    5.9. Termination
    5.10. Informational Messages
6. Jingle Actions
    6.1. content-accept
    6.2. content-add
    6.3. content-decline
    6.4. content-modify
    6.5. content-remove
    6.6. description-accept
    6.7. description-decline
    6.8. description-info
    6.9. description-modify
    6.10. session-accept
    6.11. session-initiate
    6.12. session-info
    6.13. session-redirect
    6.14. session-terminate
    6.15. transport-accept
    6.16. transport-decline
    6.17. transport-info
    6.18. transport-modify
7. Error Handling
8. Implementation Notes
9. Security Considerations
    9.1. Denial of Service
    9.2. Communication Through Gateways
10. IANA Considerations
11. XMPP Registrar Considerations
    11.1. Protocol Namespaces
    11.2. Jingle Content Description Formats Registry
    11.3. Jingle Content Transport Methods Registry
12. XML Schemas
    12.1. Jingle
    12.2. Jingle Errors
13. Acknowledgements
Notes
Revision History


1. Introduction

There exists no widely-adopted standard for initiating and managing peer-to-peer (p2p) interactions (such as voice, video, or file sharing exchanges) from within Jabber/XMPP clients. Although several large service providers and Jabber/XMPP clients have written and implemented their own proprietary XMPP extensions for p2p signalling (usually only for voice), those technologies are not open and do not always take into account requirements to interoperate with the Public Switched Telephone Network (PSTN) or Voice over Internet Protocol (VoIP) networks based on the IETF's Session Initiation Protocol (SIP) as specified in RFC 3261 [1] and its various extensions.

By contrast, the only existing open protocol has been A Transport for Initiating and Negotiating Sessions [2], which made it possible to initiate and manage p2p sessions, but which did not provide enough of the key signalling semantics to be easily implemented in Jabber/XMPP clients. [3]

The result has been an unfortunate fragmentation within the XMPP community regarding signalling protocols. There are, essentially, two approaches to solving the problem:

  1. Recommend that all client developers implement a dual-stack (XMPP + SIP) solution.
  2. Define a full-featured protocol for XMPP signalling.

Implementation experience indicates that a dual-stack approach may not be feasible on all the computing platforms for which Jabber clients have been written, or even desirable on platforms where it is feasible. Therefore, it seems reasonable to define an XMPP signalling protocol that can provide the necessary signalling semantics while also making it relatively straightforward to interoperate with existing Internet standards.

As a result of feedback received on XEP-0111, the original authors of this document (Joe Hildebrand and Peter Saint-Andre) began to define such a signalling protocol, code-named Jingle. Upon communication with members of the Google Talk team, [4] it was discovered that the emerging Jingle approach was conceptually (and even syntactically) quite similar to the signalling protocol used in the Google Talk application. Therefore, in the interest of interoperability and adoption, we decided to harmonize the two approaches. The signalling protocol specified herein is, therefore, substantially equivalent to the existing Google Talk protocol, with several adjustments based on feedback received from implementors as well as for publication within the XMPP Standards Foundation's standards process.

The purpose of Jingle is not to supplant or replace SIP. Because dual-stack XMPP+SIP clients are difficult to build, given that they essentially have two centers of program control, [5] we have designed Jingle as a pure XMPP signalling protocol. However, Jingle is intended to interwork with SIP so that the millions of deployed XMPP clients can be added onto the existing open VoIP networks, rather than limiting XMPP users to a separate and distinct VoIP network.

2. Requirements

The protocol defined herein is designed to meet the following requirements:

  1. Make it possible to manage a wide variety of peer-to-peer sessions (not limited to voice and video) within XMPP. [6].
  2. Clearly separate the signalling channel (XMPP) from the data channel (e.g., Real-time Transport Protocol as specified in RFC 3550 [7]).
  3. Clearly separate the content description formats (e.g., for voice chat) from the content transport methods (e.g., User Datagram Protocol as specified in RFC 768 [8]).
  4. Make it possible to add, modify, and remove content types from an existing session.
  5. Make it relatively easy to implement support for the protocol in standard Jabber/XMPP clients.
  6. Where communication with non-XMPP entities is needed, push as much complexity as possible onto server-side gateways between the XMPP network and the non-XMPP network.

This document defines the signalling protocol only. Additional documents specify the following:

3. Glossary

Table 1: Glossary

Term Definition
Session A number of pairs of negotiated content transport methods and content description formats connecting two entities. It is delimited in time by an initiate request and session ending events. During the lifetime of a session, pairs of content descriptions and content transport methods can be added or removed. A session consists of at least one active negotiated content type at a time.
Content Type The combination of one content description and at least one content transport method.
Content Description The format of the content type being established, which formally declares one purpose of the session (e.g., "voice" or "video"). This is the 'what' of the session (i.e., the bits to be transferred), such as the acceptable codecs when establishing a voice conversation. In Jingle XML syntax the content type is the namespace of the <description/> element.
Transport Method The method for establishing data stream(s) between entities. Possible transports might include ICE, Raw UDP, inband data, etc. This is the 'how' of the session. In Jingle XML syntax this is the namespace of the <transport/> element. The content transport method defines how to transfer bits from one host to another.
Component A component is a numbered stream of data which needs to be transmitted between the endpoints for a given content type in the context of a given session. It is up to the transport to negotiate the details of each component. Depending on the content type and the content description, one content description may require multiple components to be communicated (e.g., the audio content type might use two components: one to transmit an RTP stream and another to transmit RTCP timing information).

4. Concepts and Approach

Jingle consists of three parts, each with its own syntax, semantics, and state machine:

  1. Overall session management
  2. Content description formats (the "what")
  3. Content transport methods (the "how")

This document defines the semantics and syntax for overall session management. It also provides pluggable "slots" for content description formats and content transport methods, which are specified in separate documents; however, for the sake of completeness, this document also includes examples for all of the actions related to description formats and transport methods.

At the most basic level, the process for negotiating a Jingle session is as follows:

  1. One user (the "initator") sends to another user (the "receiver") a session request with one content type, which includes one content description and (say) two potential transport methods.
  2. If the receiver wants to proceed, it provisionally accepts the request by sending an IQ result.
  3. Both the initiator and receive start exchanging possible transport candidates as quickly as possible (these are sent in quick succession before further negotiation in order to minimize the time required before media data can flow).
  4. These candidates are checked for connectivity.
  5. As soon as the receiver finds a candidate over which media can flow, the receiver sends to the initiator a "session-accept" action.
  6. The parties start sending media over the negotiated candidate.

If the parties later discover a better candidate, they perform a "transport-modify" or "content-modify" negotiation and then switch to the better candidate. Naturally they can also modify various other parameters related to the session (e.g., adding video to a voice chat).

4.1 Overall Session Management

The state machine for overall session management (i.e., the state per Session ID) is as follows:

         o
         |
         | session-initiate
         |
         | +-----------------------+
         |/                        |
PENDING  o---------------------+   |
         |  | session-info,    |   |
         |  | content-remove,  |   |
         |  | content-modify,  |   |
         |  | content-accept,  |   |
         |  | content-decline  |   |
         |  +------------------+   |
         |                         |
         | session-accept          |
         |                         |
 ACTIVE  o---------------------+   |
         |  | session-info,    |   |
         |  | content-add,     |   |
         |  | content-remove,  |   |
         |  | content-modify,  |   |
         |  | content-accept,  |   |
         |  | content-decline  |   |
         |  +------------------+   |
         |                         |
         +-------------------------+
                                   |
                                   | session-redirect,
                                   | session-terminate
                                   |
                                   o ENDED
    

There are three overall session states:

  1. PENDING
  2. ACTIVE
  3. ENDED

The actions related to management of the overall Jingle session are as follows:

  1. content-accept
  2. content-add
  3. content-decline
  4. content-modify
  5. content-remove
  6. session-accept
  7. session-initiate
  8. session-info
  9. session-redirect
  10. session-terminate

These actions are defined in greater detail under Jingle Actions.

4.2 Session Content

The content type of a session is made up of two aspects:

  1. The content description format specifies the "what" of the session (e.g., audio).
  2. The content transport method defines "how" the data shall be exchanged (e.g., raw UDP).

The <content/> element also specifies who will be sending content (the initiator, the recipient, or both).

4.2.1 Content Description Formats

When negotiating the session and its content type, the entities involved in the session need to exchange content description formats. The approach taken herein is to specify pure session description information in separate specifications, one for each content description format (audio, video, etc.). [16] The session negotiation must contain some content description format(s), which are defined in separate specifications. Those specifications also define the state chart for the content description format in question.

The generic state machine for management of any given content description format is as follows:

         START
           o  
           |   
           | session-initiate
           | content-add
           |
[PENDING]  o-------------+
           |   |         | description-info
           |   |_________| description-modify
           |
           | content-accept
           | description-accept
           | session-accept
           |
           |  _____________________o [MODIFYING]
           | / description-modify / \
           |/                    /   |
 [ACTIVE]  o--------------------/    | 
           |\  description-decline   |
           | \______________________/
           |   description-accept
           |
           | content-remove
           | session-terminate
           |
           o [ENDED]
      

The states related to management of content description formats are:

  1. PENDING
  2. ACTIVE
  3. MODIFYING
  4. ENDED

The actions related to management of content description formats are as follows:

  1. description-accept
  2. description-decline
  3. description-info
  4. description-modify

These actions are defined in greater detail under Jingle Actions.

4.2.2 Content Transport Methods

As with the content description formats, the content transport methods are defined in separate specifications. Possible content transport methods include Real-time Transport Protocol (RTP) with Interactive Connectivity Establishment (ICE) and raw UDP. The relevant specifications also define the state chart for the content transport method in question.

The generic state machine for any given content transport method is as follows:

         START
           o  
           |   
           | session-initiate
           | content-add
           |
[PENDING]  o-------------+
           |   |         | transport-info
           |   |_________| transport-modify
           |
           | content-accept
           | session-accept
           | transport-accept
           |
           |  ___________________o [MODIFYING]
           | / transport-modify / \
           |/                  /   |
 [ACTIVE]  o------------------/    | 
           |\  transport-decline   |
           | \____________________/
           |   transport-accept
           |
           | content-remove
           | session-terminate
           |
           o [ENDED]
      

The states related to management of content transport methods are:

  1. PENDING
  2. ACTIVE
  3. MODIFYING
  4. ENDED

The actions related to management of content transport methods are as follows:

  1. transport-accept
  2. transport-decline
  3. transport-info
  4. transport-modify

These actions are defined in greater detail under Jingle Actions.

5. Session Flow

5.1 Resource Determination

In order to initiate a Jingle session, the initiating entity must determine which of the receiver's XMPP resources is best for the desired content description format. If a contact has only one XMPP resource, this task MUST be completed using Service Discovery [17] or the presence-based profile of service discovery specified in Entity Capabilities [18].

Naturally, instead of sending service discovery requests to every contact in a user's roster, it is more efficient to use Entity Capabilities, whereby support for Jingle and various Jingle content description formats and content transport methods is determined for a client version in general (rather than on a per-JID basis) and then cached. Refer to XEP-0115 for details.

If a contact has more than one XMPP resource, it may be that only one of the resources supports Jingle and the desired content description format, in which case the user MUST initiate the Jingle signalling with that resource.

If a contact has more than one XMPP resource that supports Jingle and the desired content description format, it is RECOMMENDED for a client to use Resource Application Priority [19] in order to determine which is the best resource with which to initiate the desired Jingle session.

5.2 Initiation

Once the initiating entity has discovered which of the receiver's XMPP resources is ideal for the desired content description format, it sends a session initiation request to the receiver. This request is an IQ-set containing a <jingle/> element qualified by the 'http://www.xmpp.org/extensions/xep-0166.html#ns' namespace. The <jingle/> element MUST possess the 'action', 'initiator', and 'sid' attributes (the latter two uniquely identify the session). For initiation, the 'action' attribute MUST have a value of "session-initiate" and the <jingle/> element MUST contain one or more <content/> elements, each of which defines a content type to be transferred during the session; each <content/> element in turn contains one <description/> child element that specifies a desired content description format and one or more <transport/> child elements that specify potential content transport methods.

The following example shows a Jingle session initiation request for a session that contains both audio and video content:

Example 1. Initiation Example

<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='jingle1' type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='session-initiate'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='romeo@montague.net' name='this-is-the-audio-content'>
      <description xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns'>
        ...
      </description>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate .../>
      </transport>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns'/>
    </content>
    <content creator='romeo@montague.net' name='this-is-the-video-content'>
      <description xmlns='http://www.xmpp.org/extensions/xep-0180.html#ns'>
        ...
      </description>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate .../>
      </transport>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns'/>
    </content>
  </jingle>
</iq>
    

Note: The syntax and semantics of the <description/> and <transport/> elements are out of scope for this specification, but are defined in related specifications.

The attributes of the <jingle/> element are as follows:

The attributes of the <content/> element are as follows:

5.3 Receiver Response

Unless an error occurs, the receiver MUST acknowledge receipt of the initiation request:

Example 2. Receiver Acknowledges Receipt of Initiation Request

<iq type='result' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle1'/>
    

If the receiver acknowledges receipt of the initation request, both parties must consider the session to be in the PENDING state.

There are several reasons why the receiver might return an error instead of acknowledging receipt of the initiation request:

The initiating entity is unknown to the receiver (e.g., via presence subscription) and the receiver has a policy of not communicating via Jingle with unknown entities, it MUST return a <service-unavailable/> error.

Example 3. Initiating Entity Unknown to Receiver

<iq type='error' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle1'>
  <error type='cancel'>
    <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>
    

If the receiver does not support Jingle, it MUST return a <service-unavailable/> error.

Example 4. Receiver Does Not Support Jingle

<iq type='error' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle1'>
  <error type='cancel'>
    <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>
    

If the receiver does not support any of the specified content description formats, it MUST return a <feature-not-implemented/> error with a Jingle-specific error condition of <unsupported-content/>.

Example 5. Receiver Does Not Support Any Content Description Formats

<iq type='error' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle1'>
  <error type='cancel'>
    <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <unsupported-content xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns-errors'/>
  </error>
</iq>
    

If the receiver does not support any of the specified content transport methods, it MUST return a <feature-not-implemented/> error with a Jingle-specific error condition of <unsupported-transports/>.

Example 6. Receiver Does Not Support Any Transport Methods

<iq type='error' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle1'>
  <error type='cancel'>
    <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <unsupported-transports xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns-errors'/>
  </error>
</iq>
    

If the initiation request was malformed, the receiver MUST return a <bad-request/> error.

Example 7. Initiation Request Malformed

<iq type='error' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle1'>
  <error type='cancel'>
    <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>
    

5.4 Redirection

After acknowledging receipt of the initiation request, the receiver MAY redirect the session to another address (e.g., because the principal is not answering at the original resource). This is done by sending a Jingle redirect action to the initiating entity:

Example 8. Receiver Redirects the Session

<iq from='juliet@capulet.com/balcony'
    id='jingle2'
    to='romeo@montague.net/orchard'
    type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='session-redirect'
          initiator='romeo@montague.net/orchard'
          responder='juliet@capulet.com/balcony'
          sid='a73sjjvkla37jfea'>
    <redirect>xmpp:voicemail@capulet.com</redirect>
  </jingle>
</iq>
    

The recipient then acknowledges the redirection:

Example 9. Initiating Entity Acknowledges Redirection

<iq from='romeo@montague.net/orchard'
    id='jingle2'
    to='juliet@capulet.com/balcony'
    type='result'/>
    

Both entities MUST now consider the original session to be in the ENDED state, and if the initiating entity wishes to initiate a session with the redirected address it MUST do so by sending a session initiation request to that address with a new session ID.

5.5 Decline

In order to decline the session initiation request, the receiver MUST acknowledge receipt of the session initiation request, then terminate the session as described under Termination.

5.6 Negotiation

In general, negotiation will be necessary before the parties can agree on an acceptable set of content types, content description formats, and content transport methods. The potential combinations of parameters to be negotiated are many, and not all are shown herein (some are shown in the relevant specifications for various content description formats and content transport methods).

One session-level negotiation is to remove a content types. For example, let us imagine that Juliet is having a bad hair day. She certainly does not want to include video in her Jingle session with Romeo, so she sends a "content-remove" request to Romeo:

Example 10. Content Type Removal

<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='reduce1' type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='content-remove'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='romeo@montague.net' name='this-is-the-video-content'/>
  </jingle>
</iq>
    

The entity receiving the session reduction request then acknowledges the request:

Example 11. Acknowledgement

<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='reduce1' type='result'/>
    

If the reduction results in no more content types for the session, the entity that receives the session-reduce SHOULD send a session-terminate action to the other party (since a session with no content types is void).

Another session-level negotiation is to add a content type; however, this MUST NOT be done during while the session is in the PENDING state and is allowed only while the session is in the ACTIVE state (see below).

5.7 Acceptance

If (after negotiation of content transport methods and content description formats) the receiver determines that it will be able to establish a connection, it sends a definitive acceptance to the initiating entity:

Example 12. Receiver Definitively Accepts the Call

<iq type='set' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='accept1'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='session-accept'
          initiator='romeo@montague.net/orchard'
          responder='juliet@capulet.com/balcony'
          sid='a73sjjvkla37jfea'>
    <content creator='romeo@montague.net' name='this-is-the-audio-content'>
      <description xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns'>
        ...
      </description>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate .../>
      </transport>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns'/>
    </content>
  </jingle>
</iq>
    

The <jingle/> element in the accept stanza MUST contain one or more <content/> elements, each of which MUST contain only one <description/> element and one or more <transport/> elements. The <jingle/> element SHOULD possess a 'responder' attribute that explicitly specifies the full JID of the responding entity, and the initiating entity SHOULD send all future commmunications about this Jingle session to the JID provided in the 'responder' attribute.

The initiating entity then acknowledges the receiver's definitive acceptance:

Example 13. Initiating Entity Acknowledges Definitive Acceptance

<iq type='result' to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='accept1'/>
    

Now the initiating entity and receiver can begin sending content over the negotiated connection.

If one of the parties cannot find a suitable content transport method, it SHOULD terminate the session as described below.

5.8 Modifying an Active Session

In order to modify an active session, either party may send a "content-remove", "content-add", "content-modify", "description-modify", or "transport-modify" action to the other party. The receiving party then sends an appropriate "-accept" or "-decline" action, and may first send an appropriate "-info" action.

If both parties send modify messages at the same time, the modify message from the session initiator MUST trump the modify message from the recipient and the initiator SHOULD return an <unexpected-request/> error to the other party.

One example of modifying an active session is to add a content type. For example, let us imagine that Juliet gets her hair in order and now wants to add video. She now sends a "content-add" request to Romeo:

Example 14. Adding a Content Type

<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='add1' type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='content-add'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='juliet@capulet.com' name='video-is-back'>
      <description xmlns='http://www.xmpp.org/extensions/xep-0180.html#ns'>
        ...
      </description>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate .../>
      </transport>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns'/>
    </content>
  </jingle>
</iq>
    

The entity receiving the session extension request then acknowledges the request and, if it is acceptable, returns a content-accept:

Example 15. Acknowledgement

<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='add1' type='result'/>
    

Example 16. Content Acceptance

<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='add2' type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='content-add'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='juliet@capulet.com' name='video-is-back'>
      <description xmlns='http://www.xmpp.org/extensions/xep-0180.html#ns'>
        ...
      </description>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate .../>
      </transport>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns'/>
    </content>
  </jingle>
</iq>
    

The other party then acknowledges the acceptance.

Example 17. Acknowledgement

<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='add2' type='result'/>
    

5.9 Termination

In order to gracefully end the session (which MAY be done at any point after acknowledging receipt of the initiation request, including immediately thereafter in order to decline the request), either the receiver or the initiating entity MUST a send a "terminate" action to the other party:

Example 18. Receiver Terminates the Session

<iq from='juliet@capulet.com/balcony'
    id='term1'
    to='romeo@montague.net/orchard'
    type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='session-terminate'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'/>
</iq>
    

The initiating entity MUST then acknowledge termination of the session:

Example 19. Initiating Entity Acknowledges Termination

<iq type='result' to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='term1'/>
    

Unfortunately, not all sessions end gracefully. The following events MUST be considered session-ending events, and any further Jingle communication for the negotiated content description format and content transport method MUST be completed through negotiation of a new session:

In particular, one party MUST consider the session to be in the ENDED state if it receives presence of type "unavailable" from the other party:

Example 20. Receiver Goes Offline

<presence from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' type='unavailable'/>
    

Naturally, in this case there is nothing for the initiating entity to acknowledge.

5.10 Informational Messages

At any point after initiation of a Jingle session, either entity MAY send an informational message to the other party, for example to change a content transport method or content description format parameter, inform the other party that a session initiation request is queued, that a device is ringing, or that a scheduled event has occurred or will occur. An information message MUST be an IQ-set containing a <jingle/> element whose 'action' attribute is set to a value of "session-info", "description-info", or "transport-info"; the <jingle/> element MUST further contain a payload child element (speciific to the session, content description format, or content transport method) that specifies the information being communicated. If an empty "session-info" message is received for an active session, the receiving entity MUST send an empty IQ result. This way, an empty "session-info" message may be used as a "ping" to determine session vitality. (A future version of this specification will define payloads related to the "session-info" action.)

6. Jingle Actions

This section provides more detailed descriptions for each Jingle-related action.

6.1 content-accept

This action enables a party to accept a content-add or content-remove action received from another party. Implicitly this action also serves as a description-accept and transport-accept.

6.2 content-add

This action enables a party to add one or more new content types to the session. This action MUST NOT be sent while the session is in the PENDING state.

In the event that a session contains two unidirectional streams of the same type, due to content-add being issued simultaneously by both participants of the session, it is RECOMMENDED that participants close the duplicate stream in favour of that created by the session initiator, which should be made bidirectional with a 'content-modify' action by the responder.

6.3 content-decline

This action enables a party to reject a content-add or content-modify action received from another party.

6.4 content-modify

This action enables a party to change an existing content type. The recipient MUST NOT reply to a content-modify action with another content-modify action. The content-modify action is mainly used to modify the directionality of the session.

6.5 content-remove

This action enables a party to remove one or more content types from the session.

Clients MUST NOT return an error upon recipt of a 'content-remove' action for a content description which is received after a 'content-remove' action has been sent, but before the action has been acknowledged by the peer.

6.6 description-accept

This action enables a party to accept a description-modify action received from another party.

6.7 description-decline

This action enables a party to decline a description-modify action received from another party.

6.8 description-info

This action enables a party to sent description-level information / messages.

6.9 description-modify

This action enables a party to request a change to a content description format.

6.10 session-accept

This action enables a party to definitively accept a session negotiation. Implicitly this action also serves as a content-accept (which in turn serves as a description-accept and transport-accept).

6.11 session-initiate

This action enables a party to request negotiation of a new Jingle session.

6.12 session-info

This action enables a party to send session-level information / messages.

6.13 session-redirect

This action enables a party to redirect an initiate request to another address.

6.14 session-terminate

This action enables a party to end an existing session.

6.15 transport-accept

This action enables a party to accept a transport-modify action received from another party.

6.16 transport-decline

This action enables a party to decline a transport-modify action received from another party.

6.17 transport-info

This action enables a party to send transport-level information / messages.

6.18 transport-modify

This action enables a party to request a change to the content transport methods.

7. Error Handling

The Jingle-specific error conditions are as follows.

Table 2: Other Error Conditions

Jingle Condition XMPP Condition Description
<out-of-order/> <unexpected-request/> The request cannot occur at this point in the state machine (e.g., initiate after accept).
<unknown-session/> <bad-request/> The 'sid' attribute specifies a session that is unknown to the recipient.
<unsupported-content/> <not-acceptable/> The recipient does not support any of the desired content description formats.
<unsupported-transports/> <not-acceptable/> The recipient does not support any of the desired content transport methods.

8. Implementation Notes

There is a one-to-one relationship between content types and sessions. This reduces the complexity of managing a given session, since it avoids the need to de-multiplex traffic for different content types sent over the same connection. However, it may be desirable to share different kinds of content at the same time (e.g., during a video chat one party may want to share a file); in order to do this, the parties must establish a separate session for each content type. Management of multiple sessions is a client implementation matter and is not discussed in this specification.

9. Security Considerations

Note: This section is not yet complete.

9.1 Denial of Service

Jingle sessions may be resource-intensive. Therefore, it is possible to launch a denial-of-service attack against an entity by burdening it with too many Jingle sessions. Care must be taken to accept content sessions only from known entities and only if the entity's device is able to process such sessions.

9.2 Communication Through Gateways

Jingle communications may be enabled through gateways to non-XMPP networks, whose security characteristics may be quite different from those of XMPP networks. (For example, on some SIP networks authentication is optional and "from" addresses can be easily forged.) Care must be taken in communicating through such gateways.

10. IANA Considerations

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

11. XMPP Registrar Considerations

11.1 Protocol Namespaces

The XMPP Registrar [22] shall include 'http://www.xmpp.org/extensions/xep-0166.html#ns' and 'http://www.xmpp.org/extensions/xep-0166.html#ns-errors' in its registry of protocol namespaces.

11.2 Jingle Content Description Formats Registry

The XMPP Registrar shall maintain a registry of Jingle content description formats. All content description format registrations shall be defined in separate specifications (not in this document). Content description formats defined within the XEP series MUST be registered with the XMPP Registrar, resulting in protocol URIs of the form "http://www.xmpp.org/extensions/xep-0166.html#ns/description/name" (where "name" is the registered name of the content description format).

In order to submit new values to this registry, the registrant must define an XML fragment of the following form and either include it in the relevant XMPP Extension Protocol or send it to the email address <registrar@xmpp.org>:

<content>
  <name>the name of the content description format (e.g., "audio")</name>
  <desc>a natural-language summary of the content description format</desc>
  <doc>the document in which this content description format is specified</doc>
</content>
    

11.3 Jingle Content Transport Methods Registry

The XMPP Registrar shall maintain a registry of Jingle content transport methods. All content transport method registrations shall be defined in separate specifications (not in this document). Content transport methods defined within the XEP series MUST be registered with the XMPP Registrar, resulting in protocol URIs of the form "http://www.xmpp.org/extensions/xep-0166.html#ns/transport/name" (where "name" is the registered name of the content transport method).

In order to submit new values to this registry, the registrant must define an XML fragment of the following form and either include it in the relevant XMPP Extension Protocol or send it to the email address <registrar@xmpp.org>:

<transport>
  <name>the name of the content transport method (e.g., "raw-udp")</name>
  <desc>a natural-language summary of the content transport method</desc>
  <doc>the document in which this content transport method is specified</doc>
</transport>
    

12. XML Schemas

12.1 Jingle

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='http://www.xmpp.org/extensions/xep-0166.html#ns'
    xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
    elementFormDefault='qualified'>

  <xs:element name='jingle'>
    <xs:complexType>
      <xs:sequence minOccurs='1' maxOccurs='unlimited'>
        <xs:element ref='content'/>
      </xs:sequence>
      <xs:attribute name='action' use='required'>
        <xs:simpleType>
          <xs:restriction base='xs:NCName'>
            <xs:enumeration value='content-accept'/>
            <xs:enumeration value='content-add'/>
            <xs:enumeration value='content-decline'/>
            <xs:enumeration value='content-modify'/>
            <xs:enumeration value='content-remove'/>
            <xs:enumeration value='description-accept'/>
            <xs:enumeration value='description-decline'/>
            <xs:enumeration value='description-info'/>
            <xs:enumeration value='description-modify'/>
            <xs:enumeration value='session-accept'/>
            <xs:enumeration value='session-info'/>
            <xs:enumeration value='session-initiate'/>
            <xs:enumeration value='session-redirect'/>
            <xs:enumeration value='session-terminate'/>
            <xs:enumeration value='transport-accept'/>
            <xs:enumeration value='transport-decline'/>
            <xs:enumeration value='transport-info'/>
            <xs:enumeration value='transport-modify'/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name='initiator' type='xs:string' use='required'/>
      <xs:attribute name='responder' type='xs:string' use='optional'/>
      <xs:attribute name='sid' type='xs:NMTOKEN' use='required'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='content'>
    <xs:complexType>
      <xs:choice minOccurs='0'>
        <xs:sequence>
          <xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
        </xs:sequence>
      </xs:choice>
      <xs:attribute name='creator' use='required' type='xs:string'/>
      <xs:attribute name='name' use='required' type='xs:string'/>
      <xs:attribute name='senders' use='optional' default='both'>
        <xs:simpleType>
          <xs:restriction base='xs:NCName'>
            <xs:enumeration value='both'>
            <xs:enumeration value='initiator'>
            <xs:enumeration value='responder'/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

</xs:schema>
    

12.2 Jingle Errors

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='http://www.xmpp.org/extensions/xep-0166.html#ns-errors'
    xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns-errors'
    elementFormDefault='qualified'>

  <xs:element name='out-of-order' type='empty'/>
  <xs:element name='unknown-session' type='empty'/>
  <xs:element name='unsupported-content' type='empty'/>
  <xs:element name='unsupported-transports' type='empty'/>

  <xs:simpleType name='empty'>
    <xs:restriction base='xs:string'>
      <xs:enumeration value=''/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
    

13. Acknowledgements

The authors would like to thank Rohan Mahy for his valuable input on early versions of this document. Rob Taylor, Dafydd Harries, Jussi Laako, Saku Vainio, Antti Ijäs, Brian West, Anthony Minessale, Matt O'Gorman, and others have also provided helpful input. Thanks also to those who have commented on the Standards SIG [23] and (earlier) Jingle [24] mailing lists.


Notes

1. RFC 3261: Session Initiation Protocol (SIP) <http://tools.ietf.org/html/rfc3261>.

2. XEP-0111: A Transport for Initiating and Negotiating Sessions <http://www.xmpp.org/extensions/xep-0111.html>.

3. It is true that TINS made it relatively easy to implement an XMPP-to-SIP gateway; however, in line with the long-time Jabber philosophy of "simple clients, complex servers", it would be better to force complexity onto the server-side gateway and to keep the client as simple as possible.

4. Google Talk is a messaging and voice chat service and client provided by Google; see <http://www.google.com/talk/>.

5. For example, one large ISP recently decided to switch to a pure XMPP approach after having implemented and deployed a dual-stack client for several years.

6. Possible other content description formats include file sharing, application casting, application sharing, whiteboarding, torrent broadcasting, shared real-time editing, and distributed musical performance, to name but a few.

7. RFC 3550: RTP: A Transport Protocol for Real-Time Applications <http://tools.ietf.org/html/rfc3550>.

8. RFC 768: User Datagram Protocol <http://tools.ietf.org/html/rfc0768>.

9. RFC 4566: SDP: Session Description Protocol <http://tools.ietf.org/html/rfc4566>.

10. XEP-0167: Jingle Audio Content Description Format <http://www.xmpp.org/extensions/xep-0167.html>.

11. XEP-0180: Jingle Video Content Description Format <http://www.xmpp.org/extensions/xep-0180.html>.

12. XEP-0176: Jingle RTP-ICE Transport Method <http://www.xmpp.org/extensions/xep-0176.html>.

13. XEP-0177: Jingle Raw UDP Transport Method <http://www.xmpp.org/extensions/xep-0177.html>.

14. RFC 3261: Session Initiation Protocol (SIP) <http://tools.ietf.org/html/rfc3261>.

15. ITU Recommendation H.323: Packet-based Multimedia Communications Systems (September 1999).

16. While it is possible to send raw Session Description Protocol (SDP) data for the session descriptions (the approach that was taken in XEP-0111), this is not necessarily helpful, since SDP is not structured data, not all SDP data is needed or used in the most common use cases, and SDP has been heavily extended in several useful directions that are not captured in the core SDP specification.

17. XEP-0030: Service Discovery <http://www.xmpp.org/extensions/xep-0030.html>.

18. XEP-0115: Entity Capabilities <http://www.xmpp.org/extensions/xep-0115.html>.

19. XEP-0168: Resource Application Priority <http://www.xmpp.org/extensions/xep-0168.html>.

20. See <http://www.w3.org/TR/2000/WD-xml-2e-20000814#NT-Nmtoken>

21. 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/>.

22. 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 <http://www.xmpp.org/registrar/>.

23. The Standards SIG is a standing Special Interest Group devoted to development of XMPP Extension Protocols. The discussion list of the Standards SIG is the primary venue for discussion of XMPP protocol extensions, as well as for announcements by the XMPP Extensions Editor and XMPP Registrar. To subscribe to the list or view the list archives, visit <http://mail.jabber.org/mailman/listinfo/standards/>.

24. Before this specification was accepted as a XMPP Extension Protocol specification, it was discussed on the semi-private <jingle@jabber.org> mailing list; although that list is no longer used (the Standards list is the preferred discussion venue), for historical purposes it is publicly archived at <http://mail.jabber.org/pipermail/jingle/>.


Revision History

Version 0.12 (2006-12-21)

Added creator attribute to content element for prevention of race condition; modified spec to use provisional namespace before advancement to Draft (per XEP-0053).

(psa/ram)

Version 0.11 (2006-10-31)

Completed clarifications and corrections throughout; added section on Jingle Actions.

(psa)

Version 0.10 (2006-09-29)

Made several corrections to the state machines and examples.

(ram/psa)

Version 0.9 (2006-09-08)

Further cleaned up state machines and state-related actions.

(ram/psa)

Version 0.8 (2006-08-23)

Changed channels to components in line with ICE; changed various action names for consistency; added session-extend and session-reduce actions to add and remove description/transport pairs; added description-modify action; added sender attribute to specify directionality.

(ram/psa)

Version 0.7 (2006-07-17)

Added implementation note about handling multiple content types.

(psa)

Version 0.6 (2006-07-12)

Changed media type to content type.

(se/psa)

Version 0.5 (2006-03-20)

Further clarified state machine diagrams; specified that session accept must include agreed-upon media format and transport description; moved deployment notes to appropriate transport spec.

(psa/jb)

Version 0.4 (2006-03-01)

Added glossary; clarified state machines; updated to reflect publication of XEP-0176 and XEP-0177.

(psa/jb)

Version 0.3 (2006-02-24)

Provided more detail about modify scenarios; defined media-specific and transport-specific actions and adjusted state machine accordingly.

(psa/jb)

Version 0.2 (2006-02-13)

Per agreement among the co-authors, moved transport definition to separate specification, simplified state machine, and made other associated changes to the text, examples, and schemas; also harmonized redirect, decline, and terminate processes.

(psa/jb)

Version 0.1 (2005-12-15)

Initial version.

(psa)

Version 0.0.10 (2005-12-11)

More fully documented burst mode, connectivity checks, error cases, etc.

(psa)

Version 0.0.9 (2005-12-08)

Restructured document flow; provided example of burst mode.

(psa)

Version 0.0.8 (2005-12-05)

Distinguished between dribble mode and burst mode, including mode attribute, service discovery features, and implementation notes; provided detailed resource discovery examples; corrected state chart; specified session termination; specified error conditions; specified semantics of informational messages; began to define security considerations; added Joe Beda as co-author.

(psa/sl/jb)

Version 0.0.7 (2005-11-08)

Added more detail to basic session flow; harmonized candidate negotiation process with ICE.

(psa)

Version 0.0.6 (2005-10-27)

Added XMPP Registrar considerations; defined schema; completed slight syntax cleanup.

(psa)

Version 0.0.5 (2005-10-21)

Separated methoddescription formats from signalling protocol.

(psa/sl)

Version 0.0.4 (2005-10-19)

Harmonized basic session flow with Google Talk protocol; added Scott Ludwig as co-author.

(psa/sl)

Version 0.0.3 (2005-10-10)

Added more detail to basic session flow.

(psa)

Version 0.0.2 (2005-10-07)

Protocol cleanup.

(psa/jjh)

Version 0.0.1 (2005-10-06)

First draft.

(psa/jjh)

END