Hi Ricky,<br>I think you should&nbsp; increase the mediaproxy natping interval to 30 and then add use_media_proxy() line after you setflag(6). check below:---<br><br>##Detect requests in the dialog behind NAT and flag with 6<br>
if(nat_uac_test(&quot;19&quot;) || search(&quot;^Route:.*;nat=yes&quot;)){<br>append_hf(&quot;P-hint: LR|fixcontact,setflag6\r\n&quot;);<br>fix_contact();<br>setbflag(6);<br><b><span style="color: rgb(51, 102, 255);">USE MEDIA PROXY HERE---&gt; use_media_proxy();</span><br style="color: rgb(51, 102, 255);">
</b><span style="color: rgb(0, 0, 0);">};</span><br>route(1);<br>} else {<br>sl_send_reply(&quot;404&quot;, &quot;Not here&quot;);<br>}<br>exit;<br>}<br><br><div class="gmail_quote">On Fri, Oct 31, 2008 at 5:21 AM, Ricky Gutierrez <span dir="ltr">&lt;<a href="mailto:xserverlinux@yahoo.com">xserverlinux@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: tahoma,new york,times,serif; font-size: 10pt;"><div><br></div>
<div style="font-family: tahoma,new york,times,serif; font-size: 10pt;">I show you here my openser.cfg<br><br>my best regards <br><br>rickygm<br><br><pre>loadmodule &quot;nathelper.so&quot;<br>loadmodule &quot;mediaproxy.so&quot;<br>
</pre><br><pre>modparam(&quot;registrar&quot;, &quot;received_avp&quot;, &quot;$avp(i:42)&quot;)<br>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,   2)<br>modparam(&quot;usrloc&quot;, &quot;nat_bflag&quot;, 4)<br></pre>
modparam(&quot;nathelper&quot;,&quot;rtpproxy_sock&quot;, &quot;&quot;)<br><pre>modparam(&quot;nathelper&quot;,&quot;natping_interval&quot;, 0)<br>modparam(&quot;nathelper&quot;,&quot;received_avp&quot;, &quot;$avp(i:42)&quot;)<br>
modparam(&quot;mediaproxy&quot;,&quot;natping_interval&quot;,20)<br>modparam(&quot;mediaproxy&quot;,&quot;mediaproxy_socket&quot;, &quot;/var/run/mediaproxy.sock&quot;)<br>modparam(&quot;mediaproxy&quot;, &quot;mediaproxy_socket&quot;, &quot;/var/run/proxydispatcher.sock&quot;)
 <div class="Ih2E3d"><br>modparam(&quot;mediaproxy&quot;,&quot;sip_asymmetrics&quot;,&quot;/etc/openser/sip-clients&quot;)<br>modparam(&quot;mediaproxy&quot;,&quot;rtp_asymmetrics&quot;,&quot;/ect/openser/rtp-clients&quot;)<br>
