<h4>Pre-Submission Checklist</h4>



<ul>
<li>[ x] Commit message has the format required by CONTRIBUTING guide</li>
<li>[ x] Commits are split per component (core, individual modules, libs, utils, ...)</li>
<li>[ x] Each component has a single commit (if not, squash them into one commit)</li>
<li>[ x] No commits to README files for modules (changes must be done to docbook files<br>
in <code>doc/</code> subfolder, the README file is autogenerated)</li>
</ul>
<h4>Type Of Change</h4>
<ul class="contains-task-list">
<li>[x ] Small bug fix (non-breaking change which fixes an issue)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> New feature (non-breaking change which adds new functionality)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Breaking change (fix or feature that would change existing functionality)</li>
</ul>
<h4>Checklist:</h4>

<ul class="contains-task-list">
<li>[x ] PR should be backported to stable branches</li>
<li>[x ] Tested changes locally</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Related to issue #XXXX (replace XXXX with an open issue number)</li>
</ul>
<h4>Description</h4>

<p>When cnxcc receives a message wih a registered CID (for example in a re-INVITE) it saves as a new call and this is a problem:</p>
<ul>
<li>cnxcc store 2 times the same call and it discounts credit for both</li>
<li>when the call is finished, cnxcc only remove one record and the other continues discounting credit.</li>
<li>when credit is finished (of an non active call), all active calls are killed</li>
</ul>
<p>An example:<br>
kamcmd> cnxcc.check_client test<br>
id:0,confirmed:no,local_consumed_amount:0.004800,global_consumed_amount:3.126200,local_max_amount:30.000000,global_max_amount:30.000000,call_id:41211f7e0a65b41c4ca7181b18db0f1e@185.47.15.56:5080,start_timestamp:0,inip:1,finp:1,connect:0.000000,cps:0.004800;<br>
id:1,confirmed:no,local_consumed_amount:0.004800,global_consumed_amount:3.126200,local_max_amount:30.000000,global_max_amount:30.000000,call_id:41211f7e0a65b41c4ca7181b18db0f1e@185.47.15.56:5080,start_timestamp:0,inip:1,finp:1,connect:0.000000,cps:0.004800;<br>
id:2,confirmed:no,local_consumed_amount:0.000200,global_consumed_amount:3.126200,local_max_amount:30.000000,global_max_amount:30.000000,call_id:5e911ab1452cf1a3165af5262b519977@185.47.15.56:5080,start_timestamp:0,inip:1,finp:1,connect:0.000000,cps:0.000200;<br>
id:3,confirmed:no,local_consumed_amount:0.000200,global_consumed_amount:3.126200,local_max_amount:30.000000,global_max_amount:30.000000,call_id:5e911ab1452cf1a3165af5262b519977@185.47.15.56:5080,start_timestamp:0,inip:1,finp:1,connect:0.000000,cps:0.000200;<br>
id:4,confirmed:no,local_consumed_amount:0.000800,global_consumed_amount:3.126200,local_max_amount:30.000000,global_max_amount:30.000000,call_id:0f44fbc63883e52d72c9f52f49253476@185.47.15.56:5080,start_timestamp:0,inip:1,finp:1,connect:0.000000,cps:0.000800;</p>
<ul>
<li>id 0 and id 1 are the same call that has been inserted twice.</li>
<li>id 2 and id 3 are the same call that has been inserted twice.</li>
<li>id 4 is a finished call that has not been removed from the stack and continues discounting credit.</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/2383'>https://github.com/kamailio/kamailio/pull/2383</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>cnxcc: remove duplicated entries with a same CID value</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2383/files#diff-f4cf1a9239a9f621e8a6efe67bc3b548">src/modules/cnxcc/cnxcc_mod.c</a>
    (50)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/2383.patch'>https://github.com/kamailio/kamailio/pull/2383.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/2383.diff'>https://github.com/kamailio/kamailio/pull/2383.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/2383">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZKJSCVUWD6XM32EPC3RZH4L5ANCNFSM4OMKISIA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZOZPTNHSV77W33D3GTRZH4L5A5CNFSM4OMKISIKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JVDOWWQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2383",
"url": "https://github.com/kamailio/kamailio/pull/2383",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>