[SR-Users] Query on force_send_socket

Julien Chavanton jchavanton at gmail.com
Fri Apr 3 18:15:08 CEST 2020


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 at 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 at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200403/1889fb5b/attachment.html>


More information about the sr-users mailing list