<div dir="ltr">You should not change the kamailio.cfg for nat=yes param, that works the way it is. Yes you're right changing the NAT param in asterisk won't change anything. <div><br></div><div>Please enable sip debug on asterisk and paste the complete INVITE/200OK packets for the established call with no audio.</div>
<div><br></div><div>--</div><div>Sammy</div><div><br></div><div><br></div><div><br><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 6, 2013 at 3: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><div>It seems I am undesrtand whereis problem can be found.<br></div>Original tutorial of Kamailio+Asterisk realtime integration (by Asipto) containse settings for cheking if the "nat=yes" presents, but in Asterisk 11 I am using nat=force_rport,comedia.<div class="im">
<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>    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><br></div></div>BTW, we don't need NAT for asterisks peers, if we use Asterisk behinde Kanailio LAN interface (2.2.2.2).<br>

<br>  ToHost       : 2.2.2.2<br></div><div>  Addr->IP     : <a href="http://2.2.2.2:5060" target="_blank">2.2.2.2:5060</a><br><br></div><div>If I cahnge to nat=no in the NATMANAGE - RTP debug still showing from 1.1.1.1 (public) kamailio IP.<br>

</div><div>Rtpproxy started in the bridge mode.<br><br>set_destination: Parsing <sip:2.2.2.2;r2=on;lr=on;nat=no> for address/port to send to<br>set_destination: set destination to <a href="http://2.2.2.2:5060" target="_blank">2.2.2.2:5060</a><br>

Reliably Transmitting (no NAT) to <a href="http://2.2.2.2:5060" target="_blank">2.2.2.2:5060</a>:<br>BYE sip:1-101@PUBLIC.CLIENT.PEER.IP:17303;ob SIP/2.0<br>Via: SIP/2.0/UDP 2.2.2.101:5080;branch=z9hG4bK1597848e<br>Route: <sip:2.2.2.2;r2=on;lr=on;nat=no>,<sip:1.1.1.1;r2=on;lr=on;nat=no><br>

<br>Sent RTP packet to      <a href="http://1.1.1.1:63232" target="_blank">1.1.1.1:63232</a> (type 00, seq 003837, ts 016800, len 000160)<br>Got  RTP packet from    <a href="http://2.2.2.2:42346" target="_blank">2.2.2.2:42346</a> (type 00, seq 000986, ts 016960, len 000160)<br>

Sent RTP packet to      <a href="http://1.1.1.1:63232" target="_blank">1.1.1.1:63232</a> (type 00, seq 003838, ts 016960, len 000160)<br>Got  RTP packet from    <a href="http://2.2.2.2:42346" target="_blank">2.2.2.2:42346</a> (type 00, seq 000987, ts 017120, len 000160)<br>

Sent RTP packet to      <a href="http://1.1.1.1:63232" target="_blank">1.1.1.1:63232</a> (type 00, seq 003839, ts 017120, len 000160)<br><br></div><div>But no voicing) <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">Dear Alexandr,<div><br></div><div>You can connect Kamailio to RTPproxy via socket as well, use modparam like this:</div><div><br></div>modparam("rtpproxy", "rtpproxy_sock", "udp:<a href="http://127.0.0.1:12221" target="_blank">127.0.0.1:12221</a>")<div>


<br></div><div>Then if your rtprpoxy is started in bridged mode you should use the "i" and "e" flags while you call the rtpproxy-manage() function in the kamailio.cfg file.</div><div><br></div><div>The placement of both the flags sets the SDP c= param , so if you use "ie" combination of flag then that is not equal to "ei" combination of the flag.</div>


<div><br></div><div>I also suggest that you turn on sip debug on the call receiving asterisk and observe the SDP for an incoming call from Kamailio. that will help you figure out the situation in SDP.</div><div><br></div>


<div>Best Regards,</div><div>Sammy</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 6, 2013 at 2:02 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><div>Thank you for response!<br>A little difficult for me to find the same logic in my case with tutorial of ipv4/ipv6 bridgin...<br>