</div></pre><br><pre>route{<br># initial sanity checks -- messages with<br># max_forwards==0, or excessively long requests<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>                if (msg:len &gt;= 2048 ) {<br>                sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>                        exit;<br>                        };<br># we record-route all messages -- to make sure that<br># subsequent messages will go through our proxy; that&#39;s<br>
# particularly good if upstream and downstream entities<br># use different transport protocol<br>                if (!is_method(&quot;REGISTER&quot;)) { <br>                if(nat_uac_test(&quot;19&quot;)){<br>                        record_route(&quot;;nat=yes&quot;);<br>
                         } else {<br>                            record_route();<br>                        };<br>            };<br><br>                if (has_totag()) {<br># subsequent messages withing a dialog should take the<br># path determined by
 record-routing<br>                if (loose_route()) {<br>                        if(method==&quot;BYE&quot;) {<br>                            #Account BYE transactions<br>                            setflag(2);<br>                };<br>                if (method==&quot;INVITE&quot; &amp;&amp; (!allow_trusted())) {<br>                        if (!proxy_authorize(&quot;&quot;,&quot;subscriber&quot;)) {<br>
                        proxy_challenge(&quot;&quot;,&quot;0&quot;);<br>                                exit;<br>                        } else if (!check_from()) {<br>                                sl_send_reply(&quot;403&quot;, &quot;Forbidden, use From=ID&quot;);<br>                                exit;<br><br>                                };<br><br>                        };<br>                                if(method==&quot;BYE&quot; || method==&quot;CANCEL&quot;) {<br>
                            end_media_session();<br>                                };<br><br>        ##Detect requests in the dialog behind NAT and flag with 6<br>                            if(nat_uac_test(&quot;19&quot;) || search(&quot;^Route:.*;nat=yes&quot;)){<br>                        append_hf(&quot;P-hint: LR|fixcontact,setflag6\r\n&quot;);<br>
                                fix_contact();<br>                                        setbflag(6);<br>                    };            <br>                                route(1);<br>                                } else {<br>                                 sl_send_reply(&quot;404&quot;, &quot;Not here&quot;);<br>                        }<br>                                exit;<br>                        }<br>
        <br>                ##Loose_route packets<br>                    if
 (loose_route()) {<br>                                if(!has_totag()){<br>                    sl_send_reply(&quot;403&quot;, &quot;Initial Loose-Routing Rejected&quot;);<br>                    exit;<br>                };<br>        <br>        <br>        route(1);<br>
    };<br><br><br>                #CANCEL processing<br>                if (is_method(&quot;CANCEL&quot;)) {<br>                if (t_check_trans()) {<br>                end_media_session();<br>                t_relay();<br>                };<br>                exit;<br>                }<br>                        t_check_trans();<br><br>if (method==&quot;REGISTER&quot;){<br>
                        route(2);<br>                        } else {<br>                                route(3);<br>                                };<br>                        }<br><br>                route[1] {<br># send it out now; use stateful forwarding as it works reliably<br># even for UDP2TCP<br>                        t_on_reply(&quot;1&quot;);<br>                        t_on_failure(&quot;1&quot;);<br>
                        if (!t_relay()) {<br>;                        if (method==&quot;INVITE&quot; || method==&quot;ACK&quot;) {<br>;                         end_media_session();<br>;                };<br>                <br><br>#                        sl_reply_error();<br>                                };<br>                                exit;<br>                                }<br>        route[2] {<br>#<br># -- Register request handler --<br>
#<br>        if (is_uri_host_local()) {<br>        if (!www_authorize(&quot;&quot;, &quot;subscriber&quot;)) {<br>
        www_challenge(&quot;&quot;, &quot;0&quot;);<br>        exit;<br>        };<br>        if (!check_to()) {<br>                sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>                exit;<br>        };<br>         sl_send_reply(&quot;100&quot;, &quot;Trying&quot;);<br>
         if(!search(&quot;^Contact:[ ]*\*&quot;) &amp;&amp; client_nat_test(&quot;7&quot;)) {<br>            setbflag(6);<br>            fix_nated_register();<br>            force_rport();<br>        };<br><br>                save(&quot;location&quot;);<br>
                        exit;<br>        } else if {<br>                sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>                };<br>        }<br><br>        route[3] {<br>#<br># -- INVITE request handler --<br>#<br>                if (method==&quot;INVITE&quot;) {<br>        # Account INVITE packets<br>
                 setflag(2);<br>                  # Account Missed calls<br>          setflag(3);<br>};<br>                if (is_from_local()){<br># From an internal domain -&gt; check the credentials and the FROM<br>                if(!allow_trusted()){<br>                if (!proxy_authorize(&quot;&quot;,&quot;subscriber&quot;)) {<br>
                proxy_challenge(&quot;&quot;,&quot;0&quot;);<br>                exit;<br>                        } else if (!check_from()) {<br>                        sl_send_reply(&quot;403&quot;, &quot;Forbidden, use From=ID&quot;);<br>                exit;<br>
        };<br><br>};<br>            if (client_nat_test(&quot;3&quot;)) {<br>            append_hf(&quot;P-hint: route(3)|setflag7,forcerport,fix_contact\r\n&quot;);<br>            setbflag(7);<br>            force_rport();<br>            fix_contact();<br>
        };<br>                        <br>                if(avp_db_load(&quot;$ru/username&quot;,&quot;$avp(s:callfwd)&quot;)) {<br>                avp_pushto(&quot;$ru&quot;, &quot;$avp(s:callfwd)&quot;);<br>                route(4);<br>                route(1);<br>                <br>                        exit;<br>                                }<br><br>
