No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0269.xml 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Jingle Early Media</title>
  10. <abstract>This specification describes methods for exchanging early media in the context of Jingle RTP sessions.</abstract>
  11. &LEGALNOTICE;
  12. <number>0269</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0166</spec>
  20. <spec>XEP-0167</spec>
  21. <spec>RFC 3550</spec>
  22. </dependencies>
  23. <supersedes/>
  24. <supersededby/>
  25. <shortname>N/A</shortname>
  26. <discuss>jingle</discuss>
  27. &diana;
  28. &stpeter;
  29. <revision>
  30. <version>0.1</version>
  31. <date>2009-05-19</date>
  32. <initials>dc/psa</initials>
  33. <remark><p>Initial version, copied from XEP-0167.</p></remark>
  34. </revision>
  35. </header>
  36. <section1 topic='Introduction' anchor='intro'>
  37. <p>&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.</p>
  38. </section1>
  39. <section1 topic='Concepts' anchor='concepts'>
  40. <p>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.</p>
  41. <p>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 <cite>RFC 3960</cite>.</p>
  42. <p>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).</p>
  43. <p>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".</p>
  44. <p>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:</p>
  45. <ol>
  46. <li>If no ringing notification is received via a session-info event containing a &lt;ringing/&gt; condition, do not generate local ringing.</li>
  47. <li>If a ringing notification is received and no early media is received, generate local ringing.</li>
  48. <li>If a ringing notification is received but early media is received, play the early media and do not generate local media.</li>
  49. <li>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.</li>
  50. </ol>
  51. <p>For examples of early media, see the <link url='#scenarios-earlymedia'>Jingle Audio via RTP with Early Media</link> section of this document.</p>
  52. </section1>
  53. <section1 topic='Scenario' anchor='scenario'>
  54. <p>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.</p>
  55. <p>The session flow is as follows.</p>
  56. <code><![CDATA[
  57. Romeo Gateway Juliet
  58. | | |
  59. | session-initiate | |
  60. | (audio definition) | |
  61. |------------------------>| session-initiate |
  62. | ack |------------------------>|
  63. |<------------------------| |
  64. | content-add | ack |
  65. | (early media) x<------------------------|
  66. |<------------------------| |
  67. | ack | |
  68. |------------------------>| |
  69. | [TRANSPORT SETUP] | |
  70. |<----------------------->| |
  71. | content-accept | |
  72. |------------------------>| |
  73. | ack | |
  74. |<------------------------| |
  75. | EARLY MEDIA (RTP) | |
  76. |<=======================>| |
  77. | | session-accept |
  78. | |<------------------------|
  79. | session-accept | |
  80. |<------------------------| |
  81. | ack | |
  82. |------------------------>| ack |
  83. | |------------------------>|
  84. | AUDIO (RTP) |
  85. |<=================================================>|
  86. | | session-terminate |
  87. | |<------------------------|
  88. | session-terminate | |
  89. |<------------------------| |
  90. | ack | |
  91. |------------------------>| ack |
  92. | |------------------------>|
  93. | | |
  94. ]]></code>
  95. <p>The protocol flow is as follows, showing only the stanzas sent between Romeo and the gateway (acting on Juliet's behalf).</p>
  96. <example caption="Initiator sends session-initiate"><![CDATA[
  97. <iq from='romeo@montague.lit/orchard'
  98. id='ox73bf9h'
  99. to='juliet@capulet.lit/balcony'
  100. type='set'>
  101. <jingle xmlns='urn:xmpp:jingle:1'
  102. action='session-initiate'
  103. initiator='romeo@montague.lit/orchard'
  104. sid='a73sjjvkla37jfea'>
  105. <content creator='initiator' name='voice'>
  106. <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
  107. <payload-type id='96' name='speex' clockrate='16000'/>
  108. <payload-type id='97' name='speex' clockrate='8000'/>
  109. <payload-type id='18' name='G729'/>
  110. <payload-type id='103' name='L16' clockrate='16000' channels='2'/>
  111. <payload-type id='98' name='x-ISAC' clockrate='8000'/>
  112. </description>
  113. <transport xmlns='urn:xmpp:jingle:transports:ice-udp:1'
  114. pwd='asd88fgpdd777uzjYhagZg'
  115. ufrag='8hhy'>
  116. <candidate component='1'
  117. foundation='1'
  118. generation='0'
  119. id='el0747fg11'
  120. ip='10.0.1.1'
  121. network='1'
  122. port='8998'
  123. priority='2130706431'
  124. protocol='udp'
  125. type='host'/>
  126. <candidate component='1'
  127. foundation='2'
  128. generation='0'
  129. id='y3s2b30v3r'
  130. ip='192.0.2.3'
  131. network='1'
  132. port='45664'
  133. priority='1694498815'
  134. protocol='udp'
  135. rel-addr='10.0.1.1'
  136. rel-port='8998'
  137. type='srflx'/>
  138. </transport>
  139. </content>
  140. </jingle>
  141. </iq>
  142. ]]></example>
  143. <example caption="Responder acknowledges session-initiate"><![CDATA[
  144. <iq from='juliet@capulet.lit/balcony'
  145. id='ox73bf9h'
  146. to='romeo@montague.lit/orchard'
  147. type='result'/>
  148. ]]></example>
  149. <p>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.</p>
  150. <example caption="Gateway sends content-add on behalf of responder"><![CDATA[
  151. <iq from='juliet@capulet.lit/balcony'
  152. id='s12f7hb5'
  153. to='romeo@montague.lit/orchard'
  154. type='set'>
  155. <jingle xmlns='urn:xmpp:jingle:1'
  156. action='content-add'
  157. initiator='romeo@montague.lit/orchard'
  158. sid='a73sjjvkla37jfea'>
  159. <content creator='responder'
  160. disposition='early-session'
  161. name='hold music'
  162. senders='responder'>
  163. <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
  164. <payload-type id='18' name='G729'/>
  165. </description>
  166. <transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'
  167. pwd='YH75Fviy6338Vbrhrlp8Yh'
  168. ufrag='9uB6'>
  169. <candidate component='1'
  170. generation='0'
  171. id='a9j3mnbtu1'
  172. ip='10.1.1.104'
  173. port='13540'/>
  174. </transport>
  175. </content>
  176. </jingle>
  177. </iq>
  178. ]]></example>
  179. <p>Romeo then acknowledges the content-add action.</p>
  180. <example caption="Initiator acknowledges content-add"><![CDATA[
  181. <iq from='romeo@montague.lit/orchard'
  182. id='s12f7hb5'
  183. to='juliet@capulet.lit/balcony'
  184. type='result'/>
  185. ]]></example>
  186. <p>Because the gateway (on behalf of the responder) specified a transport method of Raw UDP for the early session data, in accordance with the <cite>Jingle Raw UDP Transport Method</cite> the initiator then SHOULD also send a Raw UDP candidate to the gateway in a transport-info message.</p>
  187. <example caption="Initiator sends transport-info"><![CDATA[
  188. <iq from='romeo@montague.lit/orchard'
  189. id='xk2d1a85'
  190. to='juliet@capulet.lit/balcony'
  191. type='set'>
  192. <jingle xmlns='urn:xmpp:jingle:1'
  193. action='transport-info'
  194. initiator='romeo@montague.lit/orchard'
  195. responder='juliet@capulet.lit/balcony'
  196. sid='a73sjjvkla37jfea'>
  197. <content creator='initiator' name='voice'>
  198. <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
  199. <payload-type id='18' name='G729'/>
  200. </description>
  201. <transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'>
  202. <candidate component='1'
  203. generation='0'
  204. id='z7sdjb01hf'
  205. ip='208.68.163.214'
  206. port='9876'/>
  207. <candidate component='2'
  208. generation='0'
  209. id='hg92lsn10b'
  210. ip='208.68.163.214'
  211. port='9877'/>
  212. </transport>
  213. </content>
  214. </jingle>
  215. </iq>
  216. ]]></example>
  217. <p>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.</p>
  218. <p>Eventually the initiator would send a content-accept to the gateway.</p>
  219. <example caption="Initiator accepts new content definition"><![CDATA[
  220. <iq from='romeo@montague.lit/orchard'
  221. id='l8h4bg8q'
  222. to='juliet@capulet.lit/balcony'
  223. type='set'>
  224. <jingle xmlns='urn:xmpp:jingle:1'
  225. action='content-accept'
  226. initiator='romeo@montague.lit/orchard'
  227. sid='a73sjjvkla37jfea'>
  228. <content creator='responder'
  229. disposition='early-session'
  230. name='hold music'
  231. senders='responder'>
  232. <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
  233. <payload-type id='18' name='G729'/>
  234. </description>
  235. <transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'/>
  236. </content>
  237. </jingle>
  238. </iq>
  239. ]]></example>
  240. <p>The gateway then acknowledges the acceptance on behalf of Juliet.</p>
  241. <example caption="Gateway acknowledges content-accept"><![CDATA[
  242. <iq from='juliet@capulet.lit/balcony'
  243. id='l8h4bg8q'
  244. to='romeo@montague.lit/orchard'
  245. type='result'/>
  246. ]]></example>
  247. <p>Because Romeo has attempted to send test media to the gateway as described in <cite>XEP-0177</cite>, he has exposed an IP/port to which the gateway can now send early media via the media relay that it hosts.</p>
  248. <p>Eventually, the responder sends a session-accept.</p>
  249. <example caption="Responder sends session-accept"><![CDATA[
  250. <iq from='juliet@capulet.lit/balcony'
  251. id='vh3bf781'
  252. to='romeo@montague.lit/orchard'
  253. type='set'>
  254. <jingle xmlns='urn:xmpp:jingle:1'
  255. action='session-accept'
  256. initiator='romeo@montague.lit/orchard'
  257. responder='juliet@capulet.lit/balcony'
  258. sid='a73sjjvkla37jfea'>
  259. <content creator='initiator' name='voice'>
  260. <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
  261. <payload-type id='97' name='speex' clockrate='8000'/>
  262. <payload-type id='18' name='G729'/>
  263. </description>
  264. <transport xmlns='urn:xmpp:jingle:transports:ice-udp:1'>
  265. <candidate component='1'
  266. foundation='1'
  267. generation='0'
  268. id='or2ii2syr1'
  269. ip='192.0.2.1'
  270. network='0'
  271. port='3478'
  272. priority='2130706431'
  273. protocol='udp'
  274. type='host'/>
  275. </transport>
  276. </content>
  277. </jingle>
  278. </iq>
  279. ]]></example>
  280. <example caption="Initiator acknowledges session-accept"><![CDATA[
  281. <iq from='romeo@montague.lit/orchard'
  282. id='vh3bf781'
  283. to='juliet@capulet.lit/balcony'
  284. type='result'/>
  285. ]]></example>
  286. <p>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).</p>
  287. <p>The endpoints can continue the session as long as desired.</p>
  288. <p>Eventually, one of the endpoints terminates the session.</p>
  289. <example caption="Responder terminates the session"><![CDATA[
  290. <iq from='juliet@capulet.lit/balcony'
  291. id='gi49vx54'
  292. to='romeo@montague.lit/orchard'
  293. type='set'>
  294. <jingle xmlns='urn:xmpp:jingle:1'
  295. action='session-terminate'
  296. initiator='romeo@montague.lit/orchard'
  297. sid='a73sjjvkla37jfea'>
  298. <reason>
  299. <success/>
  300. <text>Sorry, gotta go!</text>
  301. </reason>
  302. </jingle>
  303. </iq>
  304. ]]></example>
  305. <p>The other party then acknowledges termination of the session.</p>
  306. <example caption="Initiator acknowledges termination"><![CDATA[
  307. <iq from='romeo@montague.lit/orchard'
  308. id='gi49vx54'
  309. to='juliet@capulet.lit/balcony'
  310. type='result'/>
  311. ]]></example>
  312. </section1>
  313. <section1 topic='Security Considerations' anchor='security'>
  314. <p>For security considerations, refer to <cite>XEP-0167</cite>.</p>
  315. </section1>
  316. <section1 topic='IANA Considerations' anchor='iana'>
  317. <p>This document requires no interaction with &IANA;.</p>
  318. </section1>
  319. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  320. <p>This document requires no interaction with the &REGISTRAR;.</p>
  321. </section1>
  322. </xep>