<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p><br>
</p>
<p>reading back into this discussion, you want to round up duration
in seconds if it is over .50 and round down if it is less .50, am
I right?</p>
<p><br>
</p>
<p>I don't think there is an option for it in the modparams, but I
expect that the tool that reads the cdrs from logs can be adjusted
to do such rounding.</p>
<p><br>
</p>
<p>An alternative with kamailio scripting inside kamailio.cfg is to
use a dialog variable where you compute the duration as you want
and get it inside the cdr vai cdr_extra param for acc module. You
should be able to compute the duration inside the
event_route[dialog:end] block.</p>
<p><br>
</p>
<p>Cheers,<br>
Daniel<br>
</p>
<br>
<div class="moz-cite-prefix">On 05.04.18 11:13, Narayan P wrote:<br>
</div>
<blockquote type="cite"
cite="mid:HK2PR02MB0403ADB6BB203122F1A47182D7BB0@HK2PR02MB0403.apcprd02.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<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,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Can I have an 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"><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
Narayan P<br>
<b>Sent:</b> Tuesday, March 20, 2018 6:49:37 AM<br>
<b>To:</b> Henning Westerholt; <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<b>Subject:</b> Re: [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 Henning,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks for replying.</p>
<p style="margin-top:0; margin-bottom:0">I have already tried
with time_mode = 1.I have used this like;</p>
<pre class="x_programlisting">modparam("acc", "time_mode", 1) and also</pre>
<pre class="x_programlisting">modparam("acc", "time_mode", 0)
Can you please suggest any other settings that I need to do in kamailio.
Thanks,
Narayan
</pre>
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
Henning Westerholt <a class="moz-txt-link-rfc2396E" href="mailto:hw@kamailio.org"><hw@kamailio.org></a><br>
<b>Sent:</b> Monday, March 19, 2018 8:33:54 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<b>Cc:</b> Narayan P<br>
<b>Subject:</b> Re: [SR-Users] Issue in cdr generation in
seconds format</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span
style="font-size:11pt">
<div class="x_PlainText">Am Montag, 19. März 2018,
13:49:52 CET schrieb Narayan P:<br>
> Any update on this please.<br>
> <br>
<br>
Hello Naryan,<br>
<br>
have you tried with time_mode = 1?<br>
<br>
6.45. time_mode (int)<br>
<br>
Store additional value related to the time of event.<br>
<br>
Values can be:<br>
* 0 - (default), save only unix timestamp for
syslog and datetime for<br>
database.<br>
* 1 - save seconds in time_attr and microseconds in
time_exten.<br>
<br>
Best regards,<br>
<br>
Henning<br>
<br>
<br>
<br>
<br>
> Hello Sir,<br>
> <br>
> <br>
> I need your expertise for kamailio cdr generation
in seconds format.<br>
> <br>
> <br>
> I have a requirement to generate cdr duration in
second format.Now I am<br>
> getting second.milliseconds format.Below is the log
where duration is<br>
> 18.676 but I want this to be 19.(suppose where
duration =18.234, I need it<br>
> to be 18).<br>
> <br>
> <br>
> Mar 16 10:38:22 vm11-kamailio
/usr/local/sbin/kamailio[20787]: NOTICE: acc<br>
> [acc_cdr.c:352]: log_write_cdr():
start_time=1521196683.464;<br>
> end_time=1521196702.140; duration=18.676;
src_user=71097345;<br>
> src_domain=185.122.XXX.XXX; src_ip=185.122.XXX.XXX;
dst_user=;<br>
> dst_ouser=91786042XXXX; dst_domain=185.122.XXX.XXX;
sip_code=; sip_reason=;<br>
> 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>
> /* 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>
> <br>
>
"cdr_extra","src_user=$fU;src_domain=$fd;src_ip=$si;dst_user=$rU;dst_ouser=<br>
>
$tU;dst_domain=$rd;sip_code=$rs;sip_reason=$rr;callid=$dlg(callid);dst_ip=$R<br>
> i")<br>
> <br>
> Please suggest me what to configure more in
kamailio to achieve cdr in<br>
> second format.<br>
> <br>
> Thanks,<br>
> Narayan<br>
<br>
<br>
</div>
</span></font></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>