[SR-Users] NAT function

Kethzer Docteur kethzer.dr at gmail.com
Wed Aug 28 21:28:59 CEST 2013


I need help to fixed my NAT configuration I have nat module load but nat
configuration is not working. ANY HELP PLease

#!ifdef WITH_NAT
loadmodule "nathelper.so"
loadmodule "rtpproxy.so"
loadmodule "nat_traversal.so"
#!endif


#!ifdef WITH_NAT
# ----- rtpproxy params -----
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")

# ----- nathelper params -----
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
modparam("nathelper", "sipping_from", "sip:pinger at 67.215.8.130")

# params needed for NAT traversal in other modules
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
modparam("usrloc", "nat_bflag", FLB_NATB)
#!endif


route[NATDETECT] {
#!ifdef WITH_NAT
        force_rport();
        if (nat_uac_test("19")) {
                if (is_method("REGISTER")) {
                        fix_nated_register();
                } else {
                        add_contact_alias();
                }
                setflag(FLT_NATS);
        }
#!endif
        return;
}

# RTPProxy control
route[NATMANAGE] {
#!ifdef WITH_NAT
        if (is_request()) {
                if(has_totag()) {
                        if(check_route_param("nat=yes")) {
                                setbflag(FLB_NATB);
                        }
                }
        }
        if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
                return;

        rtpproxy_manage();

        if (is_request()) {
                if (!has_totag()) {
                        add_rr_param(";nat=yes");
                }
        }
        if (is_reply()) {
                if(isbflagset(FLB_NATB)) {
                        add_contact_alias();
                }
        }
#!endif
        return;
}

-- 
Kethzer Docteur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130828/1bce7932/attachment.html>


More information about the sr-users mailing list