~ubuntu-branches/debian/sid/kamailio/sid

« back to all changes in this revision

Viewing changes to modules/rtpproxy/README

  • Committer: Package Import Robot
  • Author(s): Victor Seva
  • Date: 2014-01-06 11:47:13 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140106114713-t8xidp4arzrnyeya
Tags: 4.1.1-1
* New upstream release
* debian/patches:
  - add upstream fixes
* Added tls outbound websocket autheph dnssec modules
  - openssl exception added to their license
* removing sparc and ia64 from supported archs
  for mono module (Closes: #728915)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
1
2
rtpproxy Module
2
3
 
3
4
Maxim Sobolev
37
38
   Copyright � 2009-2012 TuTPro Inc.
38
39
 
39
40
   Copyright � 2010 VoIPEmbedded Inc.
40
 
     __________________________________________________________________
 
41
     _________________________________________________________________
41
42
 
42
43
   Table of Contents
43
44
 
60
61
              4.6. timeout_socket (string)
61
62
              4.7. ice_candidate_priority_avp (string)
62
63
              4.8. extra_id_pv (string)
 
64
              4.9. db_url (string)
 
65
              4.10. table_name (string)
63
66
 
64
67
        5. Functions
65
68
 
66
 
              5.1. set_rtp_proxy_set(setid)
67
 
              5.2. rtpproxy_offer([flags [, ip_address]])
68
 
              5.3. rtpproxy_answer([flags [, ip_address]])
69
 
              5.4. rtpproxy_destroy([flags])
70
 
              5.5. unforce_rtp_proxy()
71
 
              5.6. rtpproxy_manage([flags [, ip_address]])
72
 
              5.7. rtpproxy_stream2uac(prompt_name, count),
73
 
              5.8. rtpproxy_stream2uas(prompt_name, count)
74
 
              5.9. rtpproxy_stop_stream2uac(),
75
 
              5.10. start_recording()
76
 
              5.11. rtpproxy_stop_stream2uas(prompt_name, count)
 
69
              5.1. set_rtp_proxy_set(setid) 
 
70
              5.2. rtpproxy_offer([flags [, ip_address]]) 
 
71
              5.3. rtpproxy_answer([flags [, ip_address]]) 
 
72
              5.4. rtpproxy_destroy([flags]) 
 
73
              5.5. unforce_rtp_proxy() 
 
74
              5.6. rtpproxy_manage([flags [, ip_address]]) 
 
75
              5.7. rtpproxy_stream2uac(prompt_name, count), 
 
76
              5.8. rtpproxy_stream2uas(prompt_name, count) 
 
77
              5.9. rtpproxy_stop_stream2uac(), 
 
78
              5.10. start_recording() 
 
79
              5.11. rtpproxy_stop_stream2uas(prompt_name, count) 
77
80
 
78
81
        6. Exported Pseudo Variables
79
82
 
96
99
   1.6. Set timeout_socket parameter
97
100
   1.7. Set ice_candidate_priority_avp parameter
98
101
   1.8. Set extra_id_pv parameter
99
 
   1.9. set_rtp_proxy_set usage
100
 
   1.10. rtpproxy_offer usage
101
 
   1.11. rtpproxy_answer usage
102
 
   1.12. rtpproxy_destroy usage
103
 
   1.13. rtpproxy_manage usage
104
 
   1.14. rtpproxy_stream2xxx usage
105
 
   1.15. start_recording usage
106
 
   1.16. $rtpstat-Usage
107
 
   1.17. nh_enable_rtpp usage
108
 
   1.18. nh_show_rtpp usage
 
102
   1.9. Set db_url parameter
 
103
   1.10. Set table_name parameter
 
104
   1.11. set_rtp_proxy_set usage
 
105
   1.12. rtpproxy_offer usage
 
106
   1.13. rtpproxy_answer usage
 
107
   1.14. rtpproxy_destroy usage
 
108
   1.15. rtpproxy_manage usage
 
109
   1.16. rtpproxy_stream2xxx usage
 
110
   1.17. start_recording usage
 
111
   1.18. $rtpstat-Usage
 
112
   1.19. nh_enable_rtpp usage
 
113
   1.20. nh_show_rtpp usage
109
114
 
110
115
Chapter 1. Admin Guide
111
116
 
128
133
        4.6. timeout_socket (string)
129
134
        4.7. ice_candidate_priority_avp (string)
130
135
        4.8. extra_id_pv (string)
 
136
        4.9. db_url (string)
 
137
        4.10. table_name (string)
131
138
 
132
139
   5. Functions
133
140
 
134
 
        5.1. set_rtp_proxy_set(setid)
135
 
        5.2. rtpproxy_offer([flags [, ip_address]])
136
 
        5.3. rtpproxy_answer([flags [, ip_address]])
137
 
        5.4. rtpproxy_destroy([flags])
138
 
        5.5. unforce_rtp_proxy()
139
 
        5.6. rtpproxy_manage([flags [, ip_address]])
140
 
        5.7. rtpproxy_stream2uac(prompt_name, count),
141
 
        5.8. rtpproxy_stream2uas(prompt_name, count)
142
 
        5.9. rtpproxy_stop_stream2uac(),
143
 
        5.10. start_recording()
144
 
        5.11. rtpproxy_stop_stream2uas(prompt_name, count)
 
141
        5.1. set_rtp_proxy_set(setid) 
 
142
        5.2. rtpproxy_offer([flags [, ip_address]]) 
 
143
        5.3. rtpproxy_answer([flags [, ip_address]]) 
 
144
        5.4. rtpproxy_destroy([flags]) 
 
145
        5.5. unforce_rtp_proxy() 
 
146
        5.6. rtpproxy_manage([flags [, ip_address]]) 
 
147
        5.7. rtpproxy_stream2uac(prompt_name, count), 
 
148
        5.8. rtpproxy_stream2uas(prompt_name, count) 
 
149
        5.9. rtpproxy_stop_stream2uac(), 
 
150
        5.10. start_recording() 
 
151
        5.11. rtpproxy_stop_stream2uas(prompt_name, count) 
145
152
 
146
153
   6. Exported Pseudo Variables
147
154
 
154
161
 
155
162
1. Overview
156
163
 
157
 
   This is a module that enables media streams to be proxied via an
158
 
   rtpproxy. Rtpproxies know to work with this module are Sippy RTPproxy
 
164
   This  is  a  module  that  enables  media streams to be proxied via an
 
165
   rtpproxy.  Rtpproxies know to work with this module are Sippy RTPproxy
159
166
   http://www.rtpproxy.org and ngcp-rtpproxy-ng
160
 
   http://deb.sipwise.com/spce/2.6/pool/main/n/ngcp-mediaproxy-ng. Some
161
 
   features of the rtpproxy module apply only to one of the two
 
167
   http://deb.sipwise.com/spce/2.6/pool/main/n/ngcp-mediaproxy-ng.   Some
 
168
   features  of  the  rtpproxy  module  apply  only  to  one  of  the two
162
169
   rtpproxies.
163
170
 
164
171
2. Multiple RTPProxy usage
165
172
 
166
 
   The rtpproxy module can support multiple rtpproxies for
 
173
   The    rtpproxy   module   can   support   multiple   rtpproxies   for
167
174
   balancing/distribution and control/selection purposes.
168
175
 
169
 
   The module allows definition of several sets of rtpproxies.
170
 
   Load-balancing will be performed over a set and the admin has the
 
176
   The   module   allows   definition  of  several  sets  of  rtpproxies.
 
177
   Load-balancing  will  be  performed  over  a set and the admin has the
171
178
   ability to choose what set should be used. The set is selected via its
172
 
   id - the id being defined with the set. Refer to the "rtpproxy_sock"
 
179
   id  -  the id being defined with the set. Refer to the "rtpproxy_sock"
173
180
   module parameter definition for syntax description.
174
181
 
175
 
   The balancing inside a set is done automatically by the module based on
176
 
   the weight of each rtpproxy from the set.
 
182
   The  balancing  inside a set is done automatically by the module based
 
183
   on the weight of each rtpproxy from the set.
177
184
 
178
 
   The selection of the set is done from script prior using
 
185
   The   selection   of   the   set  is  done  from  script  prior  using
179
186
   unforce_rtp_proxy(), rtpproxy_offer() or rtpproxy_answer() functions -
180
187
   see the set_rtp_proxy_set() function.
181
188
 
182
 
   For backward compatibility reasons, a set with no id take by default
 
189
   For  backward  compatibility reasons, a set with no id take by default
183
190
   the id 0. Also if no set is explicitly set before unforce_rtp_proxy(),
184
191
   rtpproxy_offer() or rtpproxy_answer() the 0 id set will be used.
185
192
 
186
 
   IMPORTANT: if you use multiple sets, take care and use the same set for
187
 
   both rtpproxy_offer()/rtpproxy_answer() and unforce_rtpproxy()!!
 
193
   IMPORTANT:  if  you  use multiple sets, take care and use the same set
 
194
   for both rtpproxy_offer()/rtpproxy_answer() and unforce_rtpproxy()!!
188
195
 
189
196
3. Dependencies
190
197
 
199
206
 
200
207
3.2. External Libraries or Applications
201
208
 
202
 
   The following libraries or applications must be installed before
 
209
   The  following  libraries  or  applications  must  be installed before
203
210
   running Kamailio with this module loaded:
204
211
     * None.
205
212
 
213
220
   4.6. timeout_socket (string)
214
221
   4.7. ice_candidate_priority_avp (string)
215
222
   4.8. extra_id_pv (string)
 
223
   4.9. db_url (string)
 
224
   4.10. table_name (string)
216
225
 
217
226
4.1. rtpproxy_sock (string)
218
227
 
219
 
   Definition of socket(s) used to connect to (a set) RTPProxy. It may
220
 
   specify a UNIX socket or an IPv4/IPv6 UDP socket.
 
228
   Used to define the list of RTPPRoxy instances to connect to. These can
 
229
   be  UNIX  sockets  or  IPv4/IPv6 UDP sockets. Each modparam entry will
 
230
   insert  sockets  into a single set. If no set ID is given, the default
 
231
   set ID '0' will be used. To define multiple sets add the set number at
 
232
   the  beginning  of  each  parameter  followed  by '=='. Sockets can be
 
233
   weighted  by  adding  '=#' to a socket where # is an integer. A socket
 
234
   with  a weight of 2 will be chosen twice as often as one with a weight
 
235
   of 1.
221
236
 
222
 
   Default value is "NONE" (disabled).
 
237
   Default value is "NONE" (disabled). 
223
238
 
224
239
   Example 1.1. Set rtpproxy_sock parameter
225
240
...
226
241
# single rtproxy
227
242
modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:12221")
 
243
 
228
244
# multiple rtproxies for LB
229
245
modparam("rtpproxy", "rtpproxy_sock",
230
246
        "udp:localhost:12221 udp:localhost:12222")
 
247
 
231
248
# multiple sets of multiple rtproxies
232
249
modparam("rtpproxy", "rtpproxy_sock",
233
250
        "1 == udp:localhost:12221 udp:localhost:12222")
237
254
 
238
255
4.2. rtpproxy_disable_tout (integer)
239
256
 
240
 
   Once RTPProxy was found unreachable and marked as disabled, the
241
 
   rtpproxy module will not attempt to establish communication to RTPProxy
242
 
   for rtpproxy_disable_tout seconds.
 
257
   Once  RTPProxy  was  found  unreachable  and  marked  as disabled, the
 
258
   rtpproxy  module  will  not  attempt  to  establish  communication  to
 
259
   RTPProxy for rtpproxy_disable_tout seconds.
243
260
 
244
 
   Default value is "60".
 
261
   Default value is "60". 
245
262
 
246
263
   Example 1.2. Set rtpproxy_disable_tout parameter
247
264
...
252
269
 
253
270
   Timeout value in waiting for reply from RTPProxy.
254
271
 
255
 
   Default value is "1".
 
272
   Default value is "1". 
256
273
 
257
274
   Example 1.3. Set rtpproxy_tout parameter
258
275
...
261
278
 
262
279
4.4. rtpproxy_retr (integer)
263
280
 
264
 
   How many times the module should retry to send and receive after
 
281
   How  many  times  the  module  should  retry to send and receive after
265
282
   timeout was generated.
266
283
 
267
 
   Default value is "5".
 
284
   Default value is "5". 
268
285
 
269
286
   Example 1.4. Set rtpproxy_retr parameter
270
287
...
273
290
 
274
291
4.5. nortpproxy_str (string)
275
292
 
276
 
   This parameter sets the SDP attribute used by rtpproxy to mark the
277
 
   message's SDP attachemnt with information that it have already been
 
293
   This  parameter  sets  the  SDP attribute used by rtpproxy to mark the
 
294
   message's  SDP  attachemnt  with information that it have already been
278
295
   changed.
279
296
 
280
297
   If empty string, no marker will be added or checked.
283
300
 
284
301
   The string must be a complete SDP line, including the EOH (\r\n).
285
302
 
286
 
   Default value is "a=nortpproxy:yes\r\n".
 
303
   Default value is "a=nortpproxy:yes\r\n". 
287
304
 
288
305
   Example 1.5. Set nortpproxy_str parameter
289
306
...
293
310
4.6. timeout_socket (string)
294
311
 
295
312
   The parameter sets the RTP timeout socket, which is transmitted to the
296
 
   RTP-Proxy. It will be used by the RTP proxy to signal back that a media
297
 
   stream timed out.
 
313
   RTP-Proxy.  It  will  be  used  by the RTP proxy to signal back that a
 
314
   media stream timed out.
298
315
 
299
316
   If it is an empty string, no timeout socket will be transmitted to the
300
317
   RTP-Proxy.
301
318
 
302
 
   Default value is "" (nothing).
 
319
   Default value is "" (nothing). 
303
320
 
304
321
   Example 1.6. Set timeout_socket parameter
305
322
...
306
 
modparam("nathelper", "timeout_socket", "xmlrpc:http://127.0.0.1:8000/RPC2")
 
323
modparam("rtpproxy", "timeout_socket", "xmlrpc:http://127.0.0.1:8000/RPC2")
307
324
...
308
325
 
309
326
4.7. ice_candidate_priority_avp (string)
310
327
 
311
 
   If specified and if value of the avp value is not 0, rtpproxy_manage
312
 
   function adds ICE relay candidate attributes to sdp stream(s)
 
328
   If  specified  and if value of the avp value is not 0, rtpproxy_manage
 
329
   function   adds  ICE  relay  candidate  attributes  to  sdp  stream(s)
313
330
   containing ICE candidate attributes.
314
331
 
315
 
   If value of the avp is 1, added candidates have high priority. If value
316
 
   of the avp is 2 (default), added candidates have low priority.
 
332
   If  value  of  the  avp  is 1, added candidates have high priority. If
 
333
   value of the avp is 2 (default), added candidates have low priority.
317
334
 
318
 
   There is no default value meaning that no ICE relay candidates are
319
 
   added in any circumstance.
 
335
   There  is  no  default  value meaning that no ICE relay candidates are
 
336
   added in any circumstance. 
320
337
 
321
338
   Example 1.7. Set ice_candidate_priority_avp parameter
322
339
...
325
342
 
326
343
4.8. extra_id_pv (string)
327
344
 
328
 
   The parameter sets the PV defination to use when the "b" parameter is
329
 
   used on unforce_rtp_proxy(), rtpproxy_offer(), rtpproxy_answer() or
 
345
   The  parameter sets the PV defination to use when the "b" parameter is
 
346
   used  on  unforce_rtp_proxy(),  rtpproxy_offer(), rtpproxy_answer() or
330
347
   rtpproxy_manage() command.
331
348
 
332
349
   Default is empty, the "b" parameter may not be used then.
336
353
modparam("rtpproxy", "extra_id_pv", "$avp(extra_id)")
337
354
...
338
355
 
 
356
4.9. db_url (string)
 
357
 
 
358
   The  database  URL  to  load rtp_proxy sets from. If this parameter is
 
359
   set,  the  module  will  attempt  to  load  the rtpproxy sets from the
 
360
   specified database and will ignore any 'rtpproxy_sock' modparams.
 
361
 
 
362
   Default is empty, a database will not be used.
 
363
 
 
364
   Example 1.9. Set db_url parameter
 
365
...
 
366
modparam("rtpproxy", "db_url", "mysql://user:passwb@localhost/database")
 
367
...
 
368
 
 
369
4.10. table_name (string)
 
370
 
 
371
   The name of the table containing the rtpproxy sets.
 
372
 
 
373
   Default value is "rtpproxy".
 
374
 
 
375
   Example 1.10. Set table_name parameter
 
376
...
 
377
modparam("rtpproxy", "table_name", "my_rtpp_sets")
 
378
...
 
379
 
339
380
5. Functions
340
381
 
341
 
   5.1. set_rtp_proxy_set(setid)
342
 
   5.2. rtpproxy_offer([flags [, ip_address]])
343
 
   5.3. rtpproxy_answer([flags [, ip_address]])
344
 
   5.4. rtpproxy_destroy([flags])
345
 
   5.5. unforce_rtp_proxy()
346
 
   5.6. rtpproxy_manage([flags [, ip_address]])
347
 
   5.7. rtpproxy_stream2uac(prompt_name, count),
348
 
   5.8. rtpproxy_stream2uas(prompt_name, count)
349
 
   5.9. rtpproxy_stop_stream2uac(),
350
 
   5.10. start_recording()
351
 
   5.11. rtpproxy_stop_stream2uas(prompt_name, count)
352
 
 
353
 
5.1. set_rtp_proxy_set(setid)
354
 
 
355
 
   Sets the Id of the rtpproxy set to be used for the next
356
 
   unforce_rtp_proxy(), rtpproxy_offer(), rtpproxy_answer() or
 
382
   5.1. set_rtp_proxy_set(setid) 
 
383
   5.2. rtpproxy_offer([flags [, ip_address]]) 
 
384
   5.3. rtpproxy_answer([flags [, ip_address]]) 
 
385
   5.4. rtpproxy_destroy([flags]) 
 
386
   5.5. unforce_rtp_proxy() 
 
387
   5.6. rtpproxy_manage([flags [, ip_address]]) 
 
388
   5.7. rtpproxy_stream2uac(prompt_name, count), 
 
389
   5.8. rtpproxy_stream2uas(prompt_name, count) 
 
390
   5.9. rtpproxy_stop_stream2uac(), 
 
391
   5.10. start_recording() 
 
392
   5.11. rtpproxy_stop_stream2uas(prompt_name, count) 
 
393
 
 
394
5.1.  set_rtp_proxy_set(setid)
 
395
 
 
396
   Sets   the   Id   of  the  rtpproxy  set  to  be  used  for  the  next
 
397
   unforce_rtp_proxy(),     rtpproxy_offer(),     rtpproxy_answer()    or
357
398
   rtpproxy_manage() command. The parameter can be an integer or a config
358
399
   variable holding an integer.
359
400
 
360
 
   This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
 
401
   This   function   can   be  used  from  REQUEST_ROUTE,  ONREPLY_ROUTE,
361
402
   BRANCH_ROUTE.
362
403
 
363
 
   Example 1.9. set_rtp_proxy_set usage
 
404
   Example 1.11. set_rtp_proxy_set usage
364
405
...
365
406
set_rtp_proxy_set("2");
366
407
rtpproxy_offer();
367
408
...
368
409
 
369
 
5.2. rtpproxy_offer([flags [, ip_address]])
 
410
5.2.  rtpproxy_offer([flags [, ip_address]])
370
411
 
371
412
   Rewrites SDP body to ensure that media is passed through an RTP proxy.
372
 
   To be invoked on INVITE for the cases the SDPs are in INVITE and 200 OK
373
 
   and on 200 OK when SDPs are in 200 OK and ACK.
 
413
   To  be  invoked on INVITE for the cases the SDPs are in INVITE and 200
 
414
   OK and on 200 OK when SDPs are in 200 OK and ACK.
374
415
 
375
416
   Meaning of the parameters is as follows:
376
417
     * flags - flags to turn on some features.
377
 
          + 1 - append first Via branch to Call-ID when sending command to
378
 
            rtpproxy. This can be used to create one media session per
379
 
            branch on the rtpproxy. When sending a subsequent "delete"
380
 
            command to the rtpproxy, you can then stop just the session
 
418
          + 1  -  append first Via branch to Call-ID when sending command
 
419
            to rtpproxy. This can be used to create one media session per
 
420
            branch  on  the  rtpproxy. When sending a subsequent "delete"
 
421
            command  to  the rtpproxy, you can then stop just the session
381
422
            for a specific branch when passing the flag '1' or '2' in the
382
 
            "unforce_rtpproxy", or stop all sessions for a call when not
383
 
            passing one of those two flags there. This is especially
384
 
            useful if you have serially forked call scenarios where
385
 
            rtpproxy gets an "update" command for a new branch, and then a
386
 
            "delete" command for the previous branch, which would
387
 
            otherwise delete the full call, breaking the subsequent
388
 
            "lookup" for the new branch. This flag is only supported by
 
423
            "unforce_rtpproxy",  or stop all sessions for a call when not
 
424
            passing  one  of  those  two  flags there. This is especially
 
425
            useful  if  you  have  serially  forked  call scenarios where
 
426
            rtpproxy  gets an "update" command for a new branch, and then
 
427
            a  "delete"  command  for  the  previous  branch, which would
 
428
            otherwise  delete  the  full  call,  breaking  the subsequent
 
429
            "lookup"  for  the new branch. This flag is only supported by
389
430
            the ngcp-mediaproxy-ng rtpproxy at the moment!
390
 
          + 2 - append second Via branch to Call-ID when sending command
 
431
          + 2  - append second Via branch to Call-ID when sending command
391
432
            to rtpproxy. See flag '1' for its meaning.
392
 
          + 3 - behave like flag 1 is set for a request and like flag 2 is
393
 
            set for a reply.
394
 
          + a - flags that UA from which message is received doesn't
 
433
          + 3  -  behave like flag 1 is set for a request and like flag 2
 
434
            is set for a reply.
 
435
          + a  -  flags  that  UA  from which message is received doesn't
395
436
            support symmetric RTP. (automatically sets the 'r' flag)
396
 
          + b - append branch specific variable to Call-ID when sending
397
 
            command to rtpproxy. This creates one rtpproxy session per
398
 
            unique variable. Works similar to the 1, 2 and 3 parameter,
399
 
            but is usefull when forking to multiple destinations on
400
 
            different address families or network segments, requiring
401
 
            different rtpproxy parameters. The variable value is taken
402
 
            from the "extra_id_pv". When used, it must be used in every
403
 
            call to rtpproxy_manage(), rtpproxy_offer(), rtpproxy_answer()
404
 
            and rtpproxy_destroy() with the same contents of the PV. The b
405
 
            parameter may not be used in conjunction with the 1, 2 or 3
406
 
            parameter to use the Via branch in the Call-ID.
407
 
          + l - force "lookup", that is, only rewrite SDP when
408
 
            corresponding session already exists in the RTP proxy. By
 
437
          + b  -  append branch specific variable to Call-ID when sending
 
438
            command  to  rtpproxy.  This creates one rtpproxy session per
 
439
            unique  variable.  Works similar to the 1, 2 and 3 parameter,
 
440
            but  is  usefull  when  forking  to  multiple destinations on
 
441
            different  address  families  or  network segments, requiring
 
442
            different  rtpproxy  parameters.  The variable value is taken
 
443
            from  the  "extra_id_pv". When used, it must be used in every
 
444
            call       to       rtpproxy_manage(),      rtpproxy_offer(),
 
445
            rtpproxy_answer()   and   rtpproxy_destroy()  with  the  same
 
446
            contents  of  the  PV.  The  b  parameter  may not be used in
 
447
            conjunction  with  the  1,  2  or  3 parameter to use the Via
 
448
            branch in the Call-ID.
 
449
          + l   -   force  "lookup",  that  is,  only  rewrite  SDP  when
 
450
            corresponding  session  already  exists  in the RTP proxy. By
409
451
            default is on when the session is to be completed.
410
 
          + i, e - these flags specify the direction of the SIP message.
411
 
            These flags only make sense when rtpproxy is running in bridge
412
 
            mode. 'i' means internal network (LAN), 'e' means external
413
 
            network (WAN). 'i' corresponds to rtpproxy's first interface,
414
 
            'e' corresponds to rtpproxy's second interface. You always
415
 
            have to specify two flags to define the incoming network and
416
 
            the outgoing network. For example, 'ie' should be used for SIP
417
 
            message received from the local interface and sent out on the
418
 
            external interface, and 'ei' vice versa. Other options are
419
 
            'ii' and 'ee'. So, for example if a SIP requests is processed
420
 
            with 'ie' flags, the corresponding response must be processed
421
 
            with 'ie' flags.
422
 
            Note: As rtpproxy in bridge mode s per default asymmetric, you
423
 
            have to specify the 'w' flag for clients behind NAT! See also
424
 
            above notes!
425
 
          + x - this flag a shortcut for using the "ie" or "ei"-flags of
426
 
            RTP-Proxy, in order to do automatic bridging between IPv4 on
427
 
            the "internal network" and IPv6 on the "external network". The
428
 
            distinction is done by the given IP in the SDP, e.g. a IPv4
429
 
            Address will always call "ie" to the RTPProxy (IPv4(i) to
430
 
            IPv6(e)) and an IPv6Address will always call "ei" to the
 
452
          + i,  e - these flags specify the direction of the SIP message.
 
453
            These  flags  only  make  sense  when  rtpproxy is running in
 
454
            bridge  mode.  'i'  means  internal  network (LAN), 'e' means
 
455
            external  network  (WAN). 'i' corresponds to rtpproxy's first
 
456
            interface,  'e'  corresponds  to rtpproxy's second interface.
 
457
            You  always  have to specify two flags to define the incoming
 
458
            network and the outgoing network. For example, 'ie' should be
 
459
            used  for  SIP  message received from the local interface and
 
460
            sent  out  on  the  external  interface, and 'ei' vice versa.
 
461
            Other  options  are  'ii'  and 'ee'. So, for example if a SIP
 
462
            requests  is  processed  with  'ie'  flags, the corresponding
 
463
            response must be processed with 'ie' flags.
 
464
            Note:  As  rtpproxy  in bridge mode s per default asymmetric,
 
465
            you  have to specify the 'w' flag for clients behind NAT! See
 
466
            also above notes!
 
467
          + x  - this flag a shortcut for using the "ie" or "ei"-flags of
 
468
            RTP-Proxy,  in order to do automatic bridging between IPv4 on
 
469
            the  "internal  network"  and IPv6 on the "external network".
 
470
            The  distinction  is  done by the given IP in the SDP, e.g. a
 
471
            IPv4  Address  will always call "ie" to the RTPProxy (IPv4(i)
 
472
            to  IPv6(e))  and an IPv6Address will always call "ei" to the
431
473
            RTPProxy (IPv6(e) to IPv4(i)).
432
 
            Note: Please note, that this will only work properly with
433
 
            non-dual-stack user-agents or with dual-stack clients
434
 
            according to RFC6157 (which suggest ICE for Dual-Stack
435
 
            implementations). This short-cut will not work properly with
436
 
            RFC4091 (ANAT) compatible clients, which suggests having
437
 
            different m-lines with different IP-protocols grouped
 
474
            Note:  Please  note,  that  this will only work properly with
 
475
            non-dual-stack   user-agents   or   with  dual-stack  clients
 
476
            according  to  RFC6157  (which  suggest  ICE  for  Dual-Stack
 
477
            implementations).  This short-cut will not work properly with
 
478
            RFC4091  (ANAT)  compatible  clients,  which  suggests having
 
479
            different   m-lines   with   different  IP-protocols  grouped
438
480
            together.
439
 
          + f - instructs rtpproxy to ignore marks inserted by another
440
 
            rtpproxy in transit to indicate that the session is already
441
 
            goes through another proxy. Allows creating a chain of
 
481
          + f  -  instructs  rtpproxy to ignore marks inserted by another
 
482
            rtpproxy  in  transit to indicate that the session is already
 
483
            goes  through  another  proxy.  Allows  creating  a  chain of
442
484
            proxies.
443
 
          + r - flags that IP address in SDP should be trusted. Without
444
 
            this flag, rtpproxy ignores address in the SDP and uses source
445
 
            address of the SIP message as media address which is passed to
446
 
            the RTP proxy.
447
 
          + o - flags that IP from the origin description (o=) should be
 
485
          + r  -  flags that IP address in SDP should be trusted. Without
 
486
            this  flag,  rtpproxy  ignores  address  in  the SDP and uses
 
487
            source  address  of the SIP message as media address which is
 
488
            passed to the RTP proxy.
 
489
          + o  - flags that IP from the origin description (o=) should be
448
490
            also changed.
449
 
          + c - flags to change the session-level SDP connection (c=) IP
 
491
          + c  - flags to change the session-level SDP connection (c=) IP
450
492
            if media-description also includes connection information.
451
 
          + w - flags that for the UA from which message is received,
 
493
          + w  -  flags  that  for the UA from which message is received,
452
494
            support symmetric RTP must be forced.
453
 
          + zNN - requests the RTPproxy to perform re-packetization of RTP
454
 
            traffic coming from the UA which has sent the current message
455
 
            to increase or decrease payload size per each RTP packet
456
 
            forwarded if possible. The NN is the target payload size in
457
 
            ms, for the most codecs its value should be in 10ms
458
 
            increments, however for some codecs the increment could differ
459
 
            (e.g. 30ms for GSM or 20ms for G.723). The RTPproxy would
460
 
            select the closest value supported by the codec. This feature
461
 
            could be used for significantly reducing bandwith overhead for
462
 
            low bitrate codecs, for example with G.729 going from 10ms to
463
 
            100ms saves two thirds of the network bandwith.
 
495
          + zNN  -  requests  the RTPproxy to perform re-packetization of
 
496
            RTP  traffic  coming  from  the UA which has sent the current
 
497
            message  to  increase  or  decrease payload size per each RTP
 
498
            packet  forwarded  if  possible. The NN is the target payload
 
499
            size  in  ms, for the most codecs its value should be in 10ms
 
500
            increments,  however  for  some  codecs  the  increment could
 
501
            differ  (e.g.  30ms  for GSM or 20ms for G.723). The RTPproxy
 
502
            would  select  the closest value supported by the codec. This
 
503
            feature  could  be  used  for significantly reducing bandwith
 
504
            overhead for low bitrate codecs, for example with G.729 going
 
505
            from 10ms to 100ms saves two thirds of the network bandwith.
464
506
     * ip_address - new SDP IP address.
465
507
 
466
508
   This function can be used from ANY_ROUTE.
467
509
 
468
 
   Example 1.10. rtpproxy_offer usage
 
510
   Example 1.12. rtpproxy_offer usage
469
511
route {
470
512
...
471
513
    if (is_method("INVITE")) {
472
 
        if (has_sdp()) {
 
514
        if (has_body("application/sdp")) {
473
515
            if (rtpproxy_offer())
474
516
                t_on_reply("1");
475
517
        } else {
476
518
            t_on_reply("2");
477
519
        }
478
520
    }
479
 
    if (is_method("ACK") && has_sdp())
 
521
    if (is_method("ACK") && has_body("application/sdp"))
480
522
        rtpproxy_answer();
481
523
...
482
524
}
484
526
onreply_route[1]
485
527
{
486
528
...
487
 
    if (has_sdp())
 
529
    if (has_body("application/sdp"))
488
530
        rtpproxy_answer();
489
531
...
490
532
}
492
534
onreply_route[2]
493
535
{
494
536
...
495
 
    if (has_sdp())
 
537
    if (has_body("application/sdp"))
496
538
        rtpproxy_offer();
497
539
...
498
540
}
499
541
 
500
 
5.3. rtpproxy_answer([flags [, ip_address]])
 
542
5.3.  rtpproxy_answer([flags [, ip_address]])
501
543
 
502
544
   Rewrites SDP body to ensure that media is passed through an RTP proxy.
503
 
   To be invoked on 200 OK for the cases the SDPs are in INVITE and 200 OK
504
 
   and on ACK when SDPs are in 200 OK and ACK.
505
 
 
506
 
   See rtpproxy_answer() function description above for the meaning of the
507
 
   parameters.
508
 
 
509
 
   This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
 
545
   To  be  invoked on 200 OK for the cases the SDPs are in INVITE and 200
 
546
   OK and on ACK when SDPs are in 200 OK and ACK.
 
547
 
 
548
   See  rtpproxy_answer()  function  description above for the meaning of
 
549
   the parameters.
 
550
 
 
551
   This   function   can   be  used  from  REQUEST_ROUTE,  ONREPLY_ROUTE,
510
552
   FAILURE_ROUTE, BRANCH_ROUTE.
511
553
 
512
 
   Example 1.11. rtpproxy_answer usage
 
554
   Example 1.13. rtpproxy_answer usage
513
555
 
514
556
   See rtpproxy_offer() function example above for example.
515
557
 
516
 
5.4. rtpproxy_destroy([flags])
 
558
5.4.  rtpproxy_destroy([flags])
517
559
 
518
560
   Tears down the RTPProxy session for the current call.
519
561
 
521
563
 
522
564
   Meaning of the parameters is as follows:
523
565
     * flags - flags to turn on some features.
524
 
          + 1 - append first Via branch to Call-ID when sending command to
525
 
            rtpproxy. This can be used to create one media session per
526
 
            branch on the rtpproxy. When sending a subsequent "delete"
527
 
            command to the rtpproxy, you can then stop just the session
 
566
          + 1  -  append first Via branch to Call-ID when sending command
 
567
            to rtpproxy. This can be used to create one media session per
 
568
            branch  on  the  rtpproxy. When sending a subsequent "delete"
 
569
            command  to  the rtpproxy, you can then stop just the session
528
570
            for a specific branch when passing the flag '1' or '2' in the
529
 
            "unforce_rtpproxy", or stop all sessions for a call when not
530
 
            passing one of those two flags there. This is especially
531
 
            useful if you have serially forked call scenarios where
532
 
            rtpproxy gets an "update" command for a new branch, and then a
533
 
            "delete" command for the previous branch, which would
534
 
            otherwise delete the full call, breaking the subsequent
535
 
            "lookup" for the new branch. This flag is only supported by
 
571
            "unforce_rtpproxy",  or stop all sessions for a call when not
 
572
            passing  one  of  those  two  flags there. This is especially
 
573
            useful  if  you  have  serially  forked  call scenarios where
 
574
            rtpproxy  gets an "update" command for a new branch, and then
 
575
            a  "delete"  command  for  the  previous  branch, which would
 
576
            otherwise  delete  the  full  call,  breaking  the subsequent
 
577
            "lookup"  for  the new branch. This flag is only supported by
536
578
            the ngcp-mediaproxy-ng rtpproxy at the moment!
537
 
          + 2 - append second Via branch to Call-ID when sending command
 
579
          + 2  - append second Via branch to Call-ID when sending command
538
580
            to rtpproxy. See flag '1' for its meaning.
539
 
          + b - append branch specific variable to Call-ID when sending
540
 
            command to rtpproxy. See rtpproxy_offer() for details.
 
581
          + b  -  append branch specific variable to Call-ID when sending
 
582
            command   to  rtpproxy.  See  rtpproxy_offer()  for  details.
541
583
            <listitem>
542
584
            </listitem>
543
 
            t - do not include To tag to "delete" command to rtpproxy thus
544
 
            causing full call to be deleted. Useful for deleting unused
545
 
            rtpproxy call when 200 OK is received on a branch, where
546
 
            rtpproxy is not needed.
 
585
            t  -  do  not  include To tag to "delete" command to rtpproxy
 
586
            thus  causing  full  call  to be deleted. Useful for deleting
 
587
            unused  rtpproxy  call  when  200 OK is received on a branch,
 
588
            where rtpproxy is not needed.
547
589
 
548
 
   Example 1.12. rtpproxy_destroy usage
 
590
   Example 1.14. rtpproxy_destroy usage
549
591
...
550
592
rtpproxy_destroy();
551
593
...
552
594
 
553
 
5.5. unforce_rtp_proxy()
 
595
5.5.  unforce_rtp_proxy()
554
596
 
555
597
   Same as rtpproxy_destroy().
556
598
 
557
 
5.6. rtpproxy_manage([flags [, ip_address]])
 
599
5.6.  rtpproxy_manage([flags [, ip_address]])
558
600
 
559
 
   Manage the RTPProxy session - it combines the functionality of
560
 
   rtpproxy_offer(), rtpproxy_answer() and unforce_rtpproxy(), detecting
 
601
   Manage  the  RTPProxy  session  -  it  combines  the  functionality of
 
602
   rtpproxy_offer(),  rtpproxy_answer() and unforce_rtpproxy(), detecting
561
603
   internally based on message type and method which one to execute.
562
604
 
563
 
   It can take the same parameters as rtpproxy_offer(). The flags
564
 
   parameter to rtpproxy_manage() can be a configuration variable
 
605
   It  can  take  the  same  parameters  as  rtpproxy_offer().  The flags
 
606
   parameter   to  rtpproxy_manage()  can  be  a  configuration  variable
565
607
   containing the flags as a string.
566
608
 
567
609
   Functionality:
568
610
     * If INVITE with SDP, then do rtpproxy_offer()
569
611
     * If INVITE with SDP, when the tm module is loaded, mark transaction
570
 
       with internal flag FL_SDP_BODY to know that the 1xx and 2xx are for
571
 
       rtpproxy_answer()
 
612
       with  internal  flag  FL_SDP_BODY to know that the 1xx and 2xx are
 
613
       for rtpproxy_answer()
572
614
     * If ACK with SDP, then do rtpproxy_answer()
573
 
     * If BYE or CANCEL, or called within a FAILURE_ROUTE[], then do
 
615
     * If  BYE  or  CANCEL,  or  called within a FAILURE_ROUTE[], then do
574
616
       unforce_rtpproxy()
575
617
     * If reply to INVITE with code >= 300 do unforce_rtpproxy()
576
 
     * If reply with SDP to INVITE having code 1xx and 2xx, then do
577
 
       rtpproxy_answer() if the request had SDP or tm is not loaded,
 
618
     * If  reply  with  SDP  to  INVITE  having code 1xx and 2xx, then do
 
619
       rtpproxy_answer()  if  the  request  had  SDP or tm is not loaded,
578
620
       otherwise do rtpproxy_offer()
579
621
 
580
622
   This function can be used from ANY_ROUTE.
581
623
 
582
 
   Example 1.13. rtpproxy_manage usage
 
624
   Example 1.15. rtpproxy_manage usage
583
625
...
584
626
rtpproxy_manage();
585
627
...
586
628
 
587
 
5.7. rtpproxy_stream2uac(prompt_name, count),
 
629
5.7.  rtpproxy_stream2uac(prompt_name, count),
588
630
 
589
 
   Instruct the RTPproxy to stream prompt/announcement pre-encoded with
 
631
   Instruct  the  RTPproxy to stream prompt/announcement pre-encoded with
590
632
   the makeann command from the RTPproxy distribution. The uac/uas suffix
591
 
   selects who will hear the announcement relatively to the current
 
633
   selects  who  will  hear  the  announcement  relatively to the current
592
634
   transaction - UAC or UAS. For example invoking the rtpproxy_stream2uac
593
 
   in the request processing block on ACK transaction will play the prompt
594
 
   to the UA that has generated original INVITE and ACK while
595
 
   rtpproxy_stop_stream2uas on 183 in reply processing block will play the
596
 
   prompt to the UA that has generated 183.
 
635
   in  the  request  processing  block  on  ACK transaction will play the
 
636
   prompt  to  the  UA  that  has generated original INVITE and ACK while
 
637
   rtpproxy_stop_stream2uas  on  183  in reply processing block will play
 
638
   the prompt to the UA that has generated 183.
597
639
 
598
 
   Apart from generating announcements, another possible application of
599
 
   this function is implementing music on hold (MOH) functionality. When
600
 
   count is -1, the streaming will be in loop indefinitely until the
 
640
   Apart  from  generating announcements, another possible application of
 
641
   this  function is implementing music on hold (MOH) functionality. When
 
642
   count  is  -1,  the  streaming  will be in loop indefinitely until the
601
643
   appropriate rtpproxy_stop_stream2xxx is issued.
602
644
 
603
 
   In order to work correctly, these functions require that a session in
 
645
   In  order to work correctly, these functions require that a session in
604
646
   the RTPproxy already exists. Also those functions don't alter the SDP,
605
 
   so that they are not a substitute for calling rtpproxy_offer or
 
647
   so  that  they  are  not  a  substitute  for calling rtpproxy_offer or
606
648
   rtpproxy_answer.
607
649
 
608
650
   This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE.
609
651
 
610
652
   Meaning of the parameters is as follows:
611
 
     * prompt_name - name of the prompt to stream. Should be either
612
 
       absolute pathname or pathname relative to the directory where
 
653
     * prompt_name  -  name  of  the  prompt  to stream. Should be either
 
654
       absolute  pathname  or  pathname  relative  to the directory where
613
655
       RTPproxy runs.
614
 
     * count - number of times the prompt should be repeated. A value of
615
 
       -1 means that it will be streaming in a loop indefinitely, until
 
656
     * count  - number of times the prompt should be repeated. A value of
 
657
       -1  means  that it will be streaming in a loop indefinitely, until
616
658
       the appropriate rtpproxy_stop_stream2xxx is issued.
617
659
 
618
 
   Example 1.14. rtpproxy_stream2xxx usage
 
660
   Example 1.16. rtpproxy_stream2xxx usage
619
661
...
620
662
    if (is_method("INVITE")) {
621
663
        rtpproxy_offer();
627
669
    };
628
670
...
629
671
 
630
 
5.8. rtpproxy_stream2uas(prompt_name, count)
 
672
5.8.  rtpproxy_stream2uas(prompt_name, count)
631
673
 
632
674
   See function rtpproxy_stream2uac(prompt_name, count).
633
675
 
634
 
5.9. rtpproxy_stop_stream2uac(),
 
676
5.9.  rtpproxy_stop_stream2uac(),
635
677
 
636
 
   Stop streaming of announcement/prompt/MOH started previously by the
637
 
   respective rtpproxy_stream2xxx. The uac/uas suffix selects whose
 
678
   Stop  streaming  of  announcement/prompt/MOH started previously by the
 
679
   respective  rtpproxy_stream2xxx.  The  uac/uas  suffix  selects  whose
638
680
   announcement relatively to tha current transaction should be stopped -
639
681
   UAC or UAS.
640
682
 
641
683
   These functions can be used from REQUEST_ROUTE, ONREPLY_ROUTE.
642
684
 
643
 
5.10. start_recording()
 
685
5.10.  start_recording()
644
686
 
645
 
   This function will send a signal to the RTP-Proxy to record the RTP
646
 
   stream on the RTP-Proxy. This function is only supported by Sippy
 
687
   This  function  will  send a signal to the RTP-Proxy to record the RTP
 
688
   stream  on  the  RTP-Proxy.  This  function is only supported by Sippy
647
689
   RTPproxy at the moment!
648
690
 
649
691
   This function can be used from REQUEST_ROUTE and ONREPLY_ROUTE.
650
692
 
651
 
   Example 1.15. start_recording usage
 
693
   Example 1.17. start_recording usage
652
694
...
653
695
start_recording();
654
696
...
655
697
 
656
 
5.11. rtpproxy_stop_stream2uas(prompt_name, count)
 
698
5.11.  rtpproxy_stop_stream2uas(prompt_name, count)
657
699
 
658
700
   See function rtpproxy_stop_stream2uac(prompt_name, count).
659
701
 
664
706
6.1. $rtpstat
665
707
 
666
708
   Returns the RTP-Statistics from the RTP-Proxy. The RTP-Statistics from
667
 
   the RTP-Proxy are provided as a string and it does contain several
668
 
   packet-counters. The statistics must be retrieved before the session is
669
 
   deleted (before unforce_rtpproxy()).
 
709
   the  RTP-Proxy  are  provided  as a string and it does contain several
 
710
   packet-counters.  The  statistics must be retrieved before the session
 
711
   is deleted (before unforce_rtpproxy()).
670
712
 
671
 
   Example 1.16. $rtpstat-Usage
 
713
   Example 1.18. $rtpstat-Usage
672
714
...
673
715
    append_hf("X-RTP-Statistics: $rtpstat\r\n");
674
716
...
680
722
 
681
723
7.1. nh_enable_rtpp
682
724
 
683
 
   Enables a rtp proxy if parameter value is greater than 0. Disables it
 
725
   Enables  a rtp proxy if parameter value is greater than 0. Disables it
684
726
   if a zero value is given.
685
727
 
686
 
   The first parameter is the rtp proxy url (exactly as defined in the
 
728
   The  first  parameter  is the rtp proxy url (exactly as defined in the
687
729
   config file).
688
730
 
689
731
   The second parameter value must be a number in decimal.
690
732
 
691
 
   NOTE: if a rtpproxy is defined multiple times (in the same or diferente
692
 
   sete), all of its instances will be enables/disabled.
 
733
   NOTE:  if  a  rtpproxy  is  defined  multiple  times  (in  the same or
 
734
   diferente sete), all of its instances will be enables/disabled.
693
735
 
694
 
   Example 1.17. nh_enable_rtpp usage
 
736
   Example 1.19.  nh_enable_rtpp usage
695
737
...
696
738
$ kamctl fifo nh_enable_rtpp udp:192.168.2.133:8081 0
697
739
...
698
740
 
699
741
7.2. nh_show_rtpp
700
742
 
701
 
   Displays all the rtp proxies and their information: set and status
 
743
   Displays  all  the  rtp  proxies and their information: set and status
702
744
   (disabled or not, weight and recheck_ticks).
703
745
 
704
746
   No parameter.
705
747
 
706
 
   Example 1.18. nh_show_rtpp usage
 
748
   Example 1.20.  nh_show_rtpp usage
707
749
...
708
750
$ kamctl fifo nh_show_rtpp
709
751
...