[asterisk-users] CDR accuracy
Gerald Begumisa
gbegumisa at gmail.com
Wed Aug 13 08:11:21 CDT 2008
I think that the most appropriate answer for this would be it depends
on your setup and requirements.
Some of our customers bill all answered calls for the entire minimum
duration/increment (even if duration is 0) while others have
configured a rule not to bill all calls whose duration is less than a
certain threshold.
www.yo.co.ug
On 8/13/08, Klaus Darilion <klaus.mailinglists at pernau.at> wrote:
> Steve Murphy wrote:
>> On Tue, 2008-08-12 at 16:39 +0200, Klaus Darilion wrote:
>>> Hi!
>>>
>>> I wonder how Asterisk measures the call duration. The CDR files have a
>>> accuracy of seconds. Thus, what happens if the call duration is 0.3
>>> seconds. What will Asterisk report? 0 seconds? 1 second?
>>>
>>> What logic will be used by Asterisk: floor? ceil? round?
>>>
>>> thanks
>>> klaus
>>
>> Klaus--
>>
>> The duration/billsec fields are stored as simple integers.
>> A simple integer subtraction is performed for both; duration
>> is end time minus start time; billsec is end time minus answer time.
>>
>> Operations are done on system time, in seconds. If the .3 sec spans
>> a system second increment, then the time will be 1, if not, then the
>> time will be 0. It would seem to me the probability of .3 sec spanning
>> a clock tick would be .3...
>>
>> CDR's do, internally, store finer increments than seconds. (struct
>> timeval),
>> but the interface yields plain seconds. I just checked the code, and
>> sure enough, just the seconds field is used. So, truncation seems to be
>> the rounding method.
>>
>> In general, we never fussed much about the microseconds, because on
>> most interfaces, the slop in how much time it took to make a connection
>> made the precision laughable.
>
> Hi Steve!
>
> Thanks for the detailed information. What about the following scenario:
> ANSWER and HANGUP happens in the same second. Thus, the call duration
> will be 0 seconds. How are such use cases usually handled in the billing
> system? Are you billing the user (e.g. 1 second or the minimum fee) if
> the call is ANSWERED even if Asterisk reports 0 seconds?
>
> regards
> klaus
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2008 - September 22 - 25 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
--
Sent from Gmail for mobile | mobile.google.com
More information about the asterisk-users
mailing list