Rates
In versions of A2Billing 1.9.5 or later, There are two modes of rating which are selected in the appropriate agi-conf under LCR_MODE - valid values are 0 (Classic Mode) or 1 (Provider Mode)
Classic
This mode will take the dialled digits, and use the rate according to the longest match. Where there are two or more matches of the same length, the cheaper rate is chosen. When the Call-Plan is in LCR mode, it will select the cheapest Sell Rate, when in LCD mode, it will select the cheapest Retail Rate.
Provider
This mode will select the longest match from every rate card in the call-plan, and then apply the cheapest rate. When the Call-Plan is in LCR mode, it will select the cheapest Sell Rate, when in LCD mode, it will select the cheapest Retail Rate.
RATECARD
Select the Rate Card in which this Rate belongs.
DIALPREFIX
A) Add destination prefixes, ie '441' for UK Landlines. B) Use 'defaultprefix' to setup a rate for all destinations where a specific rate is not provided. C) if you ADD a rate, NOT an EDIT, you can define a range of prefixes. '32484-32487' adds all prefixes between 32484 and 32487. '32484,32386,32488' would add only the individual prefixes listed. D) Asterisk extensions style + POSIX regex syntaxes are supported. '_447[7-9]XXXXXXXX' matches 12-digit UK mobiles. '_X{0,3}(112|999|911)' matches any 0-3 digits followed an emergency number. '_' can be used to add length, and raise the priority.
DESTINATION PREFIX
Select the prefix destination corresponding to your prefix rate.
The Destination Name comes from the Prefix list. The prefix list will be updated as you import rates. This has no effect on the rate charged, just the label applied in the CDR and the rates list.
Set the carrier cost for this destination.
Set the carrier cost for this destination.
BUYING RATE
Set the carrier cost, the price you pay for minutes.
BUYRATE MIN DURATION
Set the minimum duration charged by the carrier. (i.e. 30 secs)
BUYRATE BILLING BLOCK
Set the billing increment, in seconds (billing block), that the carrier applies. (ie 30 secs)
Define the selling cost for customers
SELLING RATE
The retail rate; or the cost per minute to apply to the customer, e.g. 0.02
SELLRATE MIN DURATION
Set the minimum duration to charge the customer (ie 60 seconds)
SELLRATE BILLING BLOCK
Set the billing increment in seconds to bill your customer.
CONNECT CHARGE
Apply a connection charge
DISCONNECT CHARGE
Apply a disconnection charge
DISCONNECT CHARGE THRESHOLD
Apply the disconnection charge if the call duration is greater than this amount of seconds. If 0, it will always apply.
MINIMUM CALL COST
Apply a minimum charge for the call.
Below we have the section to create progressive rates.
Progressive rate aims to bill the customer at various rates according the duration of the call. For instance you can define that you can to bill the customer 0.33dollars for the first 2 minutes and then you want to bill him 0.45dollars for the rest of the call.
STEPCHARGE A
When entering in the cycle 'A', define the amount to charge for the entrance.
CHARGE A
When entering in the cycle 'A', define the rate to apply.
TIMECHARGE A
Define the duration of the cycle 'A'.
BILLING BLOCK A
Define the duration of each billing block to apply the rate 'CHARGE A'.
STEPCHARGE B
When entering in the cycle 'B', define the amount to charge for the entrance.
CHARGE B
When entering in the cycle 'B', define the rate to apply.
TIMECHARGE B
Define the duration of the cycle 'B'.
BILLING BLOCK B
Define the duration of each billing block to apply the rate 'CHARGE B'.
STEPCHARGE C
When entering in the cycle 'C', define the amount to charge for the entrance.
CHARGE C
When entering in the cycle 'C', define the rate to apply.
TIMECHARGE C
Define the duration of the cycle 'C'.
BILLING BLOCK C
Define the duration of each billing block to apply the rate 'CHARGE C'.
ANNOUNCE TIME CORRECTION
Define the multiplier on announce time for clients.
Define the period when this rate table is active.
START DATE
Format YYYY-MM-DD HH:MM:SS. For instance, '2004-12-31 00:00:00'
STOP DATE
Leave empty to apply this rate indefinitely. Format YYYY-MM-DD HH:MM:SS. For instance, '2004-12-31 00:00:00
START TIME
Set the time and day of the week at the rate is first valid (ie Monday 00:00 is 0)
END TIME
Set the time and the day of the week that the rate is no longer valid. (ie Sunday 23:59 is 10079)
Miscellaneous
ROUNDING CALLTIME
Set the rounding calltime. All the selling rules will apply over this new calltime.
ROUNDING THRESHOLD
Set the rounding threshold
ADDITIONAL BLOCK CHARGE
Set the initial block charge
ADDITIONAL BLOCK CHARGE TIME
Set the initial block charge time
ADDITIONAL GRACE TIME
Set the additional grace time in sec
TRUNK
Set the trunk to use for this destination, or NOT DEFINED to use the rate card trunk.
CIDGroup
Set the Outgoing CID Group to use for this destination, or NOT DEFINED to use the rate card trunk.
TAG
Set a tag on this rate
MUSICONHOLD
select a music to use in announcement
EXTRA INFORMATION ON ADDITIONAL CHARGES ON REALTIME BILLING
1) Rouding calltime
We will need 2 new fields in the ratecard to define this,
- rounding_calltime will define the new calltime that will be assigned to this call, for instance 360 (6 minutes)
- rounding_threshold that will define the amount in seconds from which the rounding calltime will apply for instance 300 (5 minutes)
** take note that if the call last 7 minutes if the rounding_calltime is less than the current
calltime we dont round down the calltime
Example : I make a call of 5 minutes to Belgium, the rate is 0.1$ per minutes, I have normally to pay 0.5 for this call now the ratecard will be configure with rounding_calltime = 360 - 6min and rounding_threshold will be set to 240, so 4min, the rateengine will see that my current calltime (300) is upper than the defined rounding_threshold and so it will round the call to the new calltime, rounding_calltime = 360
so my call will be rated to 0.6$ instead of 0.5
2) Additional Block charge
This is an additional charge that will be apply according to the duration of the call and the amount of "time block" inside the the calltime. We will need 2 new fields in the ratecard to define this,
- additional_block_charge that will define the charge amount, ie 0.50 cents
- additional_block_charge_time that will define the amount of seconds from which we have to apply this new charge, we will count the amount of time this block of time can be contain inside the calltime and apply the charge accordingly to this.
Example : additional_block_charge_time = 300 (5 minutes) if the call last 360 seconds, the additional_block_charge_time is contains 1 time so we apply this charge once.
If the call last now 660 seconds (11 minutes), the additional_block_charge_time (5min) is contains 2 time so we will apply this charge 2 time too (2 time 0.50 cents)
