<div dir="ltr">Kamailio will use an ephemeral ports (assigned by the kernel) when making outbound TCP connections, this is recommended for several reasons.<br><div><br>You can google "bind before connect", if you want to find out more about this concept in Linux socket programming, this can be done to force the source port on outbound TCP connections.</div><div>But comes with some unwanted limitations.<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 2, 2020 at 11:52 PM Amarnath K <<a href="mailto:ykamarnath@gmail.com">ykamarnath@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>I'm using Kamailio version 5.1.9.</div><div>In cfg file have routing to send out SIP messages from Kamailio stack. In this routing logic added </div><div><br></div><div>force_send_socket("tcp:<a href="http://192.168.40.10:5060" target="_blank">192.168.40.10:5060</a>");</div><div>forward()<br></div><div><br></div><div>I'm expecting the send port should be from 5060, but it always pick random port to send out message.</div><div>my requirement is to send SIP messages from 5060 port instead of picking random port.</div><div><br></div><div>Regards,</div><div>Amarnath</div><br></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>