[sr-dev] About TCP connection failure (reject and timeout)
andrei at iptel.org
Thu Jun 23 20:32:53 CEST 2011
On Jun 15, 2011 at 19:06, Iñaki Baz Castillo <ibc at aliax.net> wrote:
> 2011/6/15 Iñaki Baz Castillo <ibc at aliax.net>:
> > Hi, I've opened an issue in the tracker since it seems that sip-router
> > (today's master branch) does not properly react upon TCP rejection or
> > TCP timeout (in outgoing transactions):
> > http://sip-router.org/tracker/index.php?do=details&task_id=136
> > Could somebody attemp these two calls?
> > 1) sip:lalala at 184.108.40.206:7777;transport=tcp
> > The server will reject (iptables REJECT action) so sip-router should
> > inmediately generate a 503 for the transaction (but instead it
> > generates a local 408 after fr_timer, usually 32 seconds).
> > 2) sip:lalala at 220.127.116.11:5060;transport=tcp
> > The server will not respond as 18.104.22.168 is not reachable, so sip-router
> > should wait for "tcp_connect_timeout" value (10 seconds by default)
> > and then generate a local 408 (but instead it generates a local 408
> > after fr_timer, usually 32 seconds).
> The issue just occurs when tcp_async=yes.
Yes, it's a known limitation. Basically when async it's own, tm has no
way of knowing that a connect() has failed and would have to rely on sip
Of course these could be changed, but it would have both performance and
memory usage impact and it would be very hard to integrate with tls.
I would rather not do it in the near future.
The tcp_connect_timeout refers to how long the tcp connect will be
attempted, but it's not linked to tm. The value is not 100% exact,
the tcp timers are executed on a best effort basis, at most at 5s
intervals and at minimum 1/16 seconds, so you should expect a 5s error
If it's too much for you, change TCP_MAIN_SELECT_TIMEOUT and
TCP_CHILD_SELECT_TIMEOUT in tcp_conn.h (btw. we don't use select()
anymore, the names where not updated when we switched to
> Iñaki Baz Castillo
> <ibc at aliax.net>
> sr-dev mailing list
> sr-dev at lists.sip-router.org
More information about the sr-dev