<div dir="ltr">Ok thanks,<div><br></div><div>All fine except the rtpproxy_manage function is just out in the open and since you're in bridging mode you need to realize that your kamailio may receive calls from the WAN Interface or from the Asterisks on LAN interface. So if you're to bridge the RTPs at the proxy then how can Kamailio detect that which combination of flags to use in rtpproxy_manage() function?</div>
<div><br></div><div>As an example if you replace your <span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">  rtpproxy_manage(); with </span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">  rtpproxy_manage("ei"); and make a call from SIP user to 777 in asterisk dialplan where 777 is echo()</span></div>
<div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">exten => 777,1,Answer()</span></div><div>
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">same => n,Echo()</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font color="#500050" face="arial, sans-serif">Take a sip trace now and see that you get the desired LAN IP of kamailio coming in on Asterisk ? revert the "ei" to "ie" if not. </font></div>
<div><font color="#500050" face="arial, sans-serif">This simple test should get you a two way audio established for any call from Internet to the Asterisk via Kamailio.</font></div><div><font color="#500050" face="arial, sans-serif"><br>
</font></div><div><font color="#500050" face="arial, sans-serif">The Next step is to figure out that your call is coming from Asterisk and wants to go out from kamailio's WAN interface. use inverse flag combination here and let the call go out. </font></div>
<div><font color="#500050" face="arial, sans-serif"><br></font></div><div><font color="#500050" face="arial, sans-serif">I hope it works for you now.</font></div><div><font color="#500050" face="arial, sans-serif"><br></font></div>
<div><font color="#500050" face="arial, sans-serif">--</font></div><div><font color="#500050" face="arial, sans-serif">Sammy</font></div><div><font color="#500050" face="arial, sans-serif"><br></font></div><div><font color="#500050" face="arial, sans-serif"><br>
</font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 6, 2013 at 4:06 AM, Alexandr Usov <span dir="ltr"><<a href="mailto:blessendor@gmail.com" target="_blank">blessendor@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>ps -ef | grep rtpproxy<br>kamailio 15853     1  0 12:41 ?        00:00:01 /usr/sbin/rtpproxy -u kamailio -l 1.1.1.1 2.2.2.2 -s unix:/var/run/rtpproxy.sock<br>
<br>netstat -pln|grep rtpproxy<br>unix  2      [ ACC ]     STREAM     LISTENING     238561268 15853/rtpproxy      /var/run/rtpproxy.sock<br>
<br></div><div>I'm trying  rtpproxy_manage("ei");  rtpproxy_manage("ie");  rtpproxy_manage(); - the same if rtpproxy in bridged mode.<br><br></div><div>Config cuts:<br></div><div><br><br></div><div>

<br>#!define WITH_NAT<br>...<br>#!ifdef WITH_NAT<br># ----- rtpproxy params -----<br># modparam("rtpproxy", "rtpproxy_sock", "udp:<a href="http://127.0.0.1:12221" target="_blank">127.0.0.1:12221</a>")<br>
modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")<br>
<br># ----- nathelper params -----<br>modparam("nathelper", "natping_interval", 30)<br>modparam("nathelper", "ping_nated_only", 1)<br>modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)<br>

modparam("nathelper", "sipping_from", "<a href="mailto:sip%3Apinger@sip.myrealhostdomain.com" target="_blank">sip:pinger@sip.myrealhostdomain.com</a>")<br> <br># params needed for NAT traversal in other modules<br>

modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")<br>modparam("usrloc", "nat_bflag", FLB_NATB)<br>#!endif<br><br><br>....<br><br># Handle SIP registrations<br>

route[REGISTRAR] {<br>    if (is_method("REGISTER"))<br>    {<br>        if(isflagset(FLT_NATS))<br>        {<br>            setbflag(FLB_NATB);<br>            # uncomment next line to do SIP NAT pinging <br>            setbflag(FLB_NATSIPPING);<br>

        }<br>        if (!save("location"))<br>            sl_reply_error();<br> <br>        exit;<br>    }<br>}<br></div><br></div>...<br><br># Caller NAT detection route<br>route[NATDETECT] {<br>#!ifdef WITH_NAT<br>

    force_rport();<br>    if (nat_uac_test("19")) {<br>        if (is_method("REGISTER")) {<br>            fix_nated_register();<br>        } else {<br>            fix_nated_contact();<br>        }<br>

        setflag(FLT_NATS);<br>    }<br>#!endif<br>    return;<div class="im"><br>}<br> <br># RTPProxy control<br>route[NATMANAGE] {<br>#!ifdef WITH_NAT<br>    if (is_request()) {<br>        if(has_totag()) {<br>            if(check_route_param("nat=yes")) {<br>

                setbflag(FLB_NATB);<br><br>            }<br>        }<br>    }<br>    if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))<br>        return;<br> <br>        rtpproxy_manage();<br> <br>    if (is_request()) {<br>

        if (!has_totag()) {<br>            add_rr_param(";nat=yes");<br>        }<br>    }<br>    if (is_reply()) {<br>        if(isbflagset(FLB_NATB)) {<br>            fix_nated_contact();<br>        }<br>    }<br>

#!endif<br>    return;<br>}<br><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/6 SamyGo <span dir="ltr"><<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Please check the rtpproxy function and paste the way it is written in your configuration file. Share the output of "ps -ef | grep rtpproxy" and "netstat -pln|grep rtpproxy"<div>

<br></div>
<div>--</div><div>Sammy</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 6, 2013 at 3:55 AM, Alexandr Usov <span dir="ltr"><<a href="mailto:blessendor@gmail.com" target="_blank">blessendor@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div dir="ltr"><div>Note:<br></div>Asrterisk LAN IP real 192.168.144.101
 but must be 2.2.2.101 in this described network  (I am missed to change
 before copy-pasting here).<br><br><br></div><br><br></div></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>