<br></div>When I started <br></div><div>/usr/sbin/rtpproxy -u kamailio -l <a href="http://1.1.1.1/2.2.2.2" target="_blank">1.1.1.1/2.2.2.2</a> -s udp:127.0.0.1 12221<br>
<br>There is no sound.<br></div><br></div>Is this a major to connect via unix sock?:<br><br>modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy/rtpproxy.sock")<div><div>
<br><div class="gmail_extra">
<br><br><br><br><div class="gmail_quote">2013/8/6 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    you have to use rtpproxy in bridge mode, to route packets between
    the two local network interfaces. There are many examples out there,
    one shows even how to bridge between ipv4 and ipv4 networks -- you
    can use it as reference:<br>
    <br>
    - <a href="http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6" target="_blank">http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6</a><br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div>On 8/5/13 7:12 PM, Alexandr Usov wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div><br>
          <br>
          I have Kamailio on OpenSUSE with static real Public IP (WAN),
          for ex. 1.1.1.1. I have LAN IP 2.2.2.2. Asterisk as KVM
          virtual machine with LAN IP 2.2.2.101 and default GW not the
          SuSe (2.2.2.2), but 2.2.2.1 pfsense LAN with PUB IP 1.1.1.2) I
          am configured Registration of UA on Kamailio DB, and on
          Asterisk side create a static peers with Kamailio LAN ip
          (host=2.2.2.2).<br>
          <br>
          RTP Proxy question.<br>
          <br>
          /usr/sbin/rtpproxy -u daemon -l 1.1.1.1 -s <a>udp:127.0.0.1</a> 12221<br>
          <br>
        </div>
        .... kamailio.cfg ...<br>
        <div><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>
              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>
          <br>
          Testing call:<br>
          <br>
          Whe User 1-100 calling User 1-101, on Asterisk side I see:<br>
          <br>
              -- Called SIP/<a href="mailto:1-100@sip1.somedomain.com.ua" target="_blank">1-100@sip1.somedomain.com.ua</a><br>
              -- SIP/sip1.somedomain.com.ua-000004cf is ringing<br>
              -- SIP/sip1.somedomain.com.ua-000004cf answered
          SIP/1-101-000004ce<br>
                 > 0x15bc370 -- Probation passed - setting RTP source
          address to <a href="http://1.1.1.1:50868" target="_blank">1.1.1.1:50868</a><br>
                 > 0x7f2b6044bd10 -- Probation passed - setting RTP
          source address to <a href="http://1.1.1.1:35082" target="_blank">1.1.1.1:35082</a><br>
               <br>
          Got  RTP packet from    <a href="http://1.1.1.1:50868" target="_blank">1.1.1.1:50868</a> (type 00, seq
          027109, ts 000160, len 000160)<br>
          Sent RTP packet to      <a href="http://1.1.1.1:35082" target="_blank">1.1.1.1:35082</a> (type 00, seq
          037469, ts 000160, len 000160)<br>
          Got  RTP packet from    <a href="http://1.1.1.1:50868" target="_blank">1.1.1.1:50868</a> (type 00, seq
          027110, ts 000320, len 000160)<br>
          Sent RTP packet to      <a href="http://1.1.1.1:35082" target="_blank">1.1.1.1:35082</a> (type 00, seq
          037470, ts 000320, len 000160)<br>
          Got  RTP packet from    <a href="http://1.1.1.1:50868" target="_blank">1.1.1.1:50868</a> (type 00, seq
          027111, ts 000480, len 000160)<br>
          Sent RTP packet to      <a href="http://1.1.1.1:35082" target="_blank">1.1.1.1:35082</a> (type 00, seq
          037471, ts 000480, len 000160)<br>
          Got  RTP packet from    <a href="http://1.1.1.1:50868" target="_blank">1.1.1.1:50868</a> (type 00, seq
          027112, ts 000640, len 000160)<br>
          Sent RTP packet to      <a href="http://1.1.1.1:35082" target="_blank">1.1.1.1:35082</a> (type 00, seq
          037472, ts 000640, len 000160)<br>
          <br>
          <br>
          Voice transfers OK.<br>
          <br>
          But why not Kamailio LAN ip I receiving on the Asterisk side
          with the same LAN?<br>
          <br>
          And Kamailio log grep:<br>
          <br>
          skynet:~ # tail -f /var/log/messages | grep rtpproxy<br>
          2013-08-05T19:18:17.508760+03:00 skynet kamailio[25462]:
          3(25481) DEBUG: rtpproxy [rtpproxy_funcs.c:148]:
          check_content_type(): type <application/sdp> found valid<br>
          2013-08-05T19:18:17.508875+03:00 skynet kamailio[25462]:
          3(25481) DEBUG: rtpproxy [rtpproxy.c:2624]: force_rtp_proxy():
          proxy reply: 63566 1.1.1.1<br>
          2013-08-05T19:18:17.530765+03:00 skynet kamailio[25462]:
          6(25484) DEBUG: rtpproxy [rtpproxy_funcs.c:148]:
          check_content_type(): type <application/sdp> found valid<br>
          2013-08-05T19:18:17.530876+03:00 skynet kamailio[25462]:
          6(25484) DEBUG: rtpproxy [rtpproxy.c:2624]: force_rtp_proxy():
          proxy reply: 41958 1.1.1.1<br>
          2013-08-05T19:18:18.625815+03:00 skynet kamailio[25462]:
          4(25482) DEBUG: rtpproxy [rtpproxy_funcs.c:148]:
          check_content_type(): type <application/sdp> found valid<br>
          2013-08-05T19:18:18.627131+03:00 skynet kamailio[25462]:
          4(25482) DEBUG: rtpproxy [rtpproxy.c:2624]: force_rtp_proxy():
          proxy reply: 39876 1.1.1.1<br>
          2013-08-05T19:18:18.632649+03:00 skynet kamailio[25462]:
          a=nortpproxy:yes<br>
          2013-08-05T19:18:18.648075+03:00 skynet kamailio[25462]:
          6(25484) DEBUG: rtpproxy [rtpproxy_funcs.c:148]:
          check_content_type(): type <application/sdp> found valid<br>
          2013-08-05T19:18:18.649615+03:00 skynet kamailio[25462]:
          6(25484) DEBUG: rtpproxy [rtpproxy.c:2624]: force_rtp_proxy():
          proxy reply: 43500 1.1.1.1<br>
          2013-08-05T19:18:18.653948+03:00 skynet kamailio[25462]:
          a=nortpproxy:yes<br>
          2013-08-05T19:18:18.688603+03:00 skynet kamailio[25462]:
          4(25482) DEBUG: rtpproxy [rtpproxy_funcs.c:148]:
          check_content_type(): type <application/sdp> found valid<br>
          2013-08-05T19:18:18.689762+03:00 skynet kamailio[25462]:
          4(25482) DEBUG: rtpproxy [rtpproxy.c:2624]: force_rtp_proxy():
          proxy reply: 63566 1.1.1.1<br>
          2013-08-05T19:18:18.701062+03:00 skynet kamailio[25462]:
          6(25484) DEBUG: rtpproxy [rtpproxy_funcs.c:148]:
          check_content_type(): type <application/sdp> found valid<br>
          2013-08-05T19:18:18.701405+03:00 skynet kamailio[25462]:
          6(25484) DEBUG: rtpproxy [rtpproxy.c:2624]: force_rtp_proxy():
          proxy reply: 43500 1.1.1.1<br>
          2013-08-05T19:18:18.705506+03:00 skynet kamailio[25462]:
          a=nortpproxy:yes<br>
          <br>
        </div>
        <div>My goal is using Asterisk boxes behind Kamailio with the
          same LAN or even OpeVPN Lan2Lan, with Public IP on Kamailio
          WAN for users registration and RTP routing. So is strange to
          my, why RTPproxy not rewrite source of RTP traffic from PUBLIC
          Kamailio IP to LAN Kamailio IP when user A calls B via
          Asterisk?<br>
          <br>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<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><span><font color="#888888">
</font></span></pre><span><font color="#888888">
    </font></span></blockquote><span><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
</pre>
  </font></span></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></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>