Summary:ASTERISK-16200: [patch] Patch adds REAL duration and billsec to CDR
Reporter:Mindaugas Kezys (mkezys)Labels:
Date Opened:2010-06-03 08:06:19Date Closed:2011-06-07 14:09:59
Versions:Frequency of
Environment:Attachments:( 0) cdr.c.patch
( 1) cdr.h.patch
Description:Adds call duration and billsec in floating type which gives exact time, not rounded as default CDR implementation.

This functionality is essential to bill calls correctly.


Currently ${CDR(duration)} and ${CDR(billsec)} are rounded to nearest integer.

This is not acceptable for most billing issues.

Patch adds ${CDR(rduration)} and ${CDR(rbillsec)} which looks like this:

exten => h,n,NoOp(Real duration: ${CDR(rduration)})
exten => h,n,NoOp(Real billsec: ${CDR(rbillsec)})

   -- Executing [h@context:6] NoOp("SIP/1003-00000000", "Real duration: 9.165070") in new stack
   -- Executing [h@context:7] NoOp("SIP/1003-00000000", "Real billsec: 4.067524") in new stack
Comments:By: David Woolley (davidw) 2010-06-03 09:33:23

You need to submit new features patches against the SVN trunk version.

Most, if not all, legacy PABXes only log durations to a second, and many of them only log start times to a minute, so I think that saying it is not acceptable in most cases is an overstatement, although, as a pure new feature, it is harmless.

There is some risk from the excessive accuracy.  The two sides of a SIP connection could disgree by 100s of milliseconds as to when the call started or ended.  Actually it could be many seconds if the nominal final packet was lost.

By: Leif Madsen (lmadsen) 2010-06-03 10:38:01

This is a new feature, so we won't be putting it in 1.4.

For trunk, someone has a patch for doing something like this already. See this code review: