<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi All, <div class=""><br class=""></div><div class="">At the risk of possibly dragging up an old thread (<a href="https://lists.kamailio.org/pipermail/sr-users/2021-June/112791.html" class="">https://lists.kamailio.org/pipermail/sr-users/2021-June/112791.html</a>) I’m seeing unusual behaviour where $Rp is still showing what I think is the ‘wrong’ behaviour, but given Daniel’s reply on the earlier thread I want to be sure this isn’t the intended behaviour. </div><div class=""><br class=""></div><div class="">The thread above confirms that $Rp is not taken from the IP layer but is intended to give the attribute of the listen socket associated with the SIP traffic, which is fine and what I’m expecting, but in my case it doesn’t seem to be working this way. </div><div class=""><br class=""></div><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">(I’ve tried with and without tcp_reuse_port=yes and tcp_connection_match=1 too just in case one of the above parameters has changed this behaviour) </div></div><div class=""><br class=""></div><div class="">If Kamailio listening on multiple ports e.g.</div><div class=""><br class=""></div><div class=""><div class="">listen=tcp:10.30.22.73:7701</div><div class="">listen=tcp:10.30.22.73:7702</div><div class="">listen=tcp:10.30.22.73:7703</div><div class="">listen=tls:10.30.22.73:7801</div><div class="">listen=tls:10.30.22.73:7802</div><div class="">listen=tls:10.30.22.73:7803</div></div><div class=""><br class=""></div><div class="">And I use $fs to force the socket of an outbound message <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">to one of the above</span> before t_relay() it works as expected (with tcp_reuse_port it originates from the given port number above, without that set it will originate from a different ephemeral port even to the same destination, so $fs is working as expected)</div><div class=""><br class=""></div><div class="">Then, in reply_route{} I have a simple line to add the port it was received on to the headers (I’ve also tried with $RAp)</div><div class=""><br class=""></div><div class="">append_hf("X-Rcvd-Port: $Rp\r\n”);</div><div class=""><br class=""></div><div class="">In every case, the reply seems to contain the *first* port of the protocol type (so in the above example every TCP reply irrespective of whether it is to 7701/02/03 will show $Rp 7701, and every TLS reply will show 7801)</div><div class=""><br class=""></div><div class="">Any advice or insight anyone can offer would be much appreciated. </div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Ross</div></body></html>