Does somebody know how billsec cdr field calculates the billed seconds?
Im currently having differences with multiple endpoints, not in call amount but billed seconds,
2/3 of the amount of calls seems to be adding 1 seconds to the total billed seconds.
Does billsec
Always round up? Ex: 0.1s → +1sec
Round up after 0.5 seconds? Ex: 0.4s → 0s, Ex: 0.5s → +1sec
Always round down? Ex: 0.9s → 0s
If billsec is rounding, is there a way to modify rounding mechanics?
Any suggestions or advices will be greatly appreciated
Warm Regards
The code states how billsec is actually calculated[1] and here is the function that does it[2]. You should be able to use those to better understand what is going on, and if modifications are desired where they would need to occur.
Does billsec
Always round up? Ex: 0.1s → +1sec
Round up after 0.5 seconds? Ex: 0.4s → 0s, Ex: 0.5s → +1sec
Always round down? Ex: 0.9s → 0s
I believe that “always round up” is the standard answer for Telcos, therefore
is probably what Asterisk does (but I’ve not looked at the source code).
If billsec is rounding, is there a way to modify rounding mechanics?
Well, it’s definitely rounding by one means or another. Which CDR storage
system are you using? There are ways to get it to include microseconds, which
you can then round however you like.
The code seems to round down, or to nearest, with 0.5 going to 1.
Historically, telcos used to round up to minutes, or to meter pulses, rather than to seconds. I think some used sub-multiples of the meter pulse interval in the actual measurements.
Also, the two ends will never exactly agree on when calls start and end, so there will always be discrepancies.
Please use text, not images. That description is wrong. The actual code, which is very simple, uses milliseconds, not microseconds, always uses them, and that option selects between round down and round to nearest, with 0.5 rounding up.