Hi,<br><br>I've configured OpenSIPs with Radius and now working to configure NAT on OpenSIPs using module mod_nathelper. After configuring, I'm getting following errors as listed down below;<br><br>Apr 1 11:53:31 rose /usr/local/sbin/opensips[11386]: ERROR:nathelper:select_rtpp_node: script error -no valid set selected<br>
Apr 1 11:53:31 rose /usr/local/sbin/opensips[11386]: ERROR:nathelper:force_rtp_proxy_body: no available proxies<br>Apr 1 11:53:46 rose /usr/local/sbin/opensips[11382]: ERROR:nathelper:select_rtpp_node: script error -no valid set selected<br>
Apr 1 11:53:46 rose /usr/local/sbin/opensips[11382]: ERROR:nathelper:unforce_rtp_proxy_f: no available proxies<br>Apr 1 11:53:46 rose /usr/local/sbin/opensips[11386]: ERROR:nathelper:force_rtp_proxy: Unable to parse body<br>
<br>And the configuration of OpenSIPs is listed below;<br><br>loadmodule "dispatcher.so"<br>#loadmodule "auth_diameter.so"<br>loadmodule "aaa_radius.so"<br>loadmodule "auth_aaa.so"<br>
loadmodule "permissions.so"<br>loadmodule "nathelper.so"<br><br>#--------------------------------Settings For Radius-------------------------------------<br>#modparam("auth_diameter", "diameter_client_host", "localhost")<br>
modparam("aaa_radius", "radius_config","/usr/etc/radiusclient-ng/radiusclient.conf")<br>modparam("acc", "aaa_url", "radius:/usr/etc/radiusclient-ng/radiusclient.conf")<br>
modparam("acc", "aaa_flag", 2)<br>modparam("acc", "aaa_missed_flag", 3)<br>modparam("acc", "aaa_extra", "User-Name=$Au; \<br> Calling-Station-Id=$from; \<br>
Called-Station-Id=$to; \<br> Sip-Translated-Request-URI=$ruri; \<br> Sip-RPid=$avp(s:rpid); \<br> Source-IP=$si; \<br>
Source-Port=$sp; \<br> Canonical-URI=$avp(s:can_uri); \<br> Billing-Party=$avp(s:billing_party); \<br> Divert-Reason=$avp(s:divert_reason); \<br>
X-RTP-Stat=$hdr(X-RTP-Stat); \<br> Contact=$hdr(contact); \<br> Event=$hdr(event); \<br> SIP-Proxy-IP=$avp(s:sip_proxy_ip); \<br>
ENUM-TLD=$avp(s:enum_tld)")<br><br>modparam("auth_aaa","aaa_url","radius:/usr/etc/radiusclient-ng/radiusclient.conf")<br>modparam("auth", "rpid_prefix", "<sip:")<br>
modparam("auth", "rpid_suffix", "@<a href="http://rose.vopium.com">rose.vopium.com</a>>;screen=yes;privacy=off")<br>modparam("auth", "rpid_avp", "$avp(s:rpid)")<br>
#modparam("uri","service_type",10)<br><br># ----------------- setting module-specific parameters ---------------<br><br>modparam("permissions", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")<br>
<br>#----------------- setting NAT module parameters ---------------------<br><br>modparam("nathelper","ping_nated_only",1)<br>modparam("nathelper", "natping_interval", 30)<br>modparam("nathelper","natping_processes",1)<br>
modparam("nathelper","rtpproxy_sock","")<br>modparam("nathelper","received_avp","$avp(i:42)")<br>#modparam("nathelper", "sipping_bflag", 7)<br>
modparam("usrloc", "nat_bflag", 6)<br><br>route{<br><br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br> exit;<br>
}<br><br> #NAT detection<br> log("######################################### Go to Route 3 for NAT Detection #####################################");<br> route(3);<br><br> if (has_totag()) {<br>
if (loose_route()) {<br> if (is_method("BYE")) {<br> setflag(1); # do accounting ...<br> setflag(3); # ... even if the transaction fails<br>
} else if (is_method("INVITE")) {<br> record_route();<br> }<br> route(1);<br> } else {<br> if ( is_method("ACK") ) {<br>
if ( t_check_trans() ) {<br> t_relay();<br> exit;<br> } else {<br> exit;<br>
}<br> }<br> sl_send_reply("404","Not here");<br> }<br> exit;<br> }<br> # CANCEL processing<br>
if (is_method("CANCEL"))<br> {<br> if (t_check_trans())<br> t_relay();<br> exit;<br> }<br><br> t_check_trans();<br><br> # authenticate if from local subscriber (uncomment to enable auth)<br>
# authenticate all initial non-REGISTER request that pretend to be<br> # generated by local subscriber (domain from FROM URI is local)<br> ##if (!(method=="REGISTER") && from_uri==myself) /*no multidomain version*/<br>
##if (!(method=="REGISTER") && is_from_local()) /*multidomain version*/<br> ##{<br> ## if (!proxy_authorize("", "subscriber")) {<br> ## proxy_challenge("", "0");<br>
## exit;<br> ## }<br> ## if (!check_from()) {<br> ## sl_send_reply("403","Forbidden auth ID");<br> ## exit;<br> ## }<br>
##<br> ## consume_credentials();<br> ## # caller authenticated<br> ##}<br><br> # preloaded route checking<br> if (loose_route()) {<br> xlog("L_ERR",<br>
"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");<br> if (!is_method("ACK"))<br> sl_send_reply("403","Preload Route denied");<br>
exit;<br> }<br><br> # record routing<br> if (!is_method("REGISTER|MESSAGE"))<br> record_route();<br><br><br> #$avp(i:27)=check_source_address("0");<br>
<br> #xlog("Check Source Address from Address TABLE : $(avp(i:27))\n");<br><br> $avp(s:checksrc) = check_source_address("0");<br> log("###########################################################################################\n");<br>
xlog("Check Source Address from Address TABLE Where Value 1 is Equal to True: $(avp(s:checksrc))\n");<br> log("###########################################################################################\n");<br>
<br> xlog("incoming from $si : $sp \n");<br><br> if (check_source_address("0")) {<br> if (is_method("INVITE")){<br> log("#################### INVITE FUNCTION 1 ####################");<br>
setflag(1); # do accounting<br> }<br> }<br><br> if (!uri==myself)<br> ## replace with following line if multi-domain support is used<br> ##if (!is_uri_host_local())<br>
{<br> append_hf("P-hint: outbound\r\n");<br> # if you have some interdomain connections via TLS<br> ##if($rd=="<a href="http://tls_domain1.net">tls_domain1.net</a>") {<br>
## t_relay("tls:<a href="http://domain1.net">domain1.net</a>");<br> ## exit;<br> ##} else if($rd=="<a href="http://tls_domain2.net">tls_domain2.net</a>") {<br>
## t_relay("tls:<a href="http://domain2.net">domain2.net</a>");<br> ## exit;<br> ##}<br> route(1);<br> }<br><br> if(uri==myself)<br>
{<br> log("########################################### URI == MYSELF ########################################");<br> if(method=="REGISTER")<br> {<br>
route(2);<br> }<br><br> append_hf("P-hint: usrloc applied\r\n");<br> }<br><br> # requests for my domain<br><br> ## uncomment this if you want to enable presence server<br>
## and comment the next 'if' block<br> ## NOTE: uncomment also the definition of route[2] from below<br> ##if( is_method("PUBLISH|SUBSCRIBE"))<br> ## route(2);<br>
<br> if (is_method("PUBLISH"))<br> {<br> sl_send_reply("503", "Service Unavailable");<br> exit;<br> }<br><br><br> if (is_method("REGISTER"))<br>
{<br> route(2);<br> }<br><br> if ($rU==NULL) {<br> # request with no Username in RURI<br> sl_send_reply("484","Address Incomplete");<br>
exit;<br> }<br><br> # apply DB based aliases (uncomment to enable)<br> ##alias_db_lookup("dbaliases");<br><br> # do lookup with method filtering<br> if (!lookup("location","m")) {<br>
switch ($retcode) {<br> case -1:<br> log("############################# LOOKUP LOCATION FLAG -1 PASS #################################");<br>
#ds_select_dst("1","4");<br><br> log("############################# DO ACCOUNTING ON RADIUS ######################################");<br>
setflag(2);<br><br><br> log("############################# SEND CALL TO ASTERISK #######################################");<br> rewritehostport("<a href="http://11.22.33.44:5060">11.22.33.44:5060</a>");<br>
<br> #forward();<br> log("############################# CALL IS GOING IN STATEFULL MANNER ############################");<br> t_relay();<br>
<br> log("############################# CALL ROUTING TO ROUTE 1 ######################################");<br> route(1);<br> exit;<br>
case -3:<br> log("############################ LOOKUP LOCATION FLAG -3 PASS #################################");<br> t_newtran();<br>
t_reply("404", "Not Found");<br> exit;<br> case -2:<br> log("############################ LOOKUP LOCATION FLAG -2 PASS #################################");<br>
sl_send_reply("405", "Method Not Allowed");<br> exit;<br> }<br> }<br><br> # when routing via usrloc, log the missed calls also<br>
setflag(2);<br><br> log("############################# LOOKUP LOCATION FLAG 1 PASS ########################################");<br> route(1);<br>}<br><br><br>route[1] {<br> # for INVITEs enable some additional helper routes<br>
if (is_method("INVITE")) {<br><br> log("################################ INVITE ROUTE 1 Function ##################################");<br> t_on_branch("2");<br>
t_on_reply("2");<br> t_on_failure("1");<br> }<br><br> if (subst_uri('/(sip:.*);nat=yes/\1/')){<br><br> log("################################ IF SUBSTR CONTAINS NAT=YES ################################");<br>
setbflag(6);<br> };<br><br> if (isflagset(5)||isbflagset(6)) {<br><br> log("################################ CHECK FLAGSET AND ROUTE TO 4 ###############################");<br>
route(4);<br> }<br><br> if (!t_relay()) {<br> sl_reply_error();<br> };<br> exit;<br>}<br>route[2]<br>{<br><br> log("######################################## AAA-REGISTRATION #######################################");<br>
if (!aaa_www_authorize("<a href="http://rose.vopium.com">rose.vopium.com</a>"))<br> {<br> www_challenge("<a href="http://rose.vopium.com">rose.vopium.com</a>", "1");<br>
return;<br> # #exit;<br> }<br><br> if(isflagset(5))<br> {<br> log("################################### IF FLAG SET IS 5 ##################################");<br>
# set branch flag -- when someone will call this user<br> # the INVITE will have branch flag 6 set after lookup("location")<br> setbflag(6);<br> # if you want OPTIONS natpings uncomment next<br>
# setbflag(7);<br> }<br><br><br> if (!save("location"))<br> sl_reply_error();<br><br> exit;<br>}<br><br>route[3]<br>{<br> log("################################ FUNCTION ROUTE 3 NAT DETECTION ################################");<br>
<br> force_rport();<br> if (nat_uac_test("19")) {<br> if (method=="REGISTER") {<br> fix_nated_register();<br> } else {<br> fix_nated_contact();<br>
};<br> setflag(5);<br> };<br>}<br><br>route[4]<br>{<br> log("################################ FUNCTION ROUTE 4 RTP PROXY ################################");<br> if (is_method("BYE")) {<br>
unforce_rtp_proxy();<br> } else if (is_method("INVITE")){<br> force_rtp_proxy();<br> #t_on_failure("2");<br> t_on_failure("3");<br>
};<br> if (isflagset(5))<br> search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<br> #t_on_reply("1");<br> t_on_reply("3");<br>}<br>
<br><br><br>branch_route[2] {<br> xlog("new branch at $ru\n");<br>}<br><br>onreply_route[2] {<br> xlog("incoming reply\n");<br>}<br><br><br>failure_route[1] {<br> if (t_was_cancelled()) {<br>
exit;<br> }<br><br>}<br><br>failure_route[3] {<br><br> log("################################ FAILURE ROUTE 3 FUNCTION ################################");<br><br> if (isbflagset(6) || isflagset(5)) {<br>
unforce_rtp_proxy();<br> }<br>}<br><br>onreply_route[3] {<br><br> log("################################ ONREPLY ROUTE 3 FUNCTION ################################");<br><br> if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") {<br>
force_rtp_proxy();<br> }<br> search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<br><br> if (isbflagset(6)) {<br> fix_nated_contact();<br> }<br>
exit;<br>}<br><br clear="all">Kindly state, how can I resolve this error in my above configuration. Please advise. <br><br>-- <br>Regards,<br><br>Ahmed Munir<br><br><br>