Hi Sir,
Thank you for your reply.
I was able to run ser using the configuration below.
How would I know Sir that it's forcing it to use rtpproxy, I was able to make test calls, but using also the SIP sevrer as the NAT gateway (I don't have that much equipment to test with :( ) So I think voice will really go through on each since the SIP server is just a hop away from the UA's.
Also i'd like to force only rtpproxy when only making calls to local extensions, not going to PSTN. I tried adding this location was save:
if (uri=~"^(sip:)[1-9]...@nhadzter.com) { route(1); break; };
But I can't make any calls, and when I do ngrep on port 5060, I can see only INVITE's coming from the caller. It seems that it can't find the CALLEE or the CALLE doesn't respond.
I'd really appreciate any help you can give me. Thank you so much.
=====================================================
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
# We will you flag 6 to mark NATed contacts modparam("registrar", "nat_flag", 6)
# Enable NAT pinging modparam("nathelper", "natping_interval", 60)
# Ping only contacts that are known to be # behind NAT modparam("nathelper", "ping_nated_only", 1)
):
# special handling for NATed clients; first, nat test is # executed: it looks for via!=received and RFC1918 addresses # in Contact (may fail if line-folding used); also, # the received test should, if complete, should check all # vias for presence of received if (nat_uac_test("3")) { # allow RR-ed requests, as these may indicate that # a NAT-enabled proxy takes care of it; unless it is # a REGISTER
if (method == "REGISTER" || ! search("^Record-Route:")) { log("LOG: Someone trying to register from private IP, rewriting\n");
# This will work only for user agents that support symmetric # communication. We tested quite many of them and majority is # smart smart enough to be symmetric. In some phones, like # it takes a configuration option. With Cisco 7960, it is # called NAT_Enable=Yes, with kphone it is called # "symmetric media" and "symmetric signaling". (The latter # not part of public released yet.)
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 }; };
# # Forcing media relay if necessary # route[1] { if (uri=~"[@:](192.168.|10.|172.16)" && !search("^Route:")){ sl_send_reply("479", "We don't forward to private IP addresses"); break; }; if (isflagset(6)) { force_rtp_proxy(); t_on_reply("1"); append_hf("P-Behind-NAT: Yes\r\n"); };
if (!t_relay()) { sl_reply_error(); break; }; }
onreply_route[1] { if (status =~ "(183)|2[0-9][0-9]") { fix_nated_contact(); force_rtp_proxy(); }; }