<div dir="ltr">Hi Alex,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 13, 2014 at 4:39 PM, Alex Balashov <span dir="ltr"><<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Have a look at replacing your record_route() call with record_route_preset():<br>
<br>
   <a href="http://kamailio.org/docs/modules/4.1.x/modules/rr.html#idp114624" target="_blank">http://kamailio.org/docs/<u></u>modules/4.1.x/modules/rr.html#<u></u>idp114624</a><br>
<br>
As for the advertised address more generally, i.e. in Via, have a look at this core parameter:<br>
<br>
   <a href="http://www.kamailio.org/wiki/cookbooks/4.1.x/core#advertised_address" target="_blank">http://www.kamailio.org/wiki/cookbooks/4.1.x/core#advertised_address</a><br></blockquote><div><br></div>Thanks. I just added the advertised_address parameter as a test, now Kamailio puts the external IP into Via and RR, but still uses the port 15060 from the other socket.<br>

<br></div><div class="gmail_quote">However, the docs say:<br>"If empty or not set (default value) the socket
address from where the request will be sent is used."<br><br></div><div class="gmail_quote">This is what I would expect, but this is not what's happening. It uses a different socket for the Via and RR header than it actually uses for sending the request out.<br>

<br></div><div class="gmail_quote">I worked around this problem by placing the listen line for the unused TCP connection after the used one, and now it looks a lot better. But I still think, that the Via and RR headers should never differ from the actually used socket, when not using the set_advertised_address function.<br>

</div><div class="gmail_quote"><br></div><div class="gmail_quote">Best Regards,<br></div><div class="gmail_quote">Sebastian<br></div></div></div></div>