git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1421 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2007-11-27 19:39:11 +00:00
parent 15d1f6bf57
commit 8533699b13
1 changed files with 833 additions and 811 deletions

View File

@ -25,6 +25,12 @@
&stpeter;
&seanegan;
&robmcqueen;
<revision>
<version>0.12</version>
<date>2007-11-27</date>
<initials>psa</initials>
<remark><p>Further editorial review.</p></remark>
</revision>
<revision>
<version>0.11</version>
<date>2007-11-15</date>
@ -110,9 +116,11 @@
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>&xep0166; can be used to initiate and negotiate a wide range of peer-to-peer sessions. One session type of interest is audio chat. This document specifies an application format for negotiating Jingle audio sessions, where the media is exchanged over the Realtime Transport Protocol (RTP; see &rfc3550;).</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>The Jingle application format defined herein is designed to meet the following requirements:</p>
<ol>
@ -121,6 +129,7 @@
<li>Define informational messages related to audio chat (e.g., ringing, on hold, on mute).</li>
</ol>
</section1>
<section1 topic='Jingle Conformance' anchor='conformance'>
<p>In accordance with Section 8 of <cite>XEP-0166</cite>, this document specifies the following information related to the Jingle Audio via RTP application type:</p>
<ol>
@ -137,6 +146,7 @@
</li>
</ol>
</section1>
<section1 topic='Application Format' anchor='format'>
<p>A Jingle audio session is described by a content type that contains one application format and one transport method. The application format consists of one or more encodings contained within a wrapper &lt;description/&gt; element qualified by the 'http://www.xmpp.org/extensions/xep-0167.html#ns' namespace &NSNOTE;. In the language of <cite>RFC 4566</cite> each encoding is a payload-type; therefore, each &lt;payload-type/&gt; element specifies an encoding that can be used for the audio stream, as illustrated in the following example.</p>
<example caption="Audio description format"><![CDATA[
@ -208,6 +218,7 @@
]]></code>
<p>Note: The parameter names are effectively guaranteed to be unique, since &IANA; maintains a registry of SDP parameters (see &lt;<link url='http://www.iana.org/assignments/sdp-parameters'>http://www.iana.org/assignments/sdp-parameters</link>&gt;).</p>
</section1>
<section1 topic='Negotiating a Jingle Audio Session' anchor='negotiation'>
<p>When the initiator sends a session-initiate stanza to the responder, the &DESCRIPTION; element includes all of the payload types that the initiator can receive for Jingle audio (each one encapsulated in a separate &PAYLOADTYPE; element):</p>
<example caption="Initiation"><![CDATA[
@ -244,7 +255,7 @@
</error>
</iq>
]]></example>
<p>If there is no error, the responder acknowledges the session-initiation request.</p>
<p>If there is no error, the responder acknowledges the session initiation request.</p>
<example caption="Responder acknowledges session-initiate"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='jingleaudio1'
@ -330,6 +341,172 @@
]]></example>
<p>Note: Because a "session-accept" action implicitly indicates acceptance of the application format (i.e., "content-accept"), it is not necessary to send a separate "content-accept" action. This flow is shown for completeness only.</p>
</section1>
<section1 topic='Mapping to Session Description Protocol' anchor='sdp'>
<p>If the payload type is static (payload-type IDs 0 through 95 inclusive), it MUST be mapped to a media field defined in <cite>RFC 4566</cite>. The generic format for the media field is as follows:</p>
<code><![CDATA[
m=<media> <port> <transport> <fmt list>
]]></code>
<p>In the context of Jingle audio sessions, the &lt;media&gt; is "audio", the &lt;port&gt; is the preferred port for such communications (which may be determined dynamically), the &lt;transport&gt; is whatever profile is negotiated via the 'profile' attribute of the &CONTENT; element in the Jingle negotiation (e.g., "RTP/AVP"), and the &lt;fmt list&gt; is the payload-type ID.</p>
<p>For example, consider the following static payload-type:</p>
<example caption="Jingle format for static payload-type"><![CDATA[
<payload-type id="13" name="CN"/>
]]></example>
<p>That Jingle-formatted information would be mapped to SDP as follows:</p>
<example caption="SDP mapping of static payload-type"><![CDATA[
m=audio 9999 RTP/AVP 13
]]></example>
<p>If the payload type is dynamic (payload-type IDs 96 through 127 inclusive), it SHOULD be mapped to an SDP media field plus an SDP attribute field named "rtpmap".</p>
<p>For example, consider a payload of 16-bit linear-encoded stereo audio sampled at 16KHz associated with dynamic payload-type 96:</p>
<example caption="Jingle format for dynamic payload-type"><![CDATA[
<payload-type id='96' name='speex' clockrate='16000'/>
]]></example>
<p>That Jingle-formatted information would be mapped to SDP as follows:</p>
<example caption="SDP mapping of dynamic payload-type"><![CDATA[
m=audio 9999 RTP/AVP 96
a=rtpmap:96 speex/16000
]]></example>
<p>As noted, if additional parameters are to be specified, they shall be represented as attributes of the &lt;parameter/&gt; child of the &PAYLOADTYPE; element, as in the following example.</p>
<example caption="Jingle format for dynamic payload-type with parameters"><![CDATA[
<payload-type id='96' name='speex' clockrate='16000' ptime='40'>
<parameter name='vbr' value='on'/>
<parameter name='cng' value='on'/>
</payload-type>
]]></example>
<p>That Jingle-formatted information would be mapped to SDP as follows:</p>
<example caption="SDP mapping of dynamic payload-type with parameters"><![CDATA[
m=audio 9999 RTP/AVP 96
a=rtpmap:96 speex/16000
a=ptime:40
a=fmtp:96 vbr=on;cng=on
]]></example>
</section1>
<section1 topic='Informational Messages' anchor='info'>
<section2 topic='Format' anchor='info-format'>
<p>Informational messages may be sent by either party within the context of Jingle to communicate the status of a Jingle audio session, device, or principal. The informational message MUST be an IQ-set containing a &JINGLE; element of type "session-info", where the informational message is a payload element qualified by the 'http://www.xmpp.org/extensions/xep-0167.html#ns-info' namespace; the following payload elements are defined: <note>A &lt;trying/&gt; element (equivalent to the SIP 100 Trying response code) is not necessary, since each session-level action is acknowledged via XMPP IQ semantics.</note></p>
<table caption='Information Payload Elements'>
<tr>
<th>Element</th>
<th>Meaning</th>
</tr>
<tr>
<td>&lt;active/&gt;</td>
<td>The principal or device is again actively participating in the session after having been on hold or on mute.</td>
</tr>
<tr>
<td>&lt;hold/&gt;</td>
<td>The principal is temporarily pausing the chat (i.e., putting the other party on hold).</td>
</tr>
<tr>
<td>&lt;mute/&gt;</td>
<td>The principal is temporarily stopping audio output but continues to accept audio input.</td>
</tr>
<tr>
<td>&lt;ringing/&gt;</td>
<td>The device is ringing but the principal has not yet interacted with it to answer (this maps to the SIP 180 response code).</td>
</tr>
</table>
<p>Note: Because the informational message is sent in an IQ-set, the receiving party MUST return either an IQ-result or an IQ-error (normally only an IQ-result to acknowledge receipt; no error flows are defined or envisioned at this time).</p>
</section2>
<section2 topic='Examples' anchor='info-examples'>
<example caption="Responder sends active message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='active1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'>
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<active xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
<example caption="Responder sends hold message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='hold1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<hold xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
<example caption="Responder sends mute message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='mute1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<mute xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
<example caption="Responder sends ringing message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='ringing1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<ringing xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
</section2>
</section1>
<section1 topic='Error Handling' anchor='errors'>
<p>The Jingle-Audio-specific error conditions are as follows:</p>
<table caption='Error Conditions'>
<tr>
<th>Jingle Audio Condition</th>
<th>XMPP Condition</th>
<th>Description</th>
</tr>
<tr>
<td>&lt;unsupported-codecs/&gt;</td>
<td>&notacceptable;</td>
<td>The recipient does not support any of the offered audio encodings.</td>
</tr>
</table>
</section1>
<section1 topic='Determining Support' anchor='support'>
<p>If an entity supports Jingle audio exchanges via RTP, it MUST advertise that fact by returning a feature of "http://www.xmpp.org/extensions/xep-0167.html#ns" &NSNOTE; in response to &xep0030; information requests.</p>
<example caption="Service discovery information request"><![CDATA[
<iq from='romeo@montague.net/orchard'
id='disco1'
to='juliet@capulet.com/balcony'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<example caption="Service discovery information response"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='disco1'
to='romeo@montague.net/orchard'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='http://www.xmpp.org/extensions/xep-0166.html#ns'/>
<feature var='http://www.xmpp.org/extensions/xep-0167.html#ns'/>
...
</query>
</iq>
]]></example>
<p>Naturally, support MAY also be determined via the dynamic, presence-based profile of Service Discovery defined in &xep0115;.</p>
</section1>
<section1 topic='Scenarios' anchor='scenarios'>
<p>The following sections show a number of Jingle audio scenarios, in relative order of complexity.</p>
<section2 topic='Responder is Busy' anchor='scenarios-busy'>
@ -346,7 +523,10 @@ Romeo Juliet
]]></code>
<p>The protocol flow is as follows.</p>
<example caption="Initiator sends session-initiate"><![CDATA[
<iq from='romeo@montague.lit/orchard' to='juliet@capulet.lit/balcony' id='jingle1' type='set'>
<iq from='romeo@montague.lit/orchard'
id='jingle1'
to='juliet@capulet.lit/balcony'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-initiate'
initiator='romeo@montague.lit/orchard'
@ -407,7 +587,10 @@ Romeo Juliet
]]></code>
<p>The protocol flow is as follows.</p>
<example caption="Initiator sends session-initiate"><![CDATA[
<iq from='romeo@montague.lit/orchard' to='juliet@capulet.lit/balcony' id='jingle1' type='set'>
<iq from='romeo@montague.lit/orchard'
id='jingle1'
to='juliet@capulet.lit/balcony'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-initiate'
initiator='romeo@montague.lit/orchard'
@ -578,7 +761,7 @@ Romeo Juliet
</jingle>
</iq>
]]></example>
<p>If the payload types and transport candidate can be successfully used by both parties, then the initiator acknowledges the session-accept.</p>
<p>If the payload types and transport candidate can be successfully used by both parties, then the initiator acknowledges the session-accept action.</p>
<example caption="Initiator acknowledges session-accept"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='accept1'
@ -794,7 +977,7 @@ Romeo Juliet
</jingle>
</iq>
]]></example>
<p>As above, if the payload types and transport candidate can be successfully used by both parties, then the initiator acknowledges the session-accept.</p>
<p>As above, if the payload types and transport candidate can be successfully used by both parties, then the initiator acknowledges the session-accept action.</p>
<example caption="Initiator acknowledges session-accept"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='accept1'
@ -1085,7 +1268,7 @@ Romeo Juliet
</jingle>
</iq>
]]></example>
<p>If the payload types and transport candidate can be successfully used by both parties, then the initiator acknowledges the session-accept.</p>
<p>If the payload types and transport candidate can be successfully used by both parties, then the initiator acknowledges the session-accept action.</p>
<example caption="Initiator acknowledges session-accept"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='accept1'
@ -1117,167 +1300,6 @@ Romeo Juliet
</section2>
</section1>
<section1 topic='Mapping to Session Description Protocol' anchor='sdp'>
<p>If the payload type is static (payload-type IDs 0 through 95 inclusive), it MUST be mapped to a media field defined in <cite>RFC 4566</cite>. The generic format for the media field is as follows:</p>
<code><![CDATA[
m=<media> <port> <transport> <fmt list>
]]></code>
<p>In the context of Jingle audio sessions, the &lt;media&gt; is "audio", the &lt;port&gt; is the preferred port for such communications (which may be determined dynamically), the &lt;transport&gt; is whatever profile is negotiated via the 'profile' attribute of the &CONTENT; element in the Jingle negotiation (e.g., "RTP/AVP"), and the &lt;fmt list&gt; is the payload-type ID.</p>
<p>For example, consider the following static payload-type:</p>
<example caption="Jingle format for static payload-type"><![CDATA[
<payload-type id="13" name="CN"/>
]]></example>
<example caption="SDP mapping of static payload-type"><![CDATA[
m=audio 9999 RTP/AVP 13
]]></example>
<p>If the payload type is dynamic (payload-type IDs 96 through 127 inclusive), it SHOULD be mapped to an SDP media field plus an SDP attribute field named "rtpmap".</p>
<p>For example, consider a payload of 16-bit linear-encoded stereo audio sampled at 16KHz associated with dynamic payload-type 96:</p>
<example caption="Jingle format for dynamic payload-type"><![CDATA[
<payload-type id='96' name='speex' clockrate='16000'/>
]]></example>
<example caption="SDP mapping of dynamic payload-type"><![CDATA[
m=audio 9999 RTP/AVP 96
a=rtpmap:96 speex/16000
]]></example>
<p>As noted, if additional parameters are to be specified, they shall be represented as attributes of the &lt;parameter/&gt; child of the &PAYLOADTYPE; element, as in the following example.</p>
<example caption="Jingle format for dynamic payload-type with parameters"><![CDATA[
<payload-type id='96' name='speex' clockrate='16000' ptime='40'>
<parameter name='vbr' value='on'/>
<parameter name='cng' value='on'/>
</payload-type>
]]></example>
<example caption="SDP mapping of dynamic payload-type with parameters"><![CDATA[
m=audio 9999 RTP/AVP 96
a=rtpmap:96 speex/16000
a=ptime:40
a=fmtp:96 vbr=on;cng=on
]]></example>
</section1>
<section1 topic='Informational Messages' anchor='info'>
<section2 topic='Format' anchor='info-format'>
<p>Informational messages may be sent by either party within the context of Jingle to communicate the status of a Jingle audio session, device, or principal. The informational message MUST be an IQ-set containing a &JINGLE; element of type "session-info", where the informational message is a payload element qualified by the 'http://www.xmpp.org/extensions/xep-0167.html#ns-info' namespace; the following payload elements are defined: <note>A &lt;trying/&gt; element (equivalent to the SIP 100 Trying response code) is not necessary, since each session-level action is acknowledged via XMPP IQ semantics.</note></p>
<table caption='Information Payload Elements'>
<tr>
<th>Element</th>
<th>Meaning</th>
</tr>
<tr>
<td>&lt;active/&gt;</td>
<td>The principal or device is again actively participating in the session after having been on hold or on mute.</td>
</tr>
<tr>
<td>&lt;hold/&gt;</td>
<td>The principal is temporarily pausing the chat (i.e., putting the other party on hold).</td>
</tr>
<tr>
<td>&lt;mute/&gt;</td>
<td>The principal is temporarily stopping audio output but continues to accept audio input.</td>
</tr>
<tr>
<td>&lt;ringing/&gt;</td>
<td>The device is ringing but the principal has not yet interacted with it to answer (this maps to the SIP 180 response code).</td>
</tr>
</table>
<p>Note: Because the informational message is sent in an IQ-set, the receiving party MUST return either an IQ-result or an IQ-error (normally only an IQ-result to acknowledge receipt; no error flows are defined or envisioned at this time).</p>
</section2>
<section2 topic='Examples' anchor='info-examples'>
<example caption="Responder sends active message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='active1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'>
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<active xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
<example caption="Responder sends hold message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='hold1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<hold xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
<example caption="Responder sends mute message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='mute1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<mute xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
<example caption="Responder sends ringing message"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='ringing1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<ringing xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns-info'/>
</jingle>
</iq>
]]></example>
</section2>
</section1>
<section1 topic='Error Handling' anchor='errors'>
<p>The Jingle-Audio-specific error conditions are as follows:</p>
<table caption='Error Conditions'>
<tr>
<th>Jingle Audio Condition</th>
<th>XMPP Condition</th>
<th>Description</th>
</tr>
<tr>
<td>&lt;unsupported-codecs/&gt;</td>
<td>&notacceptable;</td>
<td>The recipient does not support any of the offered audio encodings.</td>
</tr>
</table>
</section1>
<section1 topic='Determining Support' anchor='support'>
<p>If an entity supports Jingle audio exchanges via RTP, it MUST advertise that fact by returning a feature of "http://www.xmpp.org/extensions/xep-0167.html#ns" &NSNOTE; in response to &xep0030; information requests.</p>
<example caption="Service discovery information request"><![CDATA[
<iq from='romeo@montague.net/orchard'
id='disco1'
to='juliet@capulet.com/balcony'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<example caption="Service discovery information response"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='disco1'
to='romeo@montague.net/orchard'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='http://www.xmpp.org/extensions/xep-0166.html#ns'/>
<feature var='http://www.xmpp.org/extensions/xep-0167.html#ns'/>
...
</query>
</iq>
]]></example>
<p>Naturally, support may also be discovered by the dynamic, presence-based profile of service discovery defined in &xep0115;.</p>
</section1>
<section1 topic='Implementation Notes' anchor='impl'>
<section2 topic='Codecs' anchor='impl-codecs'>
<p>Support for the Speex codec is RECOMMENDED.</p>
@ -1286,7 +1308,7 @@ a=fmtp:96 vbr=on;cng=on
<p>If it is necessary to send Dual Tone Multi-Frequency (DTMF) tones, it is REQUIRED to use the XML format specified &xep0181;.</p>
</section2>
<section2 topic='When to Listen' anchor='impl-listen'>
<p>When the Jingle Audio content type is accepted via a "content-accept" action, both initiator and responder SHOULD start listening for audio as defined by the negotiated transport method and audio application format. For interoperability with telephony systems, after the responder acknowledges the session-initiate request, the responder SHOULD send a "ringing" message and both parties SHOULD play any audio received.</p>
<p>When the Jingle Audio content type is accepted via a "content-accept" action, both initiator and responder SHOULD start listening for audio as defined by the negotiated transport method and audio application format. For interoperability with telephony systems, after the responder acknowledges the session initiation request, the responder SHOULD send a "ringing" message and both parties SHOULD play any audio received.</p>
</section2>
</section1>