I have found a solution here
http://forum.asterisk2billing.org/viewt ... r&start=15
but there is still a problem.
First, let me explain my setup:
In FreePBX I created an extension (i.e. 2003) and changed the DIAL parameter to local/14445556666@outbound-allroutes
Next I created an Inbound route with DID/CLI (example: 12223337777/1234567890) and set the destination to call extension 2003.
I then followed the instructions in the above-mentioned topic.
When I tested my setup by watching debug log I noticed that the system was dialing destination number 144445556666 correctly by a2billing.php. However, as soon as it connects to the destination A2B terminates AGI and the balance is not deducted from customer account.
I then tried using SIP extension in FreePBX the same destination number but this time it worked perfect. A2B kept track of length of call and properly deducted the amount from customer's account.
Does any one know what changes should I make in FreePBX or some where else to make it work?