Have you ever thought of having it so only certain extensions are sent through a2billing? For example I have about a dozen or so extensions at my house that I don't want to pass through the system. Or are you going to just use a certain account code for all of your internal extensions and put a certain credit amount on that? I haven't worked with a2billing and the last time I tried I was a little overwhelmed on how to set it up, so I'm really enjoying this so far!
The methodology used to rate an inbound call is somewhat convoluted.
If you use any product in the way that it was not designed to work, then problems can be expected.
For this adventure in A2Billing, we will activate another cool part of our Family Telephone System platform.
In an earlier article I mentioned that A2Billing is a great platform for calling card services. Calling Card services allow a user to call into the PBX, authenticate themselves, and then place outbound calls from the PBX which are billed to their A2B account.
In our case, we can think of it as being rather like DISA with billing.
Overview
For a variety of reasons, it can be very desirable to be able to call into your PBX, get a dial-tone, and make an outbound call. So desirable in fact that FreePBX has DISA to facilitate that very thing. However – DISA isn’t billed – and that’s not going to work.
What we need is a DISA like solution that keeps A2Billing happily in the loop and rating (billing) these calls.
Here are the general steps we need to take to accomplish this.Creating the agi-conf
- Have an available DID to use for the inbound calls.
- Create a new agi-conf context to be used to configure the behavior of A2B when it is handling calling-card calls.
- Create a Custom Destination for the new agi-conf context.
- Create a new context to route the inbound Calling Card DID to the new agi-conf context.
- Configure A2B with users CID to allow for pass-through authentication in A2B. This way, the inbound callers’ caller id is used to authenticate them – and they are not prompted to authenticate by entering their card number.
The agi-conf contexts determine specific behaviors related to how A2B processes the calls run through it. We will create one designed for the Calling Cards behaviors. In FreePBX, Tools, Config Edit, open a2billing.conf.
Near the bottom of the file, you will find the context called agi-conf1. This context was setup and configured during a previous article – to reflect the behavior we wanted for outbound calls. Review those settings briefly to recall your previous decisions.
Now, in the editor, copy the context agi-conf1, and paste it immediately below. Change the context name of the newly pasted version to [agi-conf2].
Within the newly created agi-conf2 context, locate the line:
use_dnid = YES - and change it to use_dnid = NO
When you have made the change, click UPDATE to save your changes.
Since the rest of the settings in the agi-conf2 file are based on your previous decisions for outbound call behaviors (from agi-conf1) – there’s little benefit the changing any of the other settings. By leaving them, your users will experience very similar outbound call behaviors from both inside the system, and when using calling card services.
Creating the Calling-Card Dial Plan
Eventually we have to provide a FreePBX destination that gets the inbound calling-card user into the a2b agi-conf2 context that we created above. To do that, we will edit another config file in the FreePBX Config Editor: extensions_a2billing.conf.
You will recall in a previous article we created 2 contexts at the bottom called [custom-a2billing] and [custom-a2billing-did], which we had based on the contexts at the top of the file called [a2billing] and [a2billing-did]. Those previously created contexts are used by A2B to process our inbound and outbound calls right now.
At the bottom of the extensions_a2billing.conf file, paste the following new context:
[custom-a2billing-2]
;For call through service
exten => _X.,1,Answer()
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php|2)
exten => _X.,n,Hangup
This context is based on our [custom-a2billing] context, with some changes and additions.
Because this context will be used by a process that plays a sound file, we have added the ANSWER line as the first line of the context. (Its not desirable in the [custom-a2billing] context because that context only transfers calls.)
Because we want the line to finish connecting and stabilize before beginning the outbound sound file playback, we added the WAIT line as the second line.
Lastly, we changed the final digit in the deadAGI line from 1, to 2. This is the change that actually directs the call to use the agi-conf2 context we created in the previous step.
When you have made the change, click UPDATE to save your changes.
Creating the Calling Card Custom Destination
We must expose the new agi-conf2 context in FreePBX so that the Calling-Card DID can be routed to it. From Inside FreePBX, Tools, Custom Destinations, select Add Custom Destination.
Create a New Custom Destination with the following characteristics:
Custom Destination: custom-a2billing-2,${EXTEN},1
Description: A2Billing Calling-Card
And Submit changes to save your work.
You will notice that the Destination context we specified is the exact name of the context we created in extension_a2billing.conf in Creating the Calling-Card Dial Plan, above.
Direct the Calling-Card Access DID to the AGI-CONF2 Context
The last piece of this puzzle is to direct the Calling Card DID to the new Custom Destination.
From Inside FreePBX, Setup, Inbound Routes, decide if you are going to add a new DID route, or modify an existing one. Either way, Set Destination of the inbound route to:
Custom Destinations: A2Billing Calling Card
When you have made the change, click Submit to save your changes. Then Apply and confirm your configuration changes.
Pick up any phone, and dial into the Calling Card DID. You should be prompted by recording to enter your Card Number. Punch in any A2B account card number that has credit enough to make a call. You should be asked for the destination phone number – which signals that you have been successful. Test it by entering a valid card number and making a call.
When you have proven that our work so far has been successful, we will add another cool feature – what I call A2Billing pass-through authentication.
Short answer, yes it can.Can A2billing be installed and configured simply by running a script?
(hp 5.2 is still in the testing repository purely because insufficient people have installed it and reported back their usage to the CentOS-devel mailing list.)
sent into invalid extension 9095555555 ' in context ' custom-a2billing-2', but no invalid handler
[custom-a2billing-2]
;For call through service
exten => _X.,1,Answer()
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php|2)
exten => _X.,n,Hangup
[custom-a2billing-2]
;For call through service
exten => _.,1,Answer()
exten => _.,n,Wait(1)
exten => _.,n,deadAGI(a2billing.php|2)
exten => _.,n,Hangup
[custom-a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php|1)
exten => _X.,n,Hangup
[custom-a2billing-2]
exten => _.,1,Answer
exten => _.,n,Wait(1)
exten => _.,1,deadAGI(a2billing.php|2)
exten => _.,n,Hangup
Link up your team and customers Phone System Live Chat Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.