<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <tt>Hi Nick,<br>
      <br>
      So, your opensips should do the NAT traversal for the signaling
      (fix_nated_contact() stuff), but it should not do anything in
      regards to media (rtpproxy) if caller and callee are behind the
      same NAT - how to test that ? after lookup(location), when you
      know the destination IP of the callee, you can simply check if SRC
      IP of the call is the same with the destination IP - if so, it
      means caller and callee are behind the same NAT.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <br>
    On 03/18/2013 04:20 PM, Nick wrote:
    <blockquote
cite="mid:CAEo0eY=tPZzZ4sk-UYm1LnKgRGXdPUt1Ws6XvW2omx0zHGHkvA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello
        <div><br>
        </div>
        <div style="">I checked it. It don't to go to the
          route[nat_fixups]. </div>
        <div style="">But My UACs both behind the same NAT.</div>
        <div style=""><br>
        </div>
        <div style="">How to check why not go to the route[nat_fixups]??</div>
        <div style=""><br>
        </div>
        <div style="">Thanks</div>
        <div style="">Nick</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2013/3/18 Nick Khamis <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:symack@gmail.com"
              target="_blank">symack@gmail.com</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">It will change it if fired. Make sure
            that you get to<br>
            "route[nat_fixups]" for the call. And for testing, try
            removing the<br>
            flags" (isflagset(5) || isbflagset(6))" etc... xlog("Why me
            god:<br>
            $ru\n") always seems to have mercy on our souls. ;)<br>
            <span class="HOEnZb"><font color="#888888"><br>
                <br>
                Nick.<br>
              </font></span>
            <div class="HOEnZb">
              <div class="h5"><br>
                On 3/18/13, Nick &lt;<a moz-do-not-send="true"
                  href="mailto:nick.chang@kland.com.tw">nick.chang@kland.com.tw</a>&gt;
                wrote:<br>
                &gt; Hello<br>
                &gt;<br>
                &gt; I modify my config.<br>
                &gt;<br>
                &gt; route[nat_fixups] {<br>
                &gt; xlog("L_NOTICE","4 NAT FIXED - $fu call $ru ");<br>
                &gt;         #---- RTP Proxy handling ---#<br>
                &gt;         if (is_method("BYE|CANCEL")) {<br>
                &gt;                 unforce_rtp_proxy();<br>
                &gt;         } else if (is_method("INVITE")){<br>
                &gt;                 #---- Activates the RTP Proxy for
                the CALLEE ---#<br>
                &gt;                 rtpproxy_offer("c","61.67.128.46");<br>
                &gt;         };<br>
                &gt;         # catch and fix replies<br>
                &gt;         t_on_reply("2");<br>
                &gt; }<br>
                &gt;<br>
                &gt; onreply_route[2] {<br>
                &gt;         #xlog("incoming reply\n");<br>
                &gt;<br>
                &gt;         #---- Handling of the SDP for the 200 or
                183 reply ----#<br>
                &gt;         #---- If behind nat (flags 5 or 6) start
                RTP Proxy ----#<br>
                &gt;         #----    Activates the RTP Proxy for the
                CALLER    ----#<br>
                &gt;         if ( is_method("INVITE") &amp;&amp;<br>
                &gt;         (isflagset(5) || isbflagset(6)) &amp;&amp;<br>
                &gt;         has_body("application/sdp") ){<br>
                &gt;                
                rtpproxy_answer("c","61.67.128.46");<br>
                &gt;         }<br>
                &gt;<br>
                &gt;         #---- If the CALLEE is behind NAT, fix the
                CONTACT HF ----#<br>
                &gt;         if (isbflagset(6)) {<br>
                &gt;                 fix_nated_contact();<br>
                &gt;                
                search_append('Contact:.*sip:[^&gt;[:cntrl:]]*',
                ';nat=yes');<br>
                &gt;         }<br>
                &gt;         exit;<br>
                &gt; }<br>
                &gt;<br>
                &gt; Then, I used ngrep get packet.<br>
                &gt;<br>
                &gt; Connection Information still not Opensips SERVER of
                IP.<br>
                &gt; It's not change to my setting.<br>
                &gt;<br>
                &gt; Do you have any suggestion??<br>
                &gt;<br>
                &gt; Thanks<br>
                &gt; Nick<br>
                &gt;<br>
                &gt;<br>
                &gt;<br>
                &gt; 2013/3/15 Nick Khamis &lt;<a moz-do-not-send="true"
                  href="mailto:symack@gmail.com">symack@gmail.com</a>&gt;<br>
                &gt;<br>
                &gt;&gt; Hello Nick,<br>
                &gt;&gt;<br>
                &gt;&gt; As Bogdan pointed out please look at the
                important parts of your SDP<br>
                &gt;&gt; payload:<br>
                &gt;&gt;<br>
                &gt;&gt; <a moz-do-not-send="true"
                  href="http://sip:55688@61.67.128.46:5060"
                  target="_blank">sip:55688@61.67.128.46:5060</a><br>
                &gt;&gt; Contact: &lt;<a moz-do-not-send="true"
                  href="http://sip:55688@211.75.166.164:5060"
                  target="_blank">sip:55688@211.75.166.164:5060</a>&gt;<br>
                &gt;&gt; c=IN IP4 211.75.166.164<br>
                &gt;&gt;<br>
                &gt;&gt; <a moz-do-not-send="true"
                  href="mailto:sip%3A9999@61.67.128.46">sip:9999@61.67.128.46</a><br>
                &gt;&gt; Contact: &lt;<a moz-do-not-send="true"
                  href="http://sip:9999@192.168.4.197:5060"
                  target="_blank">sip:9999@192.168.4.197:5060</a>&gt;<br>
                &gt;&gt; c=IN IP4 192.168.4.197<br>
                &gt;&gt;<br>
                &gt;&gt; Kind Regards,<br>
                &gt;&gt;<br>
                &gt;&gt; Nick.<br>
                &gt;&gt;<br>
                &gt;&gt; On 3/15/13, Bogdan-Andrei Iancu &lt;<a
                  moz-do-not-send="true"
                  href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>&gt;
                wrote:<br>
                &gt;&gt; &gt; Hi Nick,<br>
                &gt;&gt; &gt;<br>
                &gt;&gt; &gt; But in the SDP-s received by the UACs, in
                the "c" line, you see the IP<br>
                &gt;&gt; &gt; of the other UAC and not the IP of
                OpenSIPS, right ?<br>
                &gt;&gt; &gt;<br>
                &gt;&gt; &gt; Regards,<br>
                &gt;&gt; &gt;<br>
                &gt;&gt; &gt; Bogdan-Andrei Iancu<br>
                &gt;&gt; &gt; OpenSIPS Founder and Developer<br>
                &gt;&gt; &gt; <a moz-do-not-send="true"
                  href="http://www.opensips-solutions.com"
                  target="_blank">http://www.opensips-solutions.com</a><br>
                &gt;&gt; &gt;<br>
                &gt;&gt; &gt;<br>
                &gt;&gt; &gt; On 03/15/2013 03:28 AM, Nick Chang wrote:<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Hello Bodgan<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; 2 UACs behind the same nat, I check my
                routing.<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; UAC don't route to nat_fixups.<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; But UACs checked My OpenSIPS private
                IP (10.10.12.111), Not Public IP.<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; I don't know why? Do you have any
                suggestion??<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; My Config<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; route[generic_relay] {<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; xlog("L_NOTICE","3 invite $si");<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         # for INVITEs enable some
                additional helper routes<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         #---- Helper route, if nat=yes
                in the R-URI  set flag 6 ----#<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         #----        This is used to
                Process REINVITES          ----#<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         if
                (subst_uri('/((<a class="moz-txt-link-freetext" href="sip:.*">sip:.*</a>)||(<a class="moz-txt-link-freetext" href="sip:.*:.*">sip:.*:.*</a>));nat=yes/\1/')){<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;                 setbflag(6);<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         };<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         #---- If caller(flag 5) or
                callee(flag 6) are behind NAT  ---#<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         #---- Call the route(6) to
                force the use of the RTP Proxy ---#<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         if (isflagset(5) ||
                isbflagset(6)) {<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;                 route(nat_fixups);<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         };<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         if (!t_relay()) {<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;                 sl_reply_error();<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         };<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         exit;<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; }<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; route[nat_fixups] {<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; xlog("L_NOTICE","4 NAT FIXED - $fu
                call $ru ");<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         #---- RTP Proxy handling ---#<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         if (is_method("BYE|CANCEL")) {<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;                 unforce_rtp_proxy();<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         } else if
                (is_method("INVITE")){<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;                 #---- Activates the
                RTP Proxy for the CALLEE ---#<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;                 rtpproxy_offer();<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         };<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         # catch and fix replies<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;         t_on_reply("2");<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; }<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Thanks<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Nick<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; *From:*Bogdan-Andrei Iancu [mailto:<a
                  moz-do-not-send="true"
                  href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>]<br>
                &gt;&gt; &gt;&gt; *Sent:* Friday, March 15, 2013 12:32
                AM<br>
                &gt;&gt; &gt;&gt; *To:* OpenSIPS users mailling list<br>
                &gt;&gt; &gt;&gt; *Cc:* Nick Chang<br>
                &gt;&gt; &gt;&gt; *Subject:* Re: [OpenSIPS-Users] two
                UACs behind the same nat<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Hi Nick,<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Assuming routing is possible between
                the 2 UACs, you need to double<br>
                &gt;&gt; &gt;&gt; check that the IPs in SDP are not
                changed by proxy and points to the<br>
                &gt;&gt; &gt;&gt; actual UACs.<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Regards,<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Bogdan-Andrei Iancu<br>
                &gt;&gt; &gt;&gt; OpenSIPS Founder and Developer<br>
                &gt;&gt; &gt;&gt; <a moz-do-not-send="true"
                  href="http://www.opensips-solutions.com"
                  target="_blank">http://www.opensips-solutions.com</a><br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; On 03/11/2013 11:40 AM, Nick Chang
                wrote:<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Hello<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; I have two UACs behind the same nat.<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; A call B is OK. But it's not voice.<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Can everyone give me a suggestion??<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Thanks<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt; Nick<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;<br>
                &gt;&gt; &gt;&gt;
                _______________________________________________<br>
                &gt;&gt; &gt;&gt; Users mailing list<br>
                &gt;&gt; &gt;&gt; <a moz-do-not-send="true"
                  href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
                 &lt;mailto:<a moz-do-not-send="true"
                  href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&gt;<br>
                &gt;&gt; &gt;&gt; <a moz-do-not-send="true"
                  href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                  target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                &gt;&gt; &gt;<br>
                &gt;&gt;<br>
                &gt;&gt; _______________________________________________<br>
                &gt;&gt; Users mailing list<br>
                &gt;&gt; <a moz-do-not-send="true"
                  href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
                &gt;&gt; <a moz-do-not-send="true"
                  href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                  target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                &gt;&gt;<br>
                &gt;<br>
                <br>
                _______________________________________________<br>
                Users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                  target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>