[SR-Users] Issue in cdr generation in seconds format

Narayan P narayana88 at outlook.com
Fri Mar 16 12:02:19 CET 2018


Hello Sir,


I need your expertise for kamailio cdr generation in seconds format.


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).


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; duration=18.676; 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



My kamailio configuration related to cdr is like this;

/* what special events should be accounted ? */
modparam("acc", "db_url", "flatstore:/var/log/cdr.log")
#modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)")
modparam("acc", "log_facility", "LOG_DAEMON")
modparam("acc", "cdr_enable", 1)
modparam("acc", "cdr_start_on_confirmed", 1)
modparam("acc", "cdr_log_enable", 1)
modparam("acc", "time_mode", 0)
modparam("acc", "time_attr", "seconds")
modparam("acc", "cdr_start_id", "start_time")
modparam("acc", "cdr_end_id", "end_time")
modparam("acc", "cdr_duration_id", "duration")
#modparam("acc", "cdr_flag", 3)
#modparam("acc", "early_media", 0)
#modparam("acc", "report_ack", 0)
#modparam("acc", "report_cancels", 0)
#modparam("dialog", "enable_stats", 1)
modparam("dialog", "hash_size", 1024)
modparam("dialog", "dlg_flag", 3)
modparam("dialog", "db_url", DBURL)

/* by default ww do not adjust the direct of the sequential requests.
 * if you enable this parameter, be sure the enable "append_fromtag"
 * in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
#modparam("acc", "log_flag", FLT_ACC)
#modparam("acc", "log_missed_flag", FLT_ACCMISSED)
#modparam("acc", "log_extra",
#       "src_user=$fU;src_domain=$fd;src_ip=$si;"
#       "dst_user=$tU;dst_user=$rU;dst_domain=$rd")
modparam("acc",
            "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")

Please suggest me what to configure more in kamailio to achieve cdr in second format.

Thanks,
Narayan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180316/388b9ada/attachment.html>


More information about the sr-users mailing list