<p>This is an intermittent problem (it doesn't happen all the time).</p>

<p>Version:</p>

<pre><code>[root@lab002189-flip-server install]# kamctl fifo version
Server:: kamailio (4.3.3 (x86_64/linux))
Build:: mi_core.c compiled on 17:06:31 Oct  5 2015 with gcc 4.4.7
Flags:: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
GIT:: e275bc
</code></pre>

<p>Full log:</p>

<pre><code>[root@lab002189-flip-server install]# cat /var/log/kamailio/kamailio.log
2015-10-06T06:50:44.443018+09:00 lab002189-flip-server /usr/local/src/git/kamailio-4.3/kamailio[6126]: WARNING: dispatcher [dispatch.c:792]: ds_load_db(): no dispatching data in the db -- empty destination set
2015-10-06T06:50:56.409999+09:00 lab002189-flip-server /usr/local/src/git/kamailio-4.3/kamailio[6110]: ERROR: acc [acc_cdr.c:199]: db_write_cdr(): failed to convert string to double - 111.
2015-10-06T06:50:56.410019+09:00 lab002189-flip-server /usr/local/src/git/kamailio-4.3/kamailio[6110]: ERROR: acc [acc_cdr.c:636]: cdr_on_failed(): failed to write cdr!
</code></pre>

<p>The code is this in modules/acc/acc_cdr.c:</p>

<pre><code>                        case TYPE_DOUBLE:
                                VAL_TYPE(db_cdr_vals+i)=DB1_DOUBLE;
                                VAL_NULL(db_cdr_vals+i)=0;
                                double_val = strtod(cdr_value_array[i].s, &end);
                                if(errno && (errno != EAGAIN)) {
                                        LM_ERR("failed to convert string to double - %d.\n", errno);
                                        goto error;
                                }
                                VAL_DOUBLE(db_cdr_vals+i) = double_val;
                                break;
</code></pre>

<p>The value errno=111 (ECONNREFUSED) doesn't make sense for strtod so i understand the problem is that the errno is not being zeroed before entering the loop that processes the cdr data, so errno is being set somewhere else, strtod is successful but the errno check fails.</p>

<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/issues/359">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZcRzI0BCqpGgCmdOaA6sN224zL_rks5o4u1OgaJpZM4GJW7W.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/issues/359"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>