[Serusers] Asterisk SER NAT issue

Alberto Cruz acruz at tekbrain.com
Thu May 1 17:39:41 CEST 2008


Hi Thorsten, both platform SER and Asterisk has the capability to deal with
NAT without any problem. If you decide to use Asterisk only to be in charge
about the NAT issue so you don't have to configure anything at SER but if
you want that both of them share the job, so you have to configure nathelper
and rtpproxy/mediaproxy at SER.

Ragards.

Alberto Cruz

-----Original Message-----
From: serusers-bounces at lists.iptel.org
[mailto:serusers-bounces at lists.iptel.org] On Behalf Of Thorsten
Sent: Wednesday, April 30, 2008 2:46 AM
To: serusers at lists.iptel.org
Subject: [Serusers] Asterisk SER NAT issue

Hi guys,
I'm trying to get this constellation running

Asterisk (priavte IP)---->SER (public IP)---->Asterisk  (public IP)

I've already Asterisk set up to put the external IP to the SIP messages 
with this parameter in sip.conf
externip = 82.98.89.129
but I'm not sure what I have to configure on SER. Do I need the nathelper?
My config of SER looks like this:
# ----------- global configuration parameters ------------------------
debug=4         # debug level (cmd line: -dddddddddd)
#debug=0
fork=no
log_stderror=yes # (cmd line: -E)

check_via=no    # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
#listen=10.4.1.80
port=5060
children=4
fifo="/tmp/ser_fifo"

# ------------------ module loading ----------------------------------
loadmodule "/usr/local/ser/lib/ser/modules/sl.so"
loadmodule "/usr/local/ser/lib/ser/modules/tm.so"
loadmodule "/usr/local/ser/lib/ser/modules/rr.so"
loadmodule "/usr/local/ser/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/ser/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/ser/lib/ser/modules/registrar.so"
loadmodule "/usr/local/ser/lib/ser/modules/textops.so"
loadmodule "/usr/local/ser/lib/ser/modules/avpops.so"
loadmodule "/usr/local/ser/lib/ser/modules/xlog.so"
loadmodule "/usr/local/ser/lib/ser/modules/auth.so"
loadmodule "/usr/local/ser/lib/ser/modules/nathelper.so"
loadmodule "/usr/local/ser/lib/ser/modules/uri.so"


# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
modparam("usrloc", "db_mode",   0)
modparam("rr", "enable_full_lr", 1)
modparam("registrar", "nat_flag", 6)
modparam("nathelper", "natping_interval", 30) # Ping interval 30 s
modparam("nathelper", "ping_nated_only", 1)   # Ping only clients behind NAT
route{
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                break;
        };
        if (msg:len >=  2048 ) {
                sl_send_reply("513", "Message too big");
                break;
        };

if (!method=="REGISTER") record_route();
if (loose_route()) {
                # mark routing logic in request
                append_hf("P-hint: rr-enforced\r\n");
                route(1);
                break;
        };
 if (!uri==myself) {
                # mark routing logic in request
                append_hf("P-hint: outbound\r\n");
                route(1);
                break;
        };
 if (uri==myself) {
                if (method=="ACK") {
                        route(1);
                        break;
                }

                if (method=="REGISTER") {
                        record_route();
                        save("location");
                        break;
                };
                if (method=="INVITE") {
                        if (uri =~ "sip:0[0-9]@*") {
                                route(3);
                                break;
                        }
                };

                lookup("aliases");
                if (!uri==myself) {
                       append_hf("P-hint: outbound alias\r\n");
                        route(1);
                        break;
                };

                # native SIP destinations are handled using our USRLOC DB
                if (!lookup("location")) {
                        sl_send_reply("404", "Not Found");
                        break;
                };
        };
        append_hf("P-hint: usrloc applied\r\n");
        route(1);
}

route[1]
{
        if (!t_relay()) {
               sl_reply_error();
        };
                #log(1, 
"----------------------------Ringing--------------------\n");
                #sl_send_reply("180", "Ringing");
}

route[3]
{
        if (uri =~ "sip:0[0-9]@*") {
                log(1, "Forwarding to MG03 \n");
                rewritehostport("82.98.89.176:5060");
                route(1);
                break;
        }
}

I appreciate any help
Thanks
Thorsten

_______________________________________________
Serusers mailing list
Serusers at lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list