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
|
.\" Title: rtpproxy
.\" Author: Maxim Sobolev
.\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
.\" Date: Jun 16, 2008
.\" Manual:
.\" Source:
.\"
.TH "RTPPROXY" "8" "Jun 16, 2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
rtpproxy \- RTP (Real\-time Transport Protocol) Proxy Server
.SH "SYNOPSIS"
.HP 9
\fBrtpproxy\fR [\fB\-?\fR] [\fB\-2\fR] [\fB\-f\fR] [\fB\-v\fR] [\fB\-R\fR] [\fB\-l\fR\ \fIaddr1\fR\fI[/addr2]\fR] [\fB\-6\fR\ \fIaddr1\fR\fI[/addr2]\fR] [\fB\-s\fR\ \fIctrl_socket\fR] [\fB\-t\fR\ \fItos\fR] [\fB\-p\fR\ \fIpidfile\fR] [\fB\-T\fR\ \fImax_ttl\fR] [\fB\-r\fR\ \fIrdir\fR\ [\fB\-S\fR\ \fIsdir\fR]] [\fB\-m\fR\ \fImin_port\fR] [\fB\-M\fR\ \fImax_port\fR] [\fB\-u\fR\ \fIuname\fR\fI[:gname]\fR] [\fB\-F\fR]
.SH "DESCRIPTION"
.PP
\fBrtpproxy\fR
is a symmetric RTP proxy designed to be used in conjunction with the SIP Express Router (SER) or any other SIP proxy or SIP B2BUA capable of rewriting SDP bodies in SIP messages that it processes.
.PP
The main purpose of rtpproxy is to make the communication between SIP user agents behind NAT(s) (Network Address Translator) possible. 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.
.PP
When two listen interfaces have been specified using the command line parameters described below then rtpproxy will enter so called bridging mode. In briding 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 connectivy (provided that the host running rtpproxy has one interface in both of them). One particular application of bridging mode is IPv4/IPv6 traversal of RTP packets.
.PP
When instructured by SER rtpproxy can also record the entire RTP session in a file on a local harddisk or play a pre\-recorded file to the user agent (so called Music\-on\-Hold).
.SH "OPTIONS"
.PP
\fB\-?\fR
.RS 4
Show summary of options.
.RE
.PP
\fB\-2\fR
.RS 4
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.
.RE
.PP
\fB\-f\fR
.RS 4
Rtpproxy will stay in foreground mode if this option is set.
.RE
.PP
\fB\-v\fR
.RS 4
Show version of program.
.RE
.PP
\fB\-l\fR \fIaddr1\fR\fI[/addr2]\fR
.RS 4
IPv4 listen IP address(es). You can specify either one or two addresses. If two addresses have been specified then rtpproxy will work in bridging mode.
.RE
.PP
\fB\-6\fR \fIaddr1\fR\fI[/addr2]\fR
.RS 4
IPv6 listen IP address(es). You can specify either one or two addresses. If two addresses have been specified then rtpproxy will work in bridging mode.
.RE
.PP
\fB\-s\fR \fIctrl_socket\fR
.RS 4
This parameter configures rtpproxy control socket. The control socket is used by nathelper module of SER to create/modify/delete RTP sessions to be relayed. Format of
\fIctrl_socket\fR
is <type>:<socket>. Following types are supported:
.RS 4
.TP 4
\(bu
\fIudp:\fR
Create UDP control socket. In this mode RTPProxy will listen on UDP for control messages from SER/nathelper.
.sp
Example: \-s udp:127.0.0.1:9000
.sp
IP address can be '*' in which case rtpproxy will listen on all local interfaces. If omitted port 22222 is used.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
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.
.TP 4
\(bu
\fIudp6:\fR
Create IPv6 UDP control socket. In this mode RTPProxy will listen on UDP/IPv6 for control messages from SER/nathelper.
.sp
Example: \-s udp6:::1:9000
.TP 4
\(bu
\fIunix:\fR
Create UNIX domain socket for control interface. In this mode SER/nathelper and RTPProxy must be running on the same host. This is the default setting for both SER/nathelper and rtpproxy.
.sp
Example: \-s unix:/var/run/rtpproxy.sock
.sp
Default value is
\fI/var/run/rtpproxy.sock\fR.
.RE
.IP "" 4
.RE
.PP
\fB\-t\fR \fItos\fR
.RS 4
Set this ToS (Type of Service) in outgoing packets. Default value is 0xB8.
.RE
.PP
\fB\-r\fR \fIrec_dir\fR
.RS 4
Directory where recorded RTP sessions will be stored.
.RE
.PP
\fB\-S\fR \fIspool_dir\fR
.RS 4
Spool directory for RTP sessions being recorded. The file will be moved to directory configured in
\fB\-r\fR
option after the session finishes.
.RE
.PP
\fB\-R\fR
.RS 4
Do not record RTCP when recording an RTP session. This option is disabled (rtpproxy will record RTCP) by default.
.RE
.PP
\fB\-p\fR \fIpid_file\fR
.RS 4
This parameter configures the name of the file where PID of running rtpproxy will be stored. Default is
\fI/var/run/rtpproxy.pid\fR.
.RE
.PP
\fB\-T\fR \fImax_ttl\fR
.RS 4
Limit the maximum TTL (Time To Live) of outgoing IP packets to the value of
\fImax_ttl\fR.
.RE
.PP
\fB\-m\fR \fImin_port\fR
.RS 4
Set lower limit on UDP ports range that the RTPproxy uses for RTP/RTCP sessions to
\fImin_port\fR. Default is 35000.
.RE
.PP
\fB\-M\fR \fImax_port\fR
.RS 4
Set upper limit on UDP ports range that the RTPproxy uses for RTP/RTCP sessions to
\fImax_port\fR. Default is 65000.
.RE
.PP
\fB\-u\fR \fIuname\fR\fI[:gname]\fR
.RS 4
Switch RTPproxy to UID identified by the
\fIuname\fR
and optional GID identified by
\fIgname\fR
when proxy is up and running.
.RE
.PP
\fB\-F\fR
.RS 4
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.
.RE
.SH "HOWITWORKS"
.PP
When SER receives an INVITE request, it extracts Call\-ID from it and communicates it to rtpproxy via Unix domain socket or UDP. Rtproxy looks for an existing session with such Call\-ID. If the session exists it returns UDP port for that session, if not, then it creates a new session, binds to a first empty UDP port from the range specified at the compile time and returns number of that port to a SER. After receiving reply from the proxy, SER replaces media ip:port in the SDP to point to the proxy and forwards request as usually.
.PP
When SER receives a non\-negative SIP reply with SDP it again extracts Call\-ID from it and communicates it to the proxy. In this case the proxy does not allocate a new session if it doesn't exist, but simply performs a lookup among existing sessions and returns either a port number if the session is found, or error code indicating that there is no session with such id. After receiving positive reply from the proxy, SER replaces media ip:port in the SIP reply to point to the proxy and forwards reply as usually.
.PP
After the session has been created, the proxy listens on the port it has allocated for that session and waits for receiving at least one UDP packet from each of two parties participating in the call. Once such packet is received, the proxy fills one of two ip:port structures associated with each call with source ip:port of that packet. When both structures are filled in, the proxy starts relaying UDP packets between parties.
.PP
The proxy 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 value specified at compile time (60 seconds by default).
.SH "FILES"
.PP
\fI/usr/sbin/rtpproxy\fR
.SH "LICENSE"
.PP
This program is licensed under the BSD license. See
\fICOPYING\fR
file in the rtpproxy sources for details.
.SH "AVAILABILITY"
.PP
The latest version of this program can be found at
\fIhttp://www.rtpproxy.org/\fR.
.SH "SEEALSO"
.PP
ser(8).
.SH "AUTHOR"
.PP
\fBMaxim Sobolev\fR
.sp -1n
.IP "" 4
Author.
.SH "COPYRIGHT"
Copyright \(co 2006 janakj
.br
|