<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 sip:domain 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 href="http://1.2.3.4:5060">1.2.3.4:5060</a> -> <a href="http://9.8.7.6:5060">9.8.7.6:5060</a><br>REGISTER sip:domain 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: <sip:1.2.3.4;lr;received=sip:2A01:1234:123:1234:0:0:0:2:16732><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>