|
Most usage charges are stored in various billing databases as per MINUTE of use, not per 6 seconds of use. 6 second billing simply means that you bill in decimal fractions of a minute, 66 seconds becomes 1.1 minutes.
1. Divide your billsec value by 60 and round to 1 decimal place. Add 0.5 to the result and then round if you want to round UP, that way 61 seconds is still 1.1 minutes. 2. Multiply the result times your per minute of use charge.
The reason 6 second billing is often used is because it translates easily into decimal minutes J
Billminutes=round((billsec/60)+0.5),1) Charge = round(billminutes*minutecharge,2)
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vicky
This is more of mysql question then asterisk :D . Most voip providers
use 6 second rounding for costing . My asterisk server stores call cdr's
in mysql properly with billsec field containing number of billed seconds . I
want to know some function to round this to 6 seconds ( or any custom valud
like 30 seconds ) ..Suppose if billsec field is 3 seconds then it should round
to 6 seconds , if its 13 second then it should round up to 18 seconds ( for
6sec pulse counting ) . What would be mysql function to do this ? |
_______________________________________________ --Bandwidth and Colocation provided by Easynews.com --
asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
