Often in A2billing wholesale setup one might find that A2Billing starts billing for calls too early (before the call is answered). Another frequently asked question is “fake ring”.
Let’s go through each of issues.
A2Billing fake ring
As soon as a call (or call request) is passed to A2Billing it is possible for A2Billing to pass back a ringing tone to the caller, while the call is being processed. By default it’s configured like so. But for wholesale setup this is usually undesirable as you can get a situation when the caller hears ringing, and then maybe an engaged or unavailable tone afterwards when the call is actually placed. This can be confusing.
To turn this off we need to edit the A2Billing dial command. This can be found in the AGI-CONF
that you are using. Go to System Settings -> Global List
and remove the ‘Rr’ from the dialcommand_param
from the AGI-CONF settings like this:
A2Billing Incorrect CDR records
When using A2Billing to place SIP or wholesale calls it’s possible that A2Billing will start billing for a call before it is even answered (resulting in incorrect CDR/billing records). The reason that this happens is that Asterisk is answering the call, when it doesn’t need to. It only needs to answer the call if you want to play audio to the caller (balance, time remain etc) but you would not normally do this for SIP/wholesale calls.
If you have this problem here are things to check –
1 – Asterisk dial plan not answering the call
Ensure that in your Asterisk dial plan (this will vary depending how you’ve got A2Billing set up) that the context that SIP calls are getting passed to does not have an ‘Answer’ line in it. The context I use is called ‘a2billing-sip’ and here is the entry in my /etc/asterisk/extensions.conf
–
[a2billing-sip]
exten => _X.,1,AGI(a2billing.php,2)
exten => _X.,n,Hangup
Note that this is putting the call through to A2Billing agi-conf2, which will be useful in the next step.
2 – A2Billing is not set to answer the call
In the AGI-CONF that you are using for the SIP calls ensure that ‘answer_call
’ is set to no –
3 – Ensure there is no ‘H’ on the Asterisk dial command
As in the fake ring section above I’ve found that having a ‘H’ in the A2Billing dialcommand_param
can cause Asterisk to answer the call and cause incorrect billing. If you still have the issue after trying number 1 and 2 above then try taking the ‘H’ out of the dialcommand_param
in the AGI-CONF that you are using.