<h3>Description</h3>
<p>Incoming Invite triggers CCR toward OCS.<br>
In CCA with Result-Code DIAMETER_SUCCESS (2001) missing Result-Code in Multiple-Services-Credit-Control AVP.<br>
Kamailio handles this successful charging transaction as a failure in the following lines:<br>
if (ro_cca_data->mscc->resultcode != 2001) {<br>
LM_DBG("CCA failure at MSCC level with resultcode [%d]\n", ro_cca_data->mscc->resultcode);<br>
error_code = RO_RETURN_FALSE;<br>
goto error1;<br>
}</p>
<p>The resultcode is mandatory in this statement, so if Multiple-Services-Credit-Control AVP does not contain Result-Code which is optional according to RFC 4006 the charging transaction is considered as failed.</p>
<h4>Reproduction</h4>
<p>To reproduce the issue the diameter CCA should look as following:</p>
<p>Diameter Protocol<br>
Version: 0x01<br>
Length: 392<br>
Flags: 0x40, Proxyable<br>
Command Code: 272 Credit-Control<br>
ApplicationId: Diameter Credit Control Application (4)<br>
Hop-by-Hop Identifier: 0x66ea324d<br>
End-to-End Identifier: 0x8777d597<br>
[Request In: 2623]<br>
[Response Time: 0.457246000 seconds]<br>
AVP: Session-Id(263) l=52 f=-M- val=ar.voice-pre-5.domain.int;843835511;1<br>
<strong>AVP: Result-Code(268) l=12 f=-M- val=DIAMETER_SUCCESS (2001)</strong><br>
AVP: Auth-Application-Id(258) l=12 f=-M- val=Diameter Credit Control Application (4)<br>
AVP: CC-Request-Type(416) l=12 f=-M- val=INITIAL_REQUEST (1)<br>
AVP: CC-Request-Number(415) l=12 f=-M- val=0<br>
AVP: CC-Session-Failover(418) l=12 f=-M- val=FAILOVER_NOT_SUPPORTED (0)<br>
AVP: Unknown(12018) l=45 f=VM- vnd=12239 val=31363239386664653539382d303030303465363864343333...<br>
AVP: Unknown(12019) l=76 f=VM- vnd=12239 val=00002ef4c000001800002fcf532e5441522e30302e303030...<br>
AVP: Unknown(12011) l=16 f=VM- vnd=12239 val=00000000<br>
<strong>AVP: Multiple-Services-Credit-Control(456) l=56 f=-M-<br>
AVP Code: 456 Multiple-Services-Credit-Control<br>
AVP Flags: 0x40<br>
AVP Length: 56<br>
Multiple-Services-Credit-Control: 000001af40000014000001a44000000c0000005a00000364...<br>
AVP: Granted-Service-Unit(431) l=20 f=-M-<br>
AVP: Time-Quota-Threshold(868) l=16 f=V-- vnd=TGPP val=127.0.0.1</strong><br>
AVP: Origin-Host(264) l=15 f=-M- val=sim-dra<br>
AVP: Origin-Realm(296) l=29 f=-M- val=tlf-ar.ocs.com</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.1.2 (x86_64/linux) 
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled on 13:24:45 Apr  7 2018 with gcc 4.9.2
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>Linux voice-pre-5 4.9.0-0.bpo.2-amd64 #1 SMP Debian 4.9.18-1~bpo8+1 (2017-04-10) x86_64 GNU/Linux
</code></pre>

<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/issues/1505">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZRXeBf_JTTQ_xtnkyk7PmZE-XY6Eks5tqjXUgaJpZM4Td9-X">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36Zc2d2uxhedr-bCAZf33HuPTNvZ8fks5tqjXUgaJpZM4Td9-X.gif" height="1" width="1" alt="" /></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/issues/1505"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Kamailio ims_charging module handles Result-Code AVP inside MSCC AVP as a mandatory AVP (#1505)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1505"}}}</script>