[OpenSIPS-Users] Invalid contacts in location table, TCP timeout

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Oct 25 12:51:03 CEST 2012

Hello Fabian,

Regarding your questions:

1) limiting the number of contacts to be used:
     a) either keep in memory just one registration (last one) - see the 
"cxx" and "f" flags
        doing save("location","c1f")
     b) either keep all contacts in mem, but use only the most recent one:
modparam("usrloc", "desc_time_order", 1)
        lookup("location","b"); # see 

2) regarding the TCP timeout, it can be controlled via tcp_connect_timeout:


Bogdan-Andrei Iancu
OpenSIPS Founder and Developer

On 10/22/2012 01:34 PM, Fabian Bernhard wrote:
> Dear list
> We develop SIP clients and have an OpenSIPS 1.8.0 test server. We are 
> bound to use TCP and frequently kill the clients without 
> unregistering. This leads to invalid contacts in the location table.
> It often takes a long time for an INVITE or MESSAGE to be forwarded by 
> the server. In syslog we see a lot of these entries:
> Oct 18 14:55:50 Debian-60-squeeze-64-minimal 
> /usr/sbin/opensips[11050]: ERROR:core:tcp_blocking_connect: timeout 10 
> s elapsed from 10 s
> Oct 18 14:55:50 Debian-60-squeeze-64-minimal 
> /usr/sbin/opensips[11050]: ERROR:core:tcpconn_connect: 
> tcp_blocking_connect failed
> Oct 18 14:55:50 Debian-60-squeeze-64-minimal 
> /usr/sbin/opensips[11050]: ERROR:core:tcp_send: connect failed
> Oct 18 14:55:50 Debian-60-squeeze-64-minimal 
> /usr/sbin/opensips[11050]: ERROR:tm:msg_send: tcp_send failed
> Oct 18 14:55:50 Debian-60-squeeze-64-minimal 
> /usr/sbin/opensips[11050]: ERROR:tm:t_forward_nonack: sending request 
> failed
> I think that OpenSIPS tries to forward the messages to all contacts in 
> the location table, one contact after the other. Because some of them 
> are not valid anymore the server is unable to send the message. This 
> means that it takes 30 seconds for an INVITE to be received if there 
> are 3 old contacts in the location table, due to the 10 seconds timeout.
> I have hoped that the following configuration would resolve the 
> problem. I thought it would make OpenSIPS to send the message to the 
> most recent contact first:
> modparam("usrloc", "desc_time_order", 1)
> It turned out that this is not the case, for whatever reason.
> My questions:
> 1/ Is this behavior normal and expected? I.e. waiting 10 seconds for 
> the TCP timeout before trying the next contact in the location table?
> 2/ Is there a way to configure OpenSIPS to a) send the messages in 
> parallel to all contacts and b) to delete invalid contacts from 
> location table upon above error?
> 3/ Can I reduce the TCP timeout to something like 2 seconds? If yes: how?
> Thanks and best regards
> Fabian
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121025/ed888c0a/attachment.htm>

More information about the Users mailing list