Kamailio will use an ephemeral ports (assigned by the kernel) when making outbound TCP connections, this is recommended for several reasons.

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.
But comes with some unwanted limitations.


On Thu, Apr 2, 2020 at 11:52 PM Amarnath K <ykamarnath@gmail.com> wrote:
Hi All,

I'm using Kamailio version 5.1.9.
In cfg file have routing to send out SIP messages from Kamailio stack. In this routing logic added 

force_send_socket("tcp:192.168.40.10:5060");
forward()

I'm expecting the send port should be from 5060, but it always pick random port to send out message.
my requirement is to send SIP messages from 5060 port instead of picking random port.

Regards,
Amarnath

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users