[SR-Users] SIP UA's behind same NAT

Deon Vermeulen vermeulen.deon at gmail.com
Mon Dec 20 11:25:16 CET 2010


Hi List

Can someone please help me?

I need to implement PBX Services for a customer that has 10 IP Phones at his Main site and then 20 IP Phones located over 5 Branches.

My goal is to have RTP go end to end and not proxied.

I had a look at the below link and tried  it, but with no luck.

http://kamailio.org/dokuwiki/doku.php/examples:caller-callee-behind-same-nat

Here is a partial output of my kamailio.cfg file if someone would be so kind to help me.


#!ifdef WITH_NAT
# ----- rtpproxy params -----
modparam("rtpproxy", "rtpproxy_sock", "udp:localhost: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 x.x.x.x")

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



####### Routing Logic ########


# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
route {

        # per request initial checks
        route(REQINIT);

        # NAT detection
        route(NAT);




# Caller NAT detection route
route[NAT] {
#!ifdef WITH_NAT
        force_rport();
        if (nat_uac_test("19")) {
                if (method=="REGISTER") {
                        fix_nated_register();
                } else {
                        fix_nated_contact();
                }
                setflag(FLT_NATS);
        }
#!endif
        return;
}

# RTPProxy control
route[RTPPROXY] {
#!ifdef WITH_NAT
        if (is_method("BYE")) {
                unforce_rtp_proxy();
        } else if (is_method("INVITE")){
                force_rtp_proxy();
        }
        if (!has_totag()) add_rr_param(";nat=yes");
#!endif
        return;
}



Thank you in advance

Kind Regards
Deon


More information about the sr-users mailing list