<p>Some improvements on the handling of contacts on S-CSCF database, namely</p>

<ul>
<li>Clean the contact table at startup if impu_contact table is empty</li>
<li>if the contact is in state DELAYED_DELETE but still has ref_count > 0 in memory, it could mean that it has not been decremented before due to a failure to get a lock. This way we are leaking a contact on the DB and in memory. When the contact is expired and in DELAYED_DELETE, we do a query to check if it is really still referenced on impu_contact table. If not, we mark contact for deletion. </li>
<li>Add an helper function to print the actual state of a contact instead of the index of the enum</li>
</ul>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/730'>https://github.com/kamailio/kamailio/pull/730</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>ims_usrloc_scscf: Remove all unlinked contacts</li>
  <li>ims_usrloc_scscf: Double check contact refs on DB</li>
  <li>ims_usrloc_scscf: Print contact state as string</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/730/files#diff-0">modules/ims_usrloc_scscf/udomain.c</a>
    (26)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/730/files#diff-1">modules/ims_usrloc_scscf/usrloc.h</a>
    (17)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/730/files#diff-2">modules/ims_usrloc_scscf/usrloc_db.c</a>
    (72)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/730/files#diff-3">modules/ims_usrloc_scscf/usrloc_db.h</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/730.patch'>https://github.com/kamailio/kamailio/pull/730.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/730.diff'>https://github.com/kamailio/kamailio/pull/730.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/730">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZXxPk-LlB57q5dNDnPurF2LRvwabks5qbfH0gaJpZM4JZkqs">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZVgl2nDzGV3SqqfO-n25GD0G3-Smks5qbfH0gaJpZM4JZkqs.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/730"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>