Hi,<br><br>I&#39;ve configured OpenSIPs with Radius and now working to configure NAT on OpenSIPs using  module mod_nathelper. After configuring, I&#39;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 &quot;dispatcher.so&quot;<br>#loadmodule &quot;auth_diameter.so&quot;<br>loadmodule &quot;aaa_radius.so&quot;<br>loadmodule &quot;auth_aaa.so&quot;<br>
loadmodule &quot;permissions.so&quot;<br>loadmodule &quot;nathelper.so&quot;<br><br>#--------------------------------Settings For Radius-------------------------------------<br>#modparam(&quot;auth_diameter&quot;, &quot;diameter_client_host&quot;, &quot;localhost&quot;)<br>
modparam(&quot;aaa_radius&quot;, &quot;radius_config&quot;,&quot;/usr/etc/radiusclient-ng/radiusclient.conf&quot;)<br>modparam(&quot;acc&quot;, &quot;aaa_url&quot;, &quot;radius:/usr/etc/radiusclient-ng/radiusclient.conf&quot;)<br>
modparam(&quot;acc&quot;, &quot;aaa_flag&quot;, 2)<br>modparam(&quot;acc&quot;, &quot;aaa_missed_flag&quot;, 3)<br>modparam(&quot;acc&quot;, &quot;aaa_extra&quot;,    &quot;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)&quot;)<br><br>modparam(&quot;auth_aaa&quot;,&quot;aaa_url&quot;,&quot;radius:/usr/etc/radiusclient-ng/radiusclient.conf&quot;)<br>modparam(&quot;auth&quot;, &quot;rpid_prefix&quot;, &quot;&lt;sip:&quot;)<br>
modparam(&quot;auth&quot;, &quot;rpid_suffix&quot;, &quot;@<a href="http://rose.vopium.com">rose.vopium.com</a>&gt;;screen=yes;privacy=off&quot;)<br>modparam(&quot;auth&quot;, &quot;rpid_avp&quot;, &quot;$avp(s:rpid)&quot;)<br>
#modparam(&quot;uri&quot;,&quot;service_type&quot;,10)<br><br># ----------------- setting module-specific parameters ---------------<br><br>modparam(&quot;permissions&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)<br>
<br>#----------------- setting NAT module parameters ---------------------<br><br>modparam(&quot;nathelper&quot;,&quot;ping_nated_only&quot;,1)<br>modparam(&quot;nathelper&quot;, &quot;natping_interval&quot;, 30)<br>modparam(&quot;nathelper&quot;,&quot;natping_processes&quot;,1)<br>
modparam(&quot;nathelper&quot;,&quot;rtpproxy_sock&quot;,&quot;&quot;)<br>modparam(&quot;nathelper&quot;,&quot;received_avp&quot;,&quot;$avp(i:42)&quot;)<br>#modparam(&quot;nathelper&quot;, &quot;sipping_bflag&quot;, 7)<br>
modparam(&quot;usrloc&quot;, &quot;nat_bflag&quot;, 6)<br><br>route{<br><br>        if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>                sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>                exit;<br>
        }<br><br>        #NAT detection<br>        log(&quot;######################################### Go to Route 3 for NAT Detection #####################################&quot;);<br>        route(3);<br><br>        if (has_totag()) {<br>
                if (loose_route()) {<br>                        if (is_method(&quot;BYE&quot;)) {<br>                                setflag(1); # do accounting ...<br>                                setflag(3); # ... even if the transaction fails<br>
                        } else if (is_method(&quot;INVITE&quot;)) {<br>                                record_route();<br>                        }<br>                        route(1);<br>                } else {<br>                        if ( is_method(&quot;ACK&quot;) ) {<br>
                                if ( t_check_trans() ) {<br>                                        t_relay();<br>                                        exit;<br>                                } else {<br>                                        exit;<br>
                                }<br>                        }<br>                        sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);<br>                }<br>                exit;<br>        }<br>        # CANCEL processing<br>
        if (is_method(&quot;CANCEL&quot;))<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==&quot;REGISTER&quot;) &amp;&amp; from_uri==myself) /*no multidomain version*/<br>
        ##if (!(method==&quot;REGISTER&quot;) &amp;&amp; is_from_local())  /*multidomain version*/<br>        ##{<br>        ##      if (!proxy_authorize(&quot;&quot;, &quot;subscriber&quot;)) {<br>        ##              proxy_challenge(&quot;&quot;, &quot;0&quot;);<br>
        ##              exit;<br>        ##      }<br>        ##      if (!check_from()) {<br>        ##              sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);<br>        ##              exit;<br>        ##      }<br>
        ##<br>        ##      consume_credentials();<br>        ##      # caller authenticated<br>        ##}<br><br>        # preloaded route checking<br>        if (loose_route()) {<br>                xlog(&quot;L_ERR&quot;,<br>
                &quot;Attempt to route with preloaded Route&#39;s [$fu/$tu/$ru/$ci]&quot;);<br>                if (!is_method(&quot;ACK&quot;))<br>                        sl_send_reply(&quot;403&quot;,&quot;Preload Route denied&quot;);<br>
                exit;<br>        }<br><br>        # record routing<br>        if (!is_method(&quot;REGISTER|MESSAGE&quot;))<br>                record_route();<br><br><br>        #$avp(i:27)=check_source_address(&quot;0&quot;);<br>
