-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep-0269.xml
329 lines (322 loc) · 15.6 KB
/
xep-0269.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Jingle Early Media</title>
<abstract>This specification describes methods for exchanging early media in the context of Jingle RTP sessions.</abstract>
&LEGALNOTICE;
<number>0269</number>
<status>Deferred</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0166</spec>
<spec>XEP-0167</spec>
<spec>RFC 3550</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>N/A</shortname>
<discuss>jingle</discuss>
&diana;
&stpeter;
<revision>
<version>0.1</version>
<date>2009-05-19</date>
<initials>dc/psa</initials>
<remark><p>Initial version, copied from XEP-0167.</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, 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>
</section1>
<section1 topic='Concepts' anchor='concepts'>
<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>
<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>
<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>
<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>
<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>
<ol>
<li>If no ringing notification is received via a session-info event containing a <ringing/> condition, do not generate local ringing.</li>
<li>If a ringing notification is received and no early media is received, generate local ringing.</li>
<li>If a ringing notification is received but early media is received, play the early media and do not generate local media.</li>
<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>
</ol>
<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>
</section1>
<section1 topic='Scenario' anchor='scenario'>
<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>
<p>The session flow is as follows.</p>
<code><![CDATA[
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 |
| |------------------------>|
| | |
]]></code>
<p>The protocol flow is as follows, showing only the stanzas sent between Romeo and the gateway (acting on Juliet's behalf).</p>
<example caption="Initiator sends session-initiate"><![CDATA[
<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>
<example caption="Responder acknowledges session-initiate"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='ox73bf9h'
to='romeo@montague.lit/orchard'
type='result'/>
]]></example>
<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>
<example caption="Gateway sends content-add on behalf of responder"><![CDATA[
<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>
]]></example>
<p>Romeo then acknowledges the content-add action.</p>
<example caption="Initiator acknowledges content-add"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='s12f7hb5'
to='juliet@capulet.lit/balcony'
type='result'/>
]]></example>
<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>
<example caption="Initiator sends transport-info"><![CDATA[
<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>
]]></example>
<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>
<p>Eventually the initiator would send a content-accept to the gateway.</p>
<example caption="Initiator accepts new content definition"><![CDATA[
<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>
]]></example>
<p>The gateway then acknowledges the acceptance on behalf of Juliet.</p>
<example caption="Gateway acknowledges content-accept"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='l8h4bg8q'
to='romeo@montague.lit/orchard'
type='result'/>
]]></example>
<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>
<p>Eventually, the responder sends a session-accept.</p>
<example caption="Responder sends session-accept"><![CDATA[
<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>
<example caption="Initiator acknowledges session-accept"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='vh3bf781'
to='juliet@capulet.lit/balcony'
type='result'/>
]]></example>
<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>
<p>The endpoints can continue the session as long as desired.</p>
<p>Eventually, one of the endpoints terminates the session.</p>
<example caption="Responder terminates the session"><![CDATA[
<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>
]]></example>
<p>The other party then acknowledges termination of the session.</p>
<example caption="Initiator acknowledges termination"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='gi49vx54'
to='juliet@capulet.lit/balcony'
type='result'/>
]]></example>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>For security considerations, refer to <cite>XEP-0167</cite>.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>This document requires no interaction with the ®ISTRAR;.</p>
</section1>
</xep>