%ents; ]>
Jingle Early Media This specification describes methods for exchanging early media in the context of Jingle RTP sessions. &LEGALNOTICE; 0269 Deferred Standards Track Standards Council XMPP Core XEP-0166 XEP-0167 RFC 3550 N/A jingle &diana; &stpeter; 0.1 2009-05-19 dc/psa

Initial version, copied from XEP-0167.

&xep0166; can be used to initiate and negotiate a wide range of peer-to-peer sessions, including &xep0167; (mainly for voice and video) using the Realtime Transport Protocol (RTP; see &rfc3550;). 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 &rfc3959; and &rfc3960;, 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:

  1. If no ringing notification is received via a session-info event containing a <ringing/> condition, do not generate local ringing.
  2. If a ringing notification is received and no early media is received, generate local ringing.
  3. If a ringing notification is received but early media is received, play the early media and do not generate local media.
  4. Once the responder has accepted the session and the session data (as opposed to early session data) has begun to flow, stop local ringing or stop playing early media.

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.

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

]]> ]]>

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.

]]>

Romeo then acknowledges the content-add action.

]]>

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.

]]>

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.

]]>

The gateway then acknowledges the acceptance on behalf of Juliet.

]]>

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.

]]> ]]>

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.

Sorry, gotta go! ]]>

The other party then acknowledges termination of the session.

]]>

For security considerations, refer to XEP-0167.

This document requires no interaction with &IANA;.

This document requires no interaction with the ®ISTRAR;.