I've been testing the inclusive minutes feature and found that it works as expected (calls are billed at 0.00/min) unless initblock > 0. If the call is answered (initblock/60)*rateinitial is deducted from the card.
In this example I had a balance of 11, and the route costs 0.02. I could afford 550 minutes, but the 3,000 minutes/month package was added to the call timeout. All works as expected here.
Code:
a2billing.php|1: file:Class.A2Billing.php - line:760 - TIMEOUT::> 213000 : minutes=3550 - seconds=0
a2billing.php|1: file:Class.RateEngine.php - line:960 - app_callingcard: Dialing 'SIP/
[email protected]|60|HRrL(213000000:61000:30000)' with timeout of '213000'.
a2billing.php|1:
a2billing.php|1: file:Class.RateEngine.php - line:985 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
-- AGI Script Executing Application: (Dial) Options: (SIP/
[email protected]|60|HRrL(213000000:61000:30000))
-- Limit Data for this call:
-- - timelimit = 213000000
-- - play_warning = 61000
-- - play_to_caller= yes
-- - play_to_callee= no
-- - warning_freq = 30000
-- - start_sound = UNDEF
-- - warning_sound = timeleft
-- - end_sound = UNDEF
-- Called
[email protected] -- SIP/xxx.xx.xx.xxx-0063da10 is ringing
-- SIP/xxx.xx.xx.xxx-0063da10 answered SIP/xx.xx.xxx.xx-b8004900
And here we see 0.01 being deducted from the user which is the initblock x rateinitial == 30*0.02 == 0.01
Code:
a2billing.php|1: file:Class.RateEngine.php - line:1086 - -> dialstatus : ANSWER, answered time is 61
a2billing.php|1:
a2billing.php|1: file:Class.RateEngine.php - line:1090 - [USEDRATECARD=0]
a2billing.php|1: file:Class.RateEngine.php - line:777 - ft2c_package_offer : 1 ; 180000 ; 180000
a2billing.php|1: file:Class.RateEngine.php - line:791 - :[ID_CARD_PACKAGE_OFFER CREATED : 16]:['3', '2', '61']
a2billing.php|1: file:Class.RateEngine.php - line:848 - [CC_asterisk_stop QUERY = INSERT INTO cc_call (uniqueid,sessionid,username,nasipaddress,starttime,sessiontime, calledstation, terminatecause, stoptime, calledrate, sessionbill, calledcountry, calledsub, destination, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buyrate, buycost, id_card_package_offer) VALUES ('1183042214.1085', 'SIP/xx.xx.xxx.xx-b8004900', 'xxxxxxxxxx', '', CURRENT_TIMESTAMP - interval '61 seconds' , '61', '01xxxxxxxxx', 'ANSWER', now(), '0.02', '+0.01', '', '', 'uk. exeter', '1', '9', '36197', '3', '1xxxxxxxxx', '0', '0.01275', '0.0129116666667', '16')]
a2billing.php|1: file:Class.RateEngine.php - line:851 - [CC_asterisk_stop 1.1: SQL: DONE : result=1]
a2billing.php|1: file:Class.RateEngine.php - line:869 - [CC_asterisk_stop 1.2: SQL: UPDATE cc_card SET credit= credit-0.01 , redial='01xxxxxxxxx' , lastuse=now(), nbused=nbused+1 WHERE username='2xxxxxxxxx']
a2billing.php|1: file:Class.RateEngine.php - line:874 - UPDATE cc_trunk SET secondusedreal = secondusedreal + 61 WHERE id_trunk='3'
a2billing.php|1: file:Class.RateEngine.php - line:878 - UPDATE cc_tariffplan SET secondusedreal = secondusedreal + 61 WHERE id='9'
a2billing.php|1: file:a2billing.php - line:309 - [a2billing account stop]
Not so much a bug I guess, but something to be aware of.