Setting up callback in A2Billing can be a tricky thing!
Here I’ll do a walk through that will hopefully get you at least some of the way.
This VPS template already has the following set up (if you are using your own installation you will need to ensure this) –
As I said the setting above are already included on the SysAdminMan VPS. One change we need to make is tell A2Billing which country the callback will be happening in. This is because the Caller ID will normally be presented without the country code, and we need to add that on to give A2Billing the correct number to dial.
My callback access number is going to be in the UK so I’m going to edit the context above and set the callback area code to ’44’. Don’t forget to reload Asterisk after making the change –
I’m also going to assume you have the following set up already –
SETTING UP THE ACCESS NUMBER
First we need to pass the inbound call to A2Billing. To do this I am going to create an Inbound Route in FreePBX and initially set the destination to ‘Terminate Call / Put caller on hold forever’ –
This is a great first step as it means we can call the number and should get music-on-hold. If we have any problems at this stage we know it’s absolutely nothing to do with A2Billing.
So, give the access number a call, make sure you get music, and then check in the FreePBX CDR reports and check that your CLID number is being presented (so that A2Billing will know where to call you back) and what format it’s in –
If your access number works OK then change the Inbound Route destination to a2billing-cid-callback –
ADDING THE CALLER ID TO THE A2BILLING CUSTOMER
Now that our inbound call is working we need to tell A2Billing that if a call comes in with a certain caller ID it belongs to a specific customer. To do this edit the A2Billing customer and add the caller ID. We must add the caller ID in the format it it being presented by our DDI provider –
GIVING IT A GO
If you call your access number now you should get a couple of rings and then the call gets disconnected. You should see an entry getting added in A2Billing to CALLBACK/Add –
So, I got my entry in the callback queue but there are 2 problems with it! The first is that the number it’s trying to call is 44447… As my DDI provider presents the number in an international format there is no need for me to add it on again. So I can edit the extensions_custom.conf file above and remove the ’44’ that I added on to the a2billing-cid-callback context. You must reload Asterisk following this change –
The second problem is that the call stays as ‘PENDING’. The callback daemon should be running every minute and picking up that entry and making the call. As it’s not changing from ‘PENDING’ we know it’s not doing this. Sometimes the callback daemon will start before MySQL, or loses its connection to MySQL. You can resolve this by restarting it –
And that’s it. I can now call the access number and a callback entry gets created –
The system then calls me back and tells me my balance and asks me to type the number I want to call. You must enter the number to call in a format that A2Billing understands (in other words it must work in the simulator – http://sysadminman.net/blog/2011/a2billing-troubleshooting-ratecard-simulator-2407)
Hopefully that will get you started, but it’s by no means easy. I hope to write a further post with some troubleshooting tips.
Be aware that if you plan on doing this in Elastix then that has an old version of A2Billing (and doesn’t have the callback daemon installed by default) so it’s likely to be much more complicated.