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

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Aug 26 10:48:53 CDT 2008


The following issue has been RESOLVED. 
====================================================================== 
http://bugs.digium.com/view.php?id=13366 
====================================================================== 
Reported By:                erousseau
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   13366
Category:                   CDR/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     resolved
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:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-08-22 19:34 CDT
Last Modified:              2008-08-26 10:48 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...
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-26 10:48 svnbot         Status                   new => assigned     
2008-08-26 10:48 svnbot         Assigned To               => murf            
2008-08-26 10:48 svnbot         Status                   assigned => resolved
2008-08-26 10:48 svnbot         Resolution               open => fixed       
======================================================================




More information about the asterisk-bugs mailing list