consume_credentials();<br><br>                # Verify aliases<br>                        lookup(&quot;aliases&quot;);<br>                if (is_uri_host_local()) {<br>        # -- Inbound to Inbound<br><br>                route(10);<br>                        } else {<br># -- Inbound to outbound<br>                route(11);<br>
                };<br><br>        } else {<br># From an external domain -&gt; do not check credentials<br>#Verify aliases, if found replace R-URI.<br>                        lookup(&quot;aliases&quot;);<br>                                if (is_uri_host_local()) {<br>                #-- Outbound to inbound<br>
                        route(12);<br>                                } else {<br>        # -- Outbound to outbound<br>                                route(13);<br>                                        };<br>                                };<br>                        }<br>        route[6] {<br>   
 #<br>    # -- NAT handling --<br>    #<br>    if (isbflagset(6) || isbflagset(7)) {<br>        append_hf(&quot;P-hint: Route[6]: mediaproxy \r\n&quot;);<br>        use_media_proxy();<br>    };<br>}<br><br>                route[10] {<br>
                #from an internal domain -&gt; inbound<br>        #Native SIP destinations are handled using the location table<br>        append_hf(&quot;P-hint: inbound-&gt;inbound \r\n&quot;);<br>        if (uri=~&quot;^sip:[2346578][0-9]{6}@.*&quot;) {<br>
         if (is_user_in(&quot;credentials&quot;, &quot;local&quot;)){        <br>#        rewritehostport(&quot;<a href="http://192.168.10.1:5070" target="_blank">192.168.10.1:5070</a>&quot;);<br>        route(6);<br>        route(4);<br>        exit;<br>        } else { <br>
                sl_send_reply(&quot;403&quot;, &quot;No tienes permiso para llamadas locales&quot;);<br>                exit;<br>                        };<br>                                };<br><br>if (!lookup(&quot;location&quot;)) {<br>                if (does_uri_exist()) {<br>                revert_uri();<br>                prefix(&quot;u&quot;);<br>
                rewritehostport(&quot;<a href="http://192.168.10.1:5070" target="_blank">192.168.10.1:5070</a>&quot;);<br>                route(6);<br>                route(1);<br>                } else {<br>                sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>        exit;<br>
        };<br>                sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>                exit;<br>                };        <br>
        <br>                route(6);        <br>                route(1);<br>        }<br><br>        route[11] {<br># from an internal domain -&gt; outbound<br># Simply route the call outbound using DNS search<br>        append_hf(&quot;P-hint: inbound-&gt;outbound \r\n&quot;);<br>
        route(1);<br>        }<br>        route[12] {<br># From an external domain -&gt; inbound<br># Verify aliases, if found replace R-URI.<br>        lookup(&quot;aliases&quot;);<br>        if (!lookup(&quot;location&quot;)) {<br>        sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>
        exit;<br>        };<br>        route(1);<br>        }<br>        route[13] {<br>#From an external domain outbound<br>#we are not accepting these calls<br>        append_hf(&quot;P-hint: outbound-&gt;inbound \r\n&quot;);<br>        sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>
        exit;<br>        }<br><br>        <br>        route[4] {<br>        rewritehostport(&quot;<a href="http://192.168.10.1:5070" target="_blank">192.168.10.1:5070</a>&quot;);<br>        route(1);<br><br>}<br><br>### aqui se detecta cunado una llamada es no disponible , ocupada o falla<br>
failure_route[1] {<br>        if (t_was_cancelled()) {<br>        exit;<br>};<br><br>        if (t_check_status(&quot;486&quot;)) {<br>        revert_uri();<br>
        prefix(&quot;b&quot;);<br>        xlog(&quot;L_ERR&quot;,&quot;Stepped into the 486 ruri=&lt;$ru&gt;&quot;);<br>        rewritehostport(&quot;<a href="http://192.168.10.1:5070" target="_blank">192.168.10.1:5070</a>&quot;);<br>        append_branch();<br>
        route(1);<br>        exit;<br>};<br>        if (t_check_status(&quot;408&quot;) || t_check_status(&quot;480&quot;)) {<br>        revert_uri();<br>        prefix(&quot;u&quot;);<br>        xlog(&quot;L_ERR&quot;,&quot;Stepped into the 480 ruri=&lt;$ru&gt;&quot;);<br>
        rewritehostport(&quot;<a href="http://192.168.10.1:5070" target="_blank">192.168.10.1:5070</a>&quot;);<br>        append_branch();<br>        route(1);<br>        exit;<br>};<br>}<br>onreply_route[1] {<br>        #<br>        #-- On-replay block routing --<br>
        #<br>        if (client_nat_test(&quot;1&quot;)) {<br>                append_hf(&quot;P-hint: Onreply-route - fixcontact \r\n&quot;);<br>                fix_nated_contact();<br>        };<br><br>        if ((isbflagset(6) || isbflagset(7)) &amp;&amp; (status=~&quot;(180)|(183)|2[0-9][0-9]&quot;)) {<br>
                 if (search(&quot;^Content-Type:[ ]*application/sdp&quot;)) {<br>             append_hf(&quot;P-hint: onreply_route|usemediaproxy \r\n&quot;);<br>               use_media_proxy();<br>           };<br>       };<br>      
 exit;<br>}<br><br><br><br><br></pre><br></div></div><br>



      </div></blockquote></div><br><br clear="all"><br>-- <br>Luzango Mfupe<br>TUUNE MOBILE<br>Tel:0128440528/0123825710<br>Tshwane-RSA<br><br>&quot;...Ships are safe in harbor, but they were never meant to stay there.......&quot;<br>