How to use both pinless dialing and calling card feature on a2billing

Written by admin on November 22, 2014. Posted in A2billing

A number of clients keep asking me how to have calling card feature run together with pin-less dialing.  This article is a text follow up of a video i am doing on the process the article must be read together with the video.

The secret is in the agi-conf files. This is the file that tells a2billing how to handle calls. You will need to create a second agi-conf file in a2billing admin panel.

To do this navigate to SYSTEM SETTINGS >>Add agi-conf

Before you proceed with any thing  login to your ssh and do the following


# nano /etc/asterisk/extensions_custom.conf

make sure at the end of the file you have the following:

exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit
exten => _X.,1,deadAGI(a2billing.php,1,voucher)
exten => _X.,n,Hangup
exten => _X.,1,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup
; Used by Calling Card Platform for incoming calls
exten => _X.,1,AGI(a2billing.php,2)
exten => _X.,n,Wait()
exten => _X.,n,Hangup()
Click CTRL+X  to save
# amportal restart
Notice that we have use agi -conf2 file for calling cards.
custom-a2billing is for pin-less dialing while a2billing-cc is for calling cards.
Next you need to create these custom destinations in FreePBX via FreePBX GUI>Tools>Custom Destinations

Custom Destination: custom-a2billing,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Callthrough

Custom Destination: a2billing-cc,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Calling cards
Custom Destination: a2billing-voucher,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Voucher
Go to Inbound routes and forward your access numbers to a2billing-cc
Also forward your voucher topup DID to a2billing voucher
Go back to a2billing admin panel and make sure you turn DNID to "no" and Enable CID to "no" in agi-conf2.
That's it your SIP clients can now use pinless dialing while your calling card customers can do so via the access numb