<br>        #xlog(&quot;Check Source Address from Address TABLE : $(avp(i:27))\n&quot;);<br><br>        $avp(s:checksrc) = check_source_address(&quot;0&quot;);<br>        log(&quot;###########################################################################################\n&quot;);<br>
        xlog(&quot;Check Source Address from Address TABLE Where Value 1 is Equal to True: $(avp(s:checksrc))\n&quot;);<br>        log(&quot;###########################################################################################\n&quot;);<br>
                        <br>        xlog(&quot;incoming from $si : $sp \n&quot;);<br><br>        if (check_source_address(&quot;0&quot;)) {<br>                if (is_method(&quot;INVITE&quot;)){<br>                        log(&quot;#################### INVITE FUNCTION 1 ####################&quot;);<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(&quot;P-hint: outbound\r\n&quot;);<br>                # if you have some interdomain connections via TLS<br>                ##if($rd==&quot;<a href="http://tls_domain1.net">tls_domain1.net</a>&quot;) {<br>
                ##      t_relay(&quot;tls:<a href="http://domain1.net">domain1.net</a>&quot;);<br>                ##      exit;<br>                ##} else if($rd==&quot;<a href="http://tls_domain2.net">tls_domain2.net</a>&quot;) {<br>
                ##      t_relay(&quot;tls:<a href="http://domain2.net">domain2.net</a>&quot;);<br>                ##      exit;<br>                ##}<br>                route(1);<br>        }<br><br>        if(uri==myself)<br>
        {<br>                log(&quot;########################################### URI == MYSELF  ########################################&quot;);<br>                if(method==&quot;REGISTER&quot;)<br>                {<br>
                        route(2);<br>                }<br><br>                append_hf(&quot;P-hint: usrloc applied\r\n&quot;);<br>        }<br><br>        # requests for my domain<br><br>        ## uncomment this if you want to enable presence server<br>
        ##   and comment the next &#39;if&#39; block<br>        ##   NOTE: uncomment also the definition of route[2] from  below<br>        ##if( is_method(&quot;PUBLISH|SUBSCRIBE&quot;))<br>        ##              route(2);<br>
<br>        if (is_method(&quot;PUBLISH&quot;))<br>        {<br>                sl_send_reply(&quot;503&quot;, &quot;Service Unavailable&quot;);<br>                exit;<br>        }<br><br><br>        if (is_method(&quot;REGISTER&quot;))<br>
        {<br>                route(2);<br>        }<br><br>        if ($rU==NULL) {<br>                # request with no Username in RURI<br>                sl_send_reply(&quot;484&quot;,&quot;Address Incomplete&quot;);<br>
                exit;<br>        }<br><br>        # apply DB based aliases (uncomment to enable)<br>        ##alias_db_lookup(&quot;dbaliases&quot;);<br><br>        # do lookup with method filtering<br>        if (!lookup(&quot;location&quot;,&quot;m&quot;)) {<br>
                switch ($retcode) {<br>                        case -1:<br>                                log(&quot;############################# LOOKUP LOCATION FLAG -1 PASS #################################&quot;);<br>
                                #ds_select_dst(&quot;1&quot;,&quot;4&quot;);<br><br>                                log(&quot;############################# DO ACCOUNTING ON RADIUS ######################################&quot;);<br>
                                setflag(2);<br><br><br>                                log(&quot;############################# SEND CALL TO ASTERISK  #######################################&quot;);<br>                                rewritehostport(&quot;<a href="http://11.22.33.44:5060">11.22.33.44:5060</a>&quot;);<br>
<br>                                #forward();<br>                                log(&quot;############################# CALL IS GOING IN STATEFULL MANNER ############################&quot;);<br>                                t_relay();<br>
<br>                                log(&quot;############################# CALL ROUTING TO ROUTE 1 ######################################&quot;);<br>                                route(1);<br>                                exit;<br>
                        case -3:<br>                                log(&quot;############################ LOOKUP LOCATION FLAG -3 PASS #################################&quot;);<br>                                t_newtran();<br>
                                t_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>                                exit;<br>                        case -2:<br>                                log(&quot;############################ LOOKUP LOCATION FLAG -2 PASS #################################&quot;);<br>
                                sl_send_reply(&quot;405&quot;, &quot;Method Not Allowed&quot;);<br>                                exit;<br>                }<br>        }<br><br>        # when routing via usrloc, log the missed calls also<br>
        setflag(2);<br><br>        log(&quot;############################# LOOKUP LOCATION FLAG 1 PASS ########################################&quot;);<br>        route(1);<br>}<br><br><br>route[1] {<br>        # for INVITEs enable some additional helper routes<br>
        if (is_method(&quot;INVITE&quot;)) {<br><br>                log(&quot;################################ INVITE ROUTE 1 Function ##################################&quot;);<br>                t_on_branch(&quot;2&quot;);<br>
                t_on_reply(&quot;2&quot;);<br>                t_on_failure(&quot;1&quot;);<br>        }<br><br>        if (subst_uri(&#39;/(sip:.*);nat=yes/\1/&#39;)){<br><br>                log(&quot;################################  IF SUBSTR CONTAINS NAT=YES ################################&quot;);<br>
                setbflag(6);<br>        };<br><br>        if (isflagset(5)||isbflagset(6)) {<br><br>                log(&quot;################################  CHECK FLAGSET AND ROUTE TO 4 ###############################&quot;);<br>
                route(4);<br>        }<br><br>        if (!t_relay()) {<br>                sl_reply_error();<br>        };<br>        exit;<br>}<br>route[2]<br>{<br><br>        log(&quot;######################################## AAA-REGISTRATION #######################################&quot;);<br>
        if (!aaa_www_authorize(&quot;<a href="http://rose.vopium.com">rose.vopium.com</a>&quot;))<br>        {<br>                www_challenge(&quot;<a href="http://rose.vopium.com">rose.vopium.com</a>&quot;, &quot;1&quot;);<br>
                 return;<br>                #    #exit;<br>        }<br><br>        if(isflagset(5))<br>        {<br>                log(&quot;###################################  IF FLAG SET IS 5 ##################################&quot;);<br>
                # set branch flag -- when someone will call this user<br>                # the INVITE will have branch flag 6 set after lookup(&quot;location&quot;)<br>                setbflag(6);<br>                # if you want OPTIONS natpings uncomment next<br>
                # setbflag(7);<br>        }<br><br><br>        if (!save(&quot;location&quot;))<br>                sl_reply_error();<br><br>        exit;<br>}<br><br>route[3]<br>{<br>        log(&quot;################################ FUNCTION ROUTE 3 NAT DETECTION  ################################&quot;);<br>
<br>        force_rport();<br>        if (nat_uac_test(&quot;19&quot;)) {<br>                if (method==&quot;REGISTER&quot;) {<br>                        fix_nated_register();<br>                } else {<br>                        fix_nated_contact();<br>
                };<br>        setflag(5);<br>        };<br>}<br><br>route[4]<br>{<br>        log(&quot;################################ FUNCTION ROUTE 4 RTP PROXY  ################################&quot;);<br>        if (is_method(&quot;BYE&quot;)) {<br>
                unforce_rtp_proxy();<br>        } else if (is_method(&quot;INVITE&quot;)){<br>                force_rtp_proxy();<br>                #t_on_failure(&quot;2&quot;);<br>                t_on_failure(&quot;3&quot;);<br>
        };<br>        if (isflagset(5))<br>                search_append(&#39;Contact:.*sip:[^&gt;[:cntrl:]]*&#39;, &#39;;nat=yes&#39;);<br>        #t_on_reply(&quot;1&quot;);<br>        t_on_reply(&quot;3&quot;);<br>}<br>
<br><br><br>branch_route[2] {<br>        xlog(&quot;new branch at $ru\n&quot;);<br>}<br><br>onreply_route[2] {<br>        xlog(&quot;incoming reply\n&quot;);<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(&quot;################################ FAILURE ROUTE 3 FUNCTION  ################################&quot;);<br><br>        if (isbflagset(6) || isflagset(5)) {<br>
                unforce_rtp_proxy();<br>        }<br>}<br><br>onreply_route[3] {<br><br>        log(&quot;################################ ONREPLY ROUTE 3 FUNCTION  ################################&quot;);<br><br>        if ((isflagset(5) || isbflagset(6)) &amp;&amp; status=~&quot;(183)|(2[0-9][0-9])&quot;) {<br>
                force_rtp_proxy();<br>        }<br>        search_append(&#39;Contact:.*sip:[^&gt;[:cntrl:]]*&#39;, &#39;;nat=yes&#39;);<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>