<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    can you split your checks from nat_uac_test("23") to individual
    checks (like nat_uac_test("1"), nat_uac_test("2"), ...) and see
    which one fails?<br>
    <br>
    Via parameter 'received' contains (always, as per spec) only the IP
    address, rport is for received port. Perhaps adding [] would not
    harm, but otherwise should be ok now.<br>
    <br>
    For path module, I pushed a patch. Maybe you can test and report the
    results for it.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 23/01/15 12:12, Sebastian Damm
      wrote:<br>
    </div>
    <blockquote
cite="mid:CABkWSFzcDsk43DDAPMnazgbBH2B5-hxx6BytsapzTRxxgLRZjg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>Hi,<br>
                        <br>
                      </div>
                      it looks to me that Kamailio detects NAT without
                      NAT being there, when used in IPv6 scenarios.<br>
                      <br>
                    </div>
                    I have a register, which comes in like this:<br>
                    <br>
                    U 2015/01/23 11:42:31.013284
                    2a01:1234:123:1234::2:16732 ->
                    2001:9876:98:9876::aa01:5060<br>
                    REGISTER <a class="moz-txt-link-freetext" href="sip:domain">sip:domain</a> SIP/2.0<br>
                    Via: SIP/2.0/UDP
                    [2a01:1234:123:1234::2]:16732;branch=z9hG4bK45528eba<br>
                    <br>
                  </div>
                  After it has run through Kamailio, the packet is sent
                  out like this:<br>
                  <br>
                  U 2015/01/23 11:42:31.015126 <a
                    moz-do-not-send="true" href="http://1.2.3.4:5060">1.2.3.4:5060</a>
                  -> <a moz-do-not-send="true"
                    href="http://9.8.7.6:5060">9.8.7.6:5060</a><br>
                  REGISTER <a class="moz-txt-link-freetext" href="sip:domain">sip:domain</a> SIP/2.0<br>
                  Via: SIP/2.0/UDP
                  1.2.3.4;branch=z9hG4bK8d21.7fa5fb060c2acc9583f05a93b93f9873.0<br>
                  Via: SIP/2.0/UDP
[2a01:1234:123:1234::2]:16732;received=2A01:1234:123:1234:0:0:0:2;branch=z9hG4bK45528eba<br>
                  <br>
                </div>
                As far as I know, the received part should only get
                appended, if the source IP of the packet differs from
                the IP advertised in the topmost Via header. But to me
                it looks like it always gets appended. In just IPv4
                scenarios, the received parameter only gets appended if
                a difference is detected.<br>
                <br>
              </div>
              <div>And if it gets appended, shouldn't the received
                parameter IP be in square brackets, too?<br>
              </div>
              <div><br>
                <br>
              </div>
              Later on, we have something like this in our code:<br>
              <br>
                              if(method=="REGISTER") {<br>
              <br>
                                      if (nat_uac_test("23")) {<br>
              <br>
                                              append_hf("X-nathint:
              nat\r\n");<br>
                                              force_rport();<br>
              <br>
                                              if (!add_path_received())
              {<br>
                                                     
              sl_send_reply("503", "Internal Path Error");<br>
                                              };<br>
                                      } else {<br>
                                              if (!add_path()) {<br>
                                                     
              sl_send_reply("503", "Internal Path Error");<br>
                                              };<br>
                                      };<br>
                              }<br>
              <br>
            </div>
            In our code, Kamailio always jumps into the
            add_path_received() part, so I guess, NAT detection
            triggers. But why?<br>
            <br>
          </div>
          <div>And then the Path header appended looks like this:<br>
            <br>
            Path:
            <a class="moz-txt-link-rfc2396E" href="sip:1.2.3.4;lr;received=sip:2A01:1234:123:1234:0:0:0:2:16732"><sip:1.2.3.4;lr;received=sip:2A01:1234:123:1234:0:0:0:2:16732></a><br>
          </div>
          <div><br>
            The path module probably doesn't know anything about IPv6,
            too, so the IP in the received parameter is not enclosed in
            square brackets. When using the Path header later to send
            packets to the client, Kamailio complains about a parse
            error for the destination URI again.<br>
            <br>
          </div>
          I tried looking into the path module, but I guess my C skills
          aren't sufficient to submit a patch. <br>
          <br>
        </div>
        Best regards,<br>
        Sebastian<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>