forked from sippy/rtpproxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
manpage.xml
574 lines (566 loc) · 23.6 KB
/
manpage.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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
<?xml version='1.0' encoding='ISO-8859-1'?>
<!-- Use the following command to generate rtpproxy.8: -->
<!-- xsltproc /usr/local/share/xsl/docbook/manpages/docbook.xsl manpage.xml -->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY dhfirstname "<firstname>Maxim</firstname>">
<!ENTITY dhsurname "<surname>Sobolev</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>Jun 16, 2008</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>8</manvolnum>">
<!ENTITY dhemail "<email>sobomax@sippysoft.com</email>">
<!ENTITY dhusername "janakj">
<!ENTITY dhucpackage "<refentrytitle>rtpproxy</refentrytitle>">
<!ENTITY dhpackage "rtpproxy">
]>
<refentry>
<refentryinfo>
<address>
&dhemail;
</address>
<author>
&dhfirstname;
&dhsurname;
</author>
<copyright>
<year>2006</year>
<holder>&dhusername;</holder>
</copyright>
&dhdate;
</refentryinfo>
<refmeta>
&dhucpackage;
&dhsection;
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>RTP (Real-time Transport Protocol) Proxy Server</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
<!-- TODO "N:c:" -->
<arg choice="opt"><option>-?</option></arg>
<arg choice="opt"><option>-2</option></arg>
<arg choice="opt"><option>-f</option></arg>
<arg choice="opt"><option>-v</option></arg>
<arg choice="opt"><option>-V</option></arg>
<arg choice="opt"><option>-R</option></arg>
<arg choice="opt"><option>-l</option> <replaceable>addr1<optional>/addr2</optional></replaceable></arg>
<arg choice="opt"><option>-6</option> <replaceable>addr1<optional>/addr2</optional></replaceable></arg>
<arg choice="opt"><option>-s</option> <replaceable>ctrl_socket</replaceable></arg>
<arg choice="opt"><option>-t</option> <replaceable>tos</replaceable></arg>
<arg choice="opt"><option>-p</option> <replaceable>pidfile</replaceable></arg>
<arg choice="opt"><option>-T</option> <replaceable>max_ttl</replaceable></arg>
<arg choice="opt">
<option>-r</option> <replaceable>rdir</replaceable>
<arg choice="opt"><option>-S</option> <replaceable>sdir</replaceable></arg>
</arg>
<arg choice="opt"><option>-L</option> <replaceable>nofile_limit</replaceable></arg>
<arg choice="opt"><option>-A</option> <replaceable>advaddr1<optional>/advaddr2</optional></replaceable></arg>
<arg choice="opt"><option>-m</option> <replaceable>min_port</replaceable></arg>
<arg choice="opt"><option>-M</option> <replaceable>max_port</replaceable></arg>
<arg choice="opt"><option>-u</option> <replaceable>uname<optional>:gname</optional></replaceable></arg>
<arg choice="opt"><option>-w</option> <replaceable>sock_mode</replaceable></arg>
<arg choice="opt"><option>-F</option></arg>
<arg choice="opt"><option>-i</option></arg>
<arg choice="opt"><option>-n</option> <replaceable>timeout_socket</replaceable></arg>
<arg choice="opt"><option>-P</option></arg>
<arg choice="opt"><option>-a</option></arg>
<arg choice="opt"><option>-d</option> <replaceable>log_level<optional>:log_facility</optional></replaceable></arg>
<arg choice="opt"><option>-W</option> <replaceable>setup_ttl</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>
<command>&dhpackage;</command> is a symmetric RTP proxy designed to
be used in conjunction with a SIP Controller capable of rewriting SDP
contents. OpenSIPs, Kamailio, and Sippy B2BUA support <command>&dhpackage;</command>
</para>
<para>
rtpproxy can be used to facilitate RTP sessions between SIP user
agents that are behind a NAT(s) (Network Address Translator) firewall.
Several cases exists when direct end-to-end communication
is not possible and RTP streams have to be relayed through another
host. rtpproxy can be used to setup such a relaying host.
</para>
<para>
rtpproxy can operate as a application level bridge by specifying two
interfaces to listen on. In bridging mode rtpproxy forwards RTP packets
received on one interface to the other interface and vice
versa. This mode can be used to forward RTP packets between
networks without direct network level connectivity (provided that the
host running rtpproxy has an interface connected to both networks). One
particular application of bridging mode is IPv4/IPv6 traversal of
RTP packets.
</para>
<para>
When instructed by the call controller rtpproxy will record the entire RTP
session to the local hard disk or play a pre-recorded file
to the user agent (comfort ring replacement, Music-on-Hold, disclaimer
announcements).
</para>
<para>
rtpproxy tracks various metrics about call sessions, such as packets sent,
packets received, packets lost and so fort.
</para>
</refsect1>
<refsect1>
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term><option>-?</option></term>
<listitem>
<para>Show summary of options.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-2</option></term>
<listitem>
<para>
Send every RTP packet twice in sessions that use
low-bitrate codecs. Only packets that are smaller than
128 bytes will be sent twice. This option can improve
audio quality on lossy links.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-f</option></term>
<listitem>
<para>
rtpproxy will stay in foreground mode if this option is
set.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option></term>
<listitem>
<para>Show version of program.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-V</option></term>
<listitem>
<para>Show rtpp command protocol version.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-l</option> <replaceable>addr1<optional>/addr2</optional></replaceable></term>
<listitem>
<para>
IPv4 listen IP address(es). You can specify either
one or two addresses. If two addresses are specified,
the rtpproxy will work in bridging mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-6</option> <replaceable>addr1<optional>/addr2</optional></replaceable></term>
<listitem>
<para>
IPv6 listen IP address(es). You can specify either one
or two addresses. If two addresses are specified, the
rtpproxy will work in bridging mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-s</option> <replaceable>ctrl_socket</replaceable></term>
<listitem>
<para>
This parameter configures rtpproxy control socket. The
control socket is used by the call controller for the purpose
of creating, modifying, and deleting RTP sessions. The
control socket can also be used to fetch stats from the
rtpproxy process, or about specific media sessions.
Format of <replaceable>ctrl_socket</replaceable> is
<type>:<socket>. Following types are
supported:
<itemizedlist>
<listitem>
<para>
<emphasis>udp:</emphasis> Create UDP
control socket. In this mode rtpproxy will
listen on a UDP socket for control messages
from the call controlle.
</para>
<para>
Example: -s udp:127.0.0.1:9000
</para>
<para>
IP address can be '*' in which case
rtpproxy will listen on all local
interfaces. If port is omitted then port
22222 will be used.
</para>
<note>
<para>
rtpproxy control protocol has no
built-in security mechanisms. Make sure
that you protect the listening IP and
port properly when using rtpproxy with
UDP control socket.
</para>
</note>
</listitem>
<listitem>
<para>
<emphasis>udp6:</emphasis> Create IPv6 UDP
control socket. In this mode rtpproxy will
listen on UDP/IPv6 for control messages
from the SIP Controller.
</para>
<para>
Example: -s udp6:::1:9000
</para>
</listitem>
<listitem>
<para>
<emphasis>unix:</emphasis> Create UNIX
domain socket for control interface. In
this mode the SIP Controller and rtpproxy must
be running on the same host.
</para>
<para>Example: -s unix:/var/run/rtpproxy.sock</para>
<para>
Default value is <filename>/var/run/rtpproxy.sock</filename>.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-t</option> <replaceable>tos</replaceable></term>
<listitem>
<para>
Set ToS (Type of Service) in the outgoing IP header. Default value is
0xB8. Setting this parameter to -1 disables setting ToS resulting in
operating system default ToS being used instead.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-r</option> <replaceable>rec_dir</replaceable></term>
<listitem>
<para>Directory to write recorded RTP sessions.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-S</option> <replaceable>spool_dir</replaceable></term>
<listitem>
<para>
Spool directory for recording of RTP streams. When the session is
stopped, the recording will be moved from the spool directory
to the rec_dir directory as specified by the <option>-r</option>
option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-R</option></term>
<listitem>
<para>
Prevent rtpproxy from recording RTCP when recording RTP.
rtpproxy records RTCP by default when RTP recording is enabled.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-p</option> <replaceable>pid_file</replaceable></term>
<listitem>
<para>
This parameter configures the name of the file where
PID of running rtpproxy will be stored. Default is
<filename>/var/run/rtpproxy.pid</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-T</option> <replaceable>max_ttl</replaceable></term>
<listitem>
<para>
Specify the RTP inactivity timer. Defaults to 60 seconds.
</para>
<para>
If the rtpproxy does not receive any RTP packets for more than <replaceable>max_ttl</replaceable>
it will then delete the session.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-L</option> <replaceable>nofile_limit</replaceable></term>
<listitem>
<para>
Set the maximum number of open connections per process.
The default maximum is set by the operating system, and can
be overridden using the <option>-L</option> flag.
</para>
<para>
rtpproxy requires four connections per media stream to ensure that it
can reliably identify where a stream is coming from in a NAT firewall
scenario.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-A</option> <replaceable>advaddr1<optional>/advaddr2</optional></replaceable></term>
<listitem>
<para>
Set advertised address of rtpproxy. Useful if the rtpproxy is behind a NAT
firewall. (Amazon EC2) When the rtpproxy receives a session request from a SIP controller
it will return the IP address(es) specified by the <option>-A</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-m</option> <replaceable>min_port</replaceable></term>
<listitem>
<para>
Set lower limit on UDP ports range that the rtpproxy uses for
RTP/RTCP sessions to <replaceable>min_port</replaceable>.
Default is 35000.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-M</option> <replaceable>max_port</replaceable></term>
<listitem>
<para>
Set upper limit on UDP ports range that the rtpproxy uses for
RTP/RTCP sessions to <replaceable>max_port</replaceable>.
Default is 65000.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-u</option> <replaceable>uname<optional>:gname</optional></replaceable></term>
<listitem>
<para>
Switch rtpproxy to UID identified by the <replaceable>uname</replaceable>
and optional GID identified by <replaceable>gname</replaceable> when
proxy is up and running.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-w</option> <replaceable>sock_mode</replaceable></term>
<listitem>
<para>
Set access mode for the controlling UNIX-socket (if
used). Only applies if rtpproxy runs under a different
GID using <option>-u</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-F</option></term>
<listitem>
<para>
By default the rtpproxy will warn user if running as superuser (UID 0) in
local control mode and refuse to run in remote control mode at all.
This switch removes the check.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-i</option></term>
<listitem>
<para>
Enable independent RTP activity timeout mode. By default, a timeout (which
results in automatic destruction of the session) can only occur
if no RTP packets are received on any of the session's ports. This
option, if set, varies that behaviour, such that a timeout will
occur if packets are still being received on one port but not
the other. The option should be used with caution since in some
cases it's perfectly fine to have packets coming from only one
side of conversation (i.e. when the second party has muted its
audio).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option> <replaceable>timeout_socket</replaceable></term>
<listitem>
<para>
This parameter specifies permitted notification sockets only.
The listening socket must be created by another application,
preferably before starting rtpproxy.
</para>
<para>
Timeout notifications must be enabled by the SIP controller when setting
up the session. The SIP Controller must specify the timeout_socket, and
a notify_tag, which is expected to be an arbitrary string that can be used
by the SIP controller to identify which session a received time out notification
relates to.
</para>
<para>
If a SIP Controller specifies a notification socket for a session, and that
socket is not specified using the <option>-n</option> flag, the rtpproxy will
not send a notification, and will not produce an error. It will ignore the
notification request.
</para>
<para>
Format of <replaceable>timeout_socket</replaceable> is
<type>:<socket>. Following types are
supported:
<itemizedlist>
<listitem>
<para>
<emphasis>unix:</emphasis>Connect to UNIX
domain socket for sending timeout notifications. In
this mode B2BUA and rtpproxy must be running on the
same host.
</para>
<para>Example: -n unix:/var/run/rtpproxy_timeout.sock</para>
</listitem>
<listitem>
<para>
<emphasis>tcp:</emphasis>Connect to a remote
host using TCP/IP for sending timeout notifications.
Format of the <replaceable>socket</replaceable>
parameter in this case is <host>:<port>.
</para>
<para>Example: -n tcp:10.20.30:12345</para>
</listitem>
</itemizedlist>
</para>
<para>
There is no default value, notifications are not sent and not
permitted unless a value is specified explicitly.
Multiple notification sockets can be provided by specifying
the <option>-n</option> flag more than once.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-P</option></term>
<listitem>
<para>
Record sessions using libpcap file format instead of non-standard
ad-hoc format. The libpcap format, which is the de-facto
standard for packet capturing software, has the advantage of
being compatible with numerous third-party tools and utilities,
such as tcpdump or Wireshark. The drawback of libpcap
is slightly larger overhead (extra 12 bytes for every saved RTP
packet for IPv4).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-a</option></term>
<listitem>
<para>
Record all sessions going through the rtpproxy unconditionally.
By default rtpproxy expects the SIP controller to enable recording
on a per-session basis.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option> <replaceable>log_level<optional>:log_facility</optional></replaceable></term>
<listitem>
<para>
Configures the verbosity level of the log output.
Possible <replaceable>log_level</replaceable> values in the order
from the most verbose to the least verbose are: DBUG, INFO, WARN,
ERR and CRIT.
</para>
<para>
The optional <replaceable>log_facility</replaceable> parameter
sets syslog(3) facility assigned to log messages.
</para>
<para>
Example: -d WARN:LOG_LOCAL5
</para>
<para>
The default level in foreground mode is is DBUG, in background -
WARN and facility is LOG_DAEMON.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>HowItWorks</title>
<para>
When the SIP controller receives an INVITE request, it extracts the
Call-ID and from_tag from INVITE. The call controller communicates it with
the rtpproxy via Unix domain socket or a UDP socket. rtpproxy looks for an
existing session with the given Call-ID and from_tag.
</para>
<para>
If rtpproxy finds a session that is already associated with the given Call-ID,
it will return the UDP port number that is already associated with that session.
</para>
<para>
If the given Call-ID and from_tag is not associated with an existing session,
it will create a new session by randomly choosing a free UDP port from the usable
UDP port range. The UDP port number will be provided as a response to the SIP
controllers request.
</para>
<para>
The SIP controller is then expected to rewrite the SDP, replacing the ip:port
to that of the IP address of the rtpproxy, and the port number allocated by the
rtpproxy. The user agent reading the SDP will then send its RTP stream to the
rtpproxy.
</para>
<para>
When the SIP Controller receives a non-negative SIP reply with SDP it extracts
the Call-ID, from_tag and to_tag from the SIP message and sends a request to the rtpproxy
with Call-ID, from_tag and to_tag.
</para>
<para>
The rtpproxy looks for an existing session based on the Call-ID and from_tag,
which it should find. It will then randomly choose another port and "connect"
this port with the earlier allocated port, forming the proxy between both
sides.
</para>
<para>
When the SIP controller recieves the new port number from the rtpproxy,
the SIP controller is expected to rewrite the SDP in the SIP message body by
replacing the ip:port to that of the IP address and new udp port number
provided by rtpproxy. The SIP controller is expected to send the reply to
the user agent that initiated the call.
</para>
<para>
After the session has been created, the proxy listens on the ports
it has allocated for that session and waits for receiving at least
one UDP packet from each of the two parties participating in the
call. Once a packet is received, the proxy fills one of two
ip:port structures associated with respective stream with the source
ip:port of that packet. When both structures are filled in, the proxy starts
relaying UDP packets between the parties.
</para>
<para>
The rtpproxy tracks idle time for each of existing sessions (i.e. the time
within which there were no packets relayed), and automatically cleans
up a sessions whose idle times exceed the idle time (60 seconds by default).
</para>
</refsect1>
<refsect1>
<title>FILES</title>
<para>
<filename>/usr/sbin/rtpproxy</filename>
</para>
</refsect1>
<refsect1>
<title>LICENSE</title>
<para>
This program is licensed under the BSD license. See
<filename>COPYING</filename> file in the rtpproxy sources for details.
</para>
</refsect1>
<refsect1>
<title>AVAILABILITY</title>
<para>
The latest version of this program can be found at
<ulink url="http://www.rtpproxy.org/">http://www.rtpproxy.org/</ulink>.
</para>
</refsect1>
</refentry>