[Serusers] SER, Rtpproxy, NAT.

iw03_amn at it.kth.se iw03_amn at it.kth.se
Sat Feb 19 22:34:49 CET 2005


Hi all,

I'm running ser 0.8.14 with nathelper+rtpproxy. I can initiate calls from
UA behind NAT to UA in public without problem. But, I can't initiate a
call from public to private even if the NATed client has been registered.

Please advise.

Here is the snippet of my ser.cfg
------------------------begin----------------------------------
#-----Nathelper parameters-----
modparam("registrar", "nat_flag", 6) # indicates that a registered client
is behind NAT
modparam("nathelper", "natping_interval", 60) #ping interval 30s
modparam("nathelper", "ping_nated_only", 1) #ping only clients behind NAT
.
.
if (nat_uac_test("3")) {
                log(1, "src address different than via header->NAT
detected\n");
                log(1, "force_rport and fix_nated_contact and setflag(5)\n");
                if (method=="REGISTER" || ! search("^Record-Route:")) {
                        fix_nated_contact();# Rewrite contact with source
IP of signalling
                        if (method=="INVITE") {
                                fix_nated_sdp("1");# Add direction=active
to SDP
                        };
                        force_rport();# Add rport parameter to topmost Via
                        setflag(6);# Mark as NATed
                };
        append_hf("P-hint: fixed NAT contact for request\r\n");
        };
.
.

route[1]
{
# !! Nathelper
if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
!search("^Route:")){
    sl_send_reply("479", "We don't forward to private IP addresses");
    break;
};
# if client or server know to be behind a NAT, enable relay
if (isflagset(6)) {
    force_rtp_proxy();
};
# NAT processing of replies; apply to all transactions (for example,
# re-INVITEs from public to private UA are hard to identify as
# NATed at the moment of request processing); look at replies
t_on_reply("1");
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP

   if (!t_relay()) {
        sl_reply_error();
   };
}

      # NATed transaction ?
onreply_route[1] {
    if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
        fix_nated_contact();
        force_rtp_proxy();
    } else if (nat_uac_test("1")) {
            fix_nated_contact();
       };
}
----------------------------end----------------------------------------
Regards.




More information about the sr-users mailing list