[OpenSIPS-Users] OpenSIPS Server behind a NAT firewall

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Dec 22 10:52:41 CET 2010


Hi Damon,

Looking at:

    if (is_method("REGISTER")) {
        #-- Request is behind NAT(flag5) save with bflag 6 -#
        #---- Use bflag 7 to start SIP pinging (Options) ---#
        if (isflagset(5)) {
            setbflag(6);
            setbflag(7);
        };

        if (!save("location")) {
            sl_reply_error();
            exit;
        };

        if($rU=~"^\*") {
            # Route to media servers
            route(5);
            route(1);
        };

        send_reply("420", "Invalid Extension");
        exit;
    };



There is a bogus test:

	if($rU=~"^\*") {

As REGISTER requests do not have username in RURI (RURI simply points to 
registrar address), that test will always fail, so you end up with the 420.

I'm not sure what you want to do there - you want to forward certain 
REGISTERs to other parties ? the "*" test should be on registered user?

Regards,
Bogdan


Damon Miller wrote:
> Hi all.  I'm trying to deploy an OpenSIPS server behind a NAT firewall.  I've searched the various list archives for references on how this can be accomplished, but this far the only example I found was essentially left unresolved.  A quick illustration seems helpful, so here's my attempt:
>
>
>  ----------                  ------------                          -------------                   --------------
>  - Peer A -    <--->         -    F/W   -            <--->         -    F/W    -           <--->   -  OpenSIPS  -
>  ----------                  ------------                          -------------                   --------------
> 192.168.1.10   (LAN)   192.168.1.1 : 131.239.15.22   (WAN)   50.18.56.112 : 192.168.20.1   (LAN)   192.168.20.235
>
>
>
> Picasso I'm not but hopefully that makes some sense.  Basically I have a NAT firewall on the client side and a NAT firewall on the server side.  Both of the firewall have two IP addresses--one internal and one external.  I've attempted to configure nathelper and RTPProxy but I've clearly done something wrong on the OpenSIPS side as it generates a 420 when the client registers.  I tried to use the example provided in Flavio's excellent book, so the most likely cuplrit is my changes made in an attempt to simplify.  Please be gentle; I'm still learning...  Thanks in advance for any guidance.
>
> Here's my opensips.cfg file:
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Event - expo, conf, social, bootcamp
2 - 4 February 2011, ITExpo, Miami,  USA
www.voice-system.ro




More information about the Users mailing list