<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    thanks for the patch. Some remarks.<br>
    <br>
    As you highlighted that the solution is not very efficient (due to
    no direct mapping between records and tcp connection), it should
    have a way to disable it (maybe via mod param for usrloc).<br>
    <br>
    At this moment is hardcoded for 'location' table, but there can be
    other names used, since this value is given as parameter to
    save()/lookup(). It will have to iterate through all usrloc tables
    (called domains interanlly in the module).<br>
    <br>
    Also, if I didn't get it wrong, it works only with in-memory
    records, if the usrloc is configured in db-only mode, it does not
    work with current patch, right?<br>
    <br>
    I had in mind to implement such features, but using timer, to
    iterate through tcp connections and see if there is still an open
    connection for it. This will do delayed discovery, but I am not sure
    it will bring more benefits -- initially I thought is faster lookup
    done by a dedicated timer, presumly there are less tcp connections
    that usrloc records.<br>
    <br>
    Anyhow, perhaps we should do some optimization here, we can store
    the connection id in usrloc structure and then match received
    address only if there is same conenction id. Or add received built
    from tcp connection close callback in a list that is used by usrloc
    expires timers.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 8/27/13 12:29 AM, Vitaliy
      Aleksandrov wrote:<br>
    </div>
    <blockquote cite="mid:521BD6C9.1030705@gmail.com" type="cite">Hello,
      <br>
      <br>
      I've made a patch to kamailio-4.0.3 which removes stale
      registration when kamailio looses an incoming tcp connection.
      <br>
      Of course this patch needs more work.
      <br>
      <br>
      Since the are no direct references between user location contacts
      and tcp connections callback function uses linear search through
      the whole location table using received field as a key.
      <br>
      <br>
      Can anybody more experienced in kamailio internals check if I
      chose the right place to get information about lost tcp
      connections ?
      <br>
      Another thing I wanted to ask is maybe somebody can suggest a
      better way to tie a tcp connection to the user location
      information without complicating "usrloc" module by any heavy data
      structures.
      <br>
      <br>
      If anybody else except me need this It would be great to fix known
      problems and add it to kamailio.
      <br>
      <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>
    <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://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013
  - more details about Kamailio trainings at <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a> -
</pre>
  </body>
</html>