<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hello All,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Any update on this please.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks,</p>
<p style="margin-top:0;margin-bottom:0">Narayan<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Narayan P <narayana88@outlook.com><br>
<b>Sent:</b> Friday, March 16, 2018 11:02:19 AM<br>
<b>To:</b> sr-users@lists.kamailio.org<br>
<b>Subject:</b> [SR-Users] Issue in cdr generation in seconds format</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hello Sir,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I need your expertise for kamailio cdr generation in seconds format.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I have a requirement to generate cdr duration in second format.Now I am getting second.milliseconds format.Below is the log where duration is 18.676 but I want this to be 19.(suppose where duration =18.234, I need it
 to be 18).</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div>Mar 16 10:38:22 vm11-kamailio /usr/local/sbin/kamailio[20787]: NOTICE: acc [acc_cdr.c:352]: log_write_cdr(): start_time=1521196683.464; end_time=1521196702.140;
<span style="color:rgb(255,0,0)">duration=18.676</span>; src_user=71097345; src_domain=185.122.XXX.XXX; src_ip=185.122.XXX.XXX; dst_user=; dst_ouser=91786042XXXX; dst_domain=185.122.XXX.XXX; sip_code=; sip_reason=; callid=LVHyTCFWYBpEFp.sFpY204aBdx.nez9B; dst_ip=185.122.XXX.XXX<br>
<br>
<br>
<br>
My kamailio configuration related to cdr is like this;<br>
<br>
<div>/* what special events should be accounted ? */<br>
modparam("acc", "db_url", "flatstore:/var/log/cdr.log")<br>
#modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)")<br>
modparam("acc", "log_facility", "LOG_DAEMON")<br>
modparam("acc", "cdr_enable", 1)<br>
modparam("acc", "cdr_start_on_confirmed", 1)<br>
modparam("acc", "cdr_log_enable", 1)<br>
modparam("acc", "time_mode", 0)<br>
modparam("acc", "time_attr", "seconds")<br>
modparam("acc", "cdr_start_id", "start_time")<br>
modparam("acc", "cdr_end_id", "end_time")<br>
modparam("acc", "cdr_duration_id", "duration")<br>
#modparam("acc", "cdr_flag", 3)<br>
#modparam("acc", "early_media", 0)<br>
#modparam("acc", "report_ack", 0)<br>
#modparam("acc", "report_cancels", 0)<br>
#modparam("dialog", "enable_stats", 1)<br>
modparam("dialog", "hash_size", 1024)<br>
modparam("dialog", "dlg_flag", 3)<br>
modparam("dialog", "db_url", DBURL)<br>
<br>
/* by default ww do not adjust the direct of the sequential requests.<br>
 * if you enable this parameter, be sure the enable "append_fromtag"<br>
 * in "rr" module */<br>
modparam("acc", "detect_direction", 0)<br>
/* account triggers (flags) */<br>
#modparam("acc", "log_flag", FLT_ACC)<br>
#modparam("acc", "log_missed_flag", FLT_ACCMISSED)<br>
#modparam("acc", "log_extra",<br>
#       "src_user=$fU;src_domain=$fd;src_ip=$si;"<br>
#       "dst_user=$tU;dst_user=$rU;dst_domain=$rd")<br>
modparam("acc",<br>
            "cdr_extra","src_user=$fU;src_domain=$fd;src_ip=$si;dst_user=$rU;dst_ouser=$tU;dst_domain=$rd;sip_code=$rs;sip_reason=$rr;callid=$dlg(callid);dst_ip=$Ri")</div>
<br>
Please suggest me what to configure more in kamailio to achieve cdr in second format.<br>
<br>
Thanks,<br>
Narayan<br>
</div>
<br>
<p></p>
</div>
</div>
</body>
</html>