[asterisk-bugs] [Asterisk 0013366]: CDR billsec value accuracy

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Aug 24 10:36:01 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13366 
====================================================================== 
Reported By:                erousseau
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13366
Category:                   CDR/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.21 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-08-22 19:34 CDT
Last Modified:              2008-08-24 10:36 CDT
====================================================================== 
Summary:                    CDR billsec value accuracy
Description: 
We are using CDR for billing and we are now comparing billing information
from Asterisk CDR and billing information bringed by our PSTN operator. 

We have to face a minor but critical issue regarding the billsec value
accuracy. 

For some calls, the billsec value bringed by the operator is 1s more than
the billsec value reported by Asterisk in CDR. 

On the PSTN operator side, the billing process charges any second that has
been initiated. Meaning that for a call that took (billsec) 62.3 s (62 s
and 300 ms) the operator will report and charge a billsec value of 63.

I have looked the core code from Asterisk source and found the following
in main/cdr.c :

cdr->billsec = ast_tvzero(cdr->answer) ? 0 : cdr->end.tv_sec -
cdr->answer.tv_sec;

Imagine that cdr->end.tv_usec give 0.9s and that cdr->answer.tv_usec give
0.1s. The billsec value (as calculated by Asterisk) looks like simply
ignore the 0.8s that come from the tv_usec value difference...
====================================================================== 

---------------------------------------------------------------------- 
 (0091679) Corydon76 (administrator) - 2008-08-24 10:36
 http://bugs.digium.com/view.php?id=13366#c91679 
---------------------------------------------------------------------- 
Some of this is addressed in 1.6, where the accuracy of billsec and
duration will be correct down to the millisecond, so appropriate rounding
may take place at a later time.  Note that this is only available on CDR
drivers which support the new accuracy (most of the stock drivers,
actually) and on database tables which allow either decimals or floats in
the duration/billsec columns. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-24 10:36 Corydon76      Note Added: 0091679                          
======================================================================




More information about the asterisk-bugs mailing list