<div>Dear list</div><div><br></div><div>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. </div>
<div><br></div><div>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:</div><div><br></div><div>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</div>
<div>Oct 18 14:55:50 Debian-60-squeeze-64-minimal /usr/sbin/opensips[11050]: ERROR:core:tcpconn_connect: tcp_blocking_connect failed</div><div>Oct 18 14:55:50 Debian-60-squeeze-64-minimal /usr/sbin/opensips[11050]: ERROR:core:tcp_send: connect failed</div>
<div>Oct 18 14:55:50 Debian-60-squeeze-64-minimal /usr/sbin/opensips[11050]: ERROR:tm:msg_send: tcp_send failed</div><div>Oct 18 14:55:50 Debian-60-squeeze-64-minimal /usr/sbin/opensips[11050]: ERROR:tm:t_forward_nonack: sending request failed</div>
<div><br></div><div>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.</div>
<div><br></div><div>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:</div><div><br></div><div>modparam(&quot;usrloc&quot;, &quot;desc_time_order&quot;, 1)</div>
<div><br></div><div>It turned out that this is not the case, for whatever reason.</div><div><br></div><div>My questions:</div><div><br></div><div>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?</div>
<div>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?</div><div>3/ Can I reduce the TCP timeout to something like 2 seconds? If yes: how?</div>
<div><br></div><div>Thanks and best regards</div><div><br></div><div>Fabian</div><div><br></div><div><br></div><div>  </div>