<p>Cnxcc call termination is not working anymore since commit <a href="https://github.com/kamailio/kamailio/commit/265dc95aac8eb4b5cee7992dde55ff08c92a7ac5" class="commit-link"><tt>265dc95</tt></a>. That commit introduced the call to DLGCB_TERMINATED callbacks for the locally generated BYE, which leads to a deadlock in cnxcc when it tries to end the calls because the credit (money or time) is exhausted. <br>
This patch introduces a new structure cnxcc_lock which implements re-entrant locks.<br>
As a side question I'm wondering if, since other modules need re-entrant locks, this structure should be defined in lock_ops.h like the other kamailio's locks.</p>

<hr>

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

<h4>Commit Summary</h4>
<ul>
  <li>cnxcc: make cnxcc locks re-entrant</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/398/files#diff-0">modules/cnxcc/cnxcc_check.c</a>
    (33)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/398/files#diff-1">modules/cnxcc/cnxcc_mod.c</a>
    (182)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/398/files#diff-2">modules/cnxcc/cnxcc_mod.h</a>
    (56)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/398/files#diff-3">modules/cnxcc/cnxcc_redis.c</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/398/files#diff-4">modules/cnxcc/cnxcc_rpc.c</a>
    (26)
  </li>
</ul>

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

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/398">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZYJ-Pcy-jqNgppnNP41V3bf3QCWLks5pGC26gaJpZM4Gif2T.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/398"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>