| Abstract: | This specification describes methods for exchanging early media in the context of Jingle RTP sessions. |
| Authors: | Diana Cionoiu, Peter Saint-Andre |
| Copyright: | © 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | Experimental |
| Type: | Standards Track |
| Version: | 0.1 |
| Last Updated: | 2009-05-19 |
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.
1. Introduction
2. Concepts
3. Scenario
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
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
Jingle [1] can be used to initiate and negotiate a wide range of peer-to-peer sessions, including Jingle RTP Sessions [2] (mainly for voice and video) using the Realtime Transport Protocol (RTP; see RFC 3550 [3]). This document describes call flows for so-called "early media" using Jingle.
The term "early media" refers to media that is exchanged before a responder has definitively accepted a session request generated by an initiator or before end-to-end connectivity has been established (e.g., the media could be generated by an intermediate call manager or media relay). Early media is typically used to send ringing tones and announcements, using either audio streams or Dual Tone Multi-Frequency (DTMF) events.
In Jingle, the exchange of early media is established through use of the "content-add" action. In order to match the usage specified in RFC 3959 [4] and RFC 3960 [5], when adding a content definition for early media the value of the <content/> element's 'disposition' attribute MUST be "early-session" for mapping to a SIP Content-Disposition header value of "early-session". This enables endpoints or intermediate gateways to apply the application server model described in RFC 3960.
An entity that generates a content-add message for early media SHOULD specify the same codecs for both session media and early media (however, it is possible that the entity that generates the early media does not generate the session media, for example in the case of an intermediate gateway or application server; in this case the entity MUST use one of the codecs advertised by the initiator).
Upon receiving a content-add message specifying the use of early media, the initiator's client SHOULD acknowledge the content-add, complete any required transport negotiation, and then send a content-accept (or content-reject) to the sender. When the responder subsequently sends a session-accept message, the acceptance MUST NOT be construed to include the content definition whose disposition is "early-session".
In handling early media and deciding whether to generate local ringing or to play early media received from the responder or an intermediate gateway, the initiator's client SHOULD proceed as follows:
For examples of early media, see the Jingle Audio via RTP with Early Media section of this document.
In this scenario, Romeo initiates a voice chat with Juliet using a transport method of ICE-UDP. There is a gateway between Romeo and Juliet, and the gateway functions as an application server by returning early media to Romeo (perhaps some late medieval hold music or an old-fashioned IVR interaction). To simplify the flow, we have left out any ringing notifications generated by Juliet.
The session flow is as follows.
Romeo Gateway Juliet | | | | session-initiate | | | (audio definition) | | |------------------------>| session-initiate | | ack |------------------------>| |<------------------------| | | content-add | ack | | (early media) x<------------------------| |<------------------------| | | ack | | |------------------------>| | | [TRANSPORT SETUP] | | |<----------------------->| | | content-accept | | |------------------------>| | | ack | | |<------------------------| | | EARLY MEDIA (RTP) | | |<=======================>| | | | session-accept | | |<------------------------| | session-accept | | |<------------------------| | | ack | | |------------------------>| ack | | |------------------------>| | AUDIO (RTP) | |<=================================================>| | | session-terminate | | |<------------------------| | session-terminate | | |<------------------------| | | ack | | |------------------------>| ack | | |------------------------>| | | |
The protocol flow is as follows, showing only the stanzas sent between Romeo and the gateway (acting on Juliet's behalf).
Example 1. Initiator sends session-initiate
<iq from='romeo@montague.lit/orchard'
id='ox73bf9h'
to='juliet@capulet.lit/balcony'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='session-initiate'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='voice'>
<description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
<payload-type id='96' name='speex' clockrate='16000'/>
<payload-type id='97' name='speex' clockrate='8000'/>
<payload-type id='18' name='G729'/>
<payload-type id='103' name='L16' clockrate='16000' channels='2'/>
<payload-type id='98' name='x-ISAC' clockrate='8000'/>
</description>
<transport xmlns='urn:xmpp:jingle:transports:ice-udp:1'
pwd='asd88fgpdd777uzjYhagZg'
ufrag='8hhy'>
<candidate component='1'
foundation='1'
generation='0'
id='el0747fg11'
ip='10.0.1.1'
network='1'
port='8998'
priority='2130706431'
protocol='udp'
type='host'/>
<candidate component='1'
foundation='2'
generation='0'
id='y3s2b30v3r'
ip='192.0.2.3'
network='1'
port='45664'
priority='1694498815'
protocol='udp'
rel-addr='10.0.1.1'
rel-port='8998'
type='srflx'/>
</transport>
</content>
</jingle>
</iq>
Example 2. Responder acknowledges session-initiate
<iq from='juliet@capulet.lit/balcony'
id='ox73bf9h'
to='romeo@montague.lit/orchard'
type='result'/>
Now the gateway sends a content-add message to Romeo while waiting for Juliet to pay attention to her telephony interface. It specifies a transport method of Raw UDP because it hosts its own media relay.
Example 3. Gateway sends content-add on behalf of responder
<iq from='juliet@capulet.lit/balcony'
id='s12f7hb5'
to='romeo@montague.lit/orchard'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='content-add'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='responder'
disposition='early-session'
name='hold music'
senders='responder'>
<description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
<payload-type id='18' name='G729'/>
</description>
<transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'
pwd='YH75Fviy6338Vbrhrlp8Yh'
ufrag='9uB6'>
<candidate component='1'
generation='0'
id='a9j3mnbtu1'
ip='10.1.1.104'
port='13540'/>
</transport>
</content>
</jingle>
</iq>
Romeo then acknowledges the content-add action.
Example 4. Initiator acknowledges content-add
<iq from='romeo@montague.lit/orchard'
id='s12f7hb5'
to='juliet@capulet.lit/balcony'
type='result'/>
Because the gateway (on behalf of the responder) specified a transport method of Raw UDP for the early session data, in accordance with the Jingle Raw UDP Transport Method the initiator then SHOULD also send a Raw UDP candidate to the gateway in a transport-info message.
Example 5. Initiator sends transport-info
<iq from='romeo@montague.lit/orchard'
id='xk2d1a85'
to='juliet@capulet.lit/balcony'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='transport-info'
initiator='romeo@montague.lit/orchard'
responder='juliet@capulet.lit/balcony'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='voice'>
<description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
<payload-type id='18' name='G729'/>
</description>
<transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'>
<candidate component='1'
generation='0'
id='z7sdjb01hf'
ip='208.68.163.214'
port='9876'/>
<candidate component='2'
generation='0'
id='hg92lsn10b'
ip='208.68.163.214'
port='9877'/>
</transport>
</content>
</jingle>
</iq>
The gateway would acknowledge receipt of the candidate (not shown here) and both parties would attempt to establish connectivity for early media using the communicated transports.
Eventually the initiator would send a content-accept to the gateway.
Example 6. Initiator accepts new content definition
<iq from='romeo@montague.lit/orchard'
id='l8h4bg8q'
to='juliet@capulet.lit/balcony'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='content-accept'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='responder'
disposition='early-session'
name='hold music'
senders='responder'>
<description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
<payload-type id='18' name='G729'/>
</description>
<transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'/>
</content>
</jingle>
</iq>
The gateway then acknowledges the acceptance on behalf of Juliet.
Example 7. Gateway acknowledges content-accept
<iq from='juliet@capulet.lit/balcony'
id='l8h4bg8q'
to='romeo@montague.lit/orchard'
type='result'/>
Because Romeo has attempted to send test media to the gateway as described in XEP-0177, he has exposed an IP/port to which the gateway can now send early media via the media relay that it hosts.
Eventually, the responder sends a session-accept.
Example 8. Responder sends session-accept
<iq from='juliet@capulet.lit/balcony'
id='vh3bf781'
to='romeo@montague.lit/orchard'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='session-accept'
initiator='romeo@montague.lit/orchard'
responder='juliet@capulet.lit/balcony'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='voice'>
<description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
<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>
</jingle>
</iq>
Example 9. Initiator acknowledges session-accept
<iq from='romeo@montague.lit/orchard'
id='vh3bf781'
to='juliet@capulet.lit/balcony'
type='result'/>
Once end-to-end connectivity is established (which might necessitate the exchange of additional candidates via transport-info messages), the parties begin to exchange media; as a result, Romeo and the gateway terminate the exchange of early media (this does not necessitate exchange of a content-remove message, since the endpoint and the gateway can simply stop sending media).
The endpoints can continue the session as long as desired.
Eventually, one of the endpoints terminates the session.
Example 10. Responder terminates the session
<iq from='juliet@capulet.lit/balcony'
id='gi49vx54'
to='romeo@montague.lit/orchard'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='session-terminate'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<reason>
<success/>
<text>Sorry, gotta go!</text>
</reason>
</jingle>
</iq>
The other party then acknowledges termination of the session.
Example 11. Initiator acknowledges termination
<iq from='romeo@montague.lit/orchard'
id='gi49vx54'
to='juliet@capulet.lit/balcony'
type='result'/>
For security considerations, refer to XEP-0167.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [6].
This document requires no interaction with the XMPP Registrar [7].
Series: XEP
Number: 0269
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2009-05-19
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0166, XEP-0167, RFC 3550
Supersedes: None
Superseded By: None
Short Name: N/A
Source Control:
HTML
RSS
This document in other formats:
XML
PDF
Email:
diana@null.ro
JabberID:
l-fy@jabber.null.ro
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
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.
There exists a special venue for discussion related to the technology described in this document: the <jingle@xmpp.org> mailing list.
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.
Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the <xsf-ietf@xmpp.org> list might also be appropriate.
Errata can be sent to <editor@xmpp.org>.
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".
1. XEP-0166: Jingle <http://xmpp.org/extensions/xep-0166.html>.
2. XEP-0167: Jingle RTP Sessions <http://xmpp.org/extensions/xep-0167.html>.
3. RFC 3550: RTP: A Transport Protocol for Real-Time Applications <http://tools.ietf.org/html/rfc3550>.
4. RFC 3959: The Early Session Disposition Type for the Session Initiation Protocol (SIP) <http://tools.ietf.org/html/rfc3959>.
5. RFC 3960: Early Media and Ringing Tone Generation in the Session Initiation Protocol (SIP) <http://tools.ietf.org/html/rfc3960>.
6. 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/>.
7. 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://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial version, copied from XEP-0167.
(dc/psa)END