[Serusers] New versions of RTP proxy/nathelper have finally landed allowing SIP ALG and other goodies

Maxim Sobolev sobomax at portaone.com
Mon Feb 9 16:47:23 CET 2004


Folks,

I've have committed new version of RTP proxy and nathelper into the 
SER's cvs. One of the main changes in the new version is support for 
so-called "bridge mode" in nathelper, which allows to create 
application-level SIP gateways (e.g. ALG) on NAT box, to allow NATed 
clients to make calls into WAN without any problems (or on IPv4/IPv6 
gateway to allow IPv4<->IPv6 calls). The mode is activated by supplying 
RTP proxy with two listen addresses, for example:

rtpproxy -l 1.1.1.1/2.2.2.2, in this case it means that 1.1.1.1 is 
"external" address (WAN), while "2.2.2.2" is "internal" one (LAN). Of 
course terms "internal" and "external" aren't magic, they are used for 
convinience to avoid using something like "address1" and "address2".

For IPv4<->IPv6 command line will be: rtpproxy -l <IPv4> -6 /<IPv6>, or 
rtpproxy -l /<IPv4> -6 <IPv6>, correspondingly in the first case IPv4 
will be considered "external", while IPv6 "internal", while in the 
second one vice versa.

Then, you have to configure ser properly, exact config is left as a 
excersise to the reader, but the main principles are the following:

1. For proper bridging you have to enable loose routing, so that all SIP 
signalling always goes through proxy (remember, UAs on LAN can't talk to 
UAs on WAN directly).

2. In main route add something like the following to enable RTP bridging:

if (<some check that message is received from LAN>) {
	force_rtp_proxy("i");
} else {
	force_rtp_proxy();
};

This is no need to do such "black" magick in reply_route(), use as usual:

onreply_route[1] {
	...
	if (status=~"183" || status=~"200")
		force_rtp_proxy();
	...
}

The code is only lightly tested, so that there might be bugs. Please 
report them to me.

Please also note that IPv6 support is imcomplete since nathelper can't 
yet extract and rewrite IPv6 addresses and RTP proxy can't yet pre-load 
IPv6 addresses when creating a session. However, main infrastructure is 
in place, so that it can be coded in quite easily (patches or 
sponsorship ;-) as usually are welcome).

-Maxim

-------- Original Message --------
Subject: [Serdev] CVS:commitlog: sip_router/modules/nathelper nathelper.c
Date: Mon, 9 Feb 2004 16:05:03 +0100
From: Maxim Sobolev <sobomax at portaone.com>
To: serdev at lists.iptel.org

sobomax     2004/02/09 16:05:03 CET

   SER CVS Repository

   Modified files:
     modules/nathelper    nathelper.c
   Log:
   o force_rtp_proxy now accepts option argument, which
     consists of string of chars, each of them turns "on"
     some feature, currently supported ones are:

      `a' - flags that UA from which message is received
            doesn't support symmetric RTP;
      `l' - force "lookup", that is, only rewrite SDP when
            corresponding session is already exists in the
            RTP proxy. Only makes sense for SIP requests,
            replies are always processed in "lookup" mode;
      'i' - flags that message is received from UA in the
            LAN. Only makes sense when RTP proxy is rinning
            in the bridge mode.

     NOTE: proper support for those flags requires very last
     version of RTP proxy software at this time only available
     from cvs.

   o force_rtp_proxy can now be invoked without any argumens,
     as previously, with one argument - in this case argument
     is treated as option string and with two arguments, in
     which case 1st argument is option string and the 2nd
     one is IP address which have to be inserted into
     SDP (IP address on which RTP proxy listens).

   Revision  Changes    Path
   1.40      +130 -50   sip_router/modules/nathelper/nathelper.c
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/nathelper/nathelper.c.diff?r1=1.39&r2=1.40




More information about the sr-users mailing list