<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    On 12/22/11 6:19 PM, Andreas Granig wrote:
    <blockquote cite="mid:4EF3669B.9@sipwise.com" type="cite">
      <pre wrap="">Got the cause of the issue.

What happens is that there's an AOR which registers ever 120 seconds.
For some reason, the location entry is in usrloc cache, but not in db.
What happens now is that usrloc tries an "update" query in the db,
because it still assumes that the entry is there, which obviously fails.

If you remove the entry from usrloc (kamctl ul rm &lt;aor&gt;), then on the
next re-registration it's both inserted into the cache and into the db.

Wondering how it could happen to get out of sync, and how we could
improve this. Maybe using a "replace into" instead of "update", at least
for mysql? Suggestions?</pre>
    </blockquote>
    is the timer interval parameter of usrloc higher than 120sec?<br>
    <br>
<a class="moz-txt-link-freetext" href="http://kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2494575">http://kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2494575</a><br>
    <br>
    IIRC, there should be anyhow a flag to mark if the record is in db
    or not, and based on that do insert or update, maybe something is
    lost there. If you do 'kamctl ul show __aor__', what are the values
    for flags fields?<br>
    <br>
    Another option, perhaps more portable, but with two db hits is:
    update and if fails then insert -- considering that these should be
    corner cases, maybe the performance is not affected much. A blended
    version is even better, if the db driver supports replace, do
    replace instead of update (I don't know if replace is faster/slower
    than update).<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <blockquote cite="mid:4EF3669B.9@sipwise.com" type="cite">
      <pre wrap="">

Andreas

On 12/22/2011 05:12 PM, Andreas Granig wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi,

Could you please tell me which of the three timer processes ("timer",
"slow timer" or "timer nh") is responsible for cleaning up the internal
usrloc cache?

Looks like every now and then the cleanup of the internal location cache
is starting to fail. Funny thing is that expired locations are removed
from the mysql backend, but not from the internal cache. We're running
kamailio 3.1.5, are there any known issues fixed since that version?

In the meanwhile we're trying to pin the issue down, but maybe someone
has a clue...

Andreas




_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></pre>
      </blockquote>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>