<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <tt>Hello Fabian,<br>
      <br>
      Regarding your questions:<br>
      <br>
      1) limiting the number of contacts to be used:<br>
          a) either keep in memory just one registration (last one) -
      see the "cxx" and "f" flags <br>
                     
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.8.x/registrar.html#id292725">http://www.opensips.org/html/docs/modules/1.8.x/registrar.html#id292725</a><br>
             doing save("location","c1f")<br>
          b) either keep all contacts in mem, but use only the most
      recent one:<br>
             </tt><tt>modparam("usrloc", "desc_time_order", 1)<br>
             lookup("location","b"); # see
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.8.x/registrar.html#id292943">http://www.opensips.org/html/docs/modules/1.8.x/registrar.html#id292943</a><br>
      <br>
      <br>
      2) regarding the TCP timeout, it can be controlled via
      tcp_connect_timeout:<br>
          <a class="moz-txt-link-freetext" href="http://www.opensips.org/Resources/DocsCoreFcn18#toc78">http://www.opensips.org/Resources/DocsCoreFcn18#toc78</a><br>
      <br>
      Regards,<br>
    </tt><br>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <br>
    On 10/22/2012 01:34 PM, Fabian Bernhard wrote:
    <blockquote
cite="mid:CAEgBpcDh8BZfcQocxR7-AccLaBwEMxWmLRnjurNL=UWmfbSdVQ@mail.gmail.com"
      type="cite">
      <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("usrloc", "desc_time_order", 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>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>