[sr-dev] tcp problem

Klaus Darilion klaus.mailinglists at pernau.at
Fri Oct 30 15:15:23 CET 2009



Andrei Pelinescu-Onciul schrieb:
> On Oct 29, 2009 at 08:16, Klaus Darilion <klaus.mailinglists at pernau.at> wrote:
>> Long time ago, ser always used the OS default interface for new TCP 
>> connections. In Openser this was changed to the first listening TCP 
>> address, and further could be specified by force_send_socket.
>>
>> I know there were some changes in ser/sr too, but do not know exactly 
>> what was changed.
> 
> In ser/sr the default ip for outgoing TCP connections can be forced
> using:
> tcp_source_ipv4="ip" and 
> tcp_source_ipv6="ip".
> 
> By default the OS chooses the src ip (e.g. according to the routing
> table) and ser/sr tries to match with the list of IPs it is listening
> on. The default behaviour along with either listening on all the IPs or
> making sure your routing table uses the src ip you want, it's more error
> proof (automatic multi-homing) and a little bit faster (avoids an extra
> bind()).
> 
> I could add a config option to always use the msg send_socket, but what
> would probably be best would be to force a src_ip only if a send_socket
> was forced and if not use the OS one or tcp_source_ipv4 if set.

This is IMO a good option - I guess this also would allow usage of 
force_send_socket, e.g. force_send_socket("tcp:1.2.3.4").

btw: does this imply that the current documentation (copied from 
Kamailio) is wrong as it does not work with outgoing TCP messages?
http://sip-router.org/wiki/cookbooks/core-cookbook/devel#force_send_socket

regards
klaus



More information about the sr-dev mailing list