Getting started with A2Billing – Part 4 Creating a customer and making a call
So we’ve created a trunk to make calls through here, we’ve created a ratecard and call plan here and we’ve created an access phone number here so we’re finally ready to create a customer!
Creating a calling card customer
Click on CUSTOMERS on the left hand menu
Click Create Customers
We get a big list of options but the only things we need to set are -
BALANCE – set the inital balance for the customer
CALL PLAN – ensure the call plan is set to the one we created here
LASTNAME & FIRSTNAME – not required but definitely useful!
Then click on CONFIRM DATA


There are obviously a lot more settings I can use when configuring a customer but if I click on List Customers I can see my customer is setup

So, lets give it a go!
I ring my access number 12532433498 (configured here)
and it asks for my PIN number so I enter 1137742329 (my card number created above)
I now get the message “Please enter the number you wish to call and then enter the pound key” so I dial 011441162572850# (remember I can only dial numbers in Leicester in the UK for now as that is the only rate we created here) and my call is made!
Now, a couple of things have also happened.
If I click on CALL REPORT and then CDR Report I can see that a record has been made of the call plus the call charges -

and also if I click on CUSTOMER, List Customers and then click on EDIT next to my customer -

and then scroll down to the bottom I can see that my CLID has been added to my customer record (this is becuase cid_enable and cid_auto_assign_card_to_cid have been enabled in a2billing.conf). This means that next time I call the system from my phone it will know who I am and I will not need to enter my pin number again.

Related posts:
- Getting started with A2Billing – Part 3 Creating an access DID
- Getting started with A2Billing – Part 2 Ratecards and Call Plans
- Part 6 – Create a customer in a2billing on Elastix

John:
I have set up everything and it’s working except one thing – when I dial the pin number and then phone number, I hear message “The number you trying to reach is currently unavailable”. How do I fix this?
1 March 2010, 6:41 pmmatt:
Sounds like maybe your trunk is not working correctly. Does the call appear in the call reports?
1 March 2010, 8:22 pmJohn:
No, when I dial the number with the dial prefix 1212 I near the message “The number you trying to reach is currently unavailable”. When I dial the same number with 0111212 I hear the number of minutes left for the call (system calculates the time correctly based on the rate I set up but right after that the message about the number being unavailable follows). Trunk configuration:
username=XXXXXXXXX
type=friend
secret=XXXXXXXXXXXX
insecure=very
host=sip.callwithus.com
dtmfmode=rfc2833
context=from-trunk
Asterisk SIP info under Tools shows that Asterisk registered with CWU. Not really sure what’s wrong.
1 March 2010, 9:21 pmmatt:
What is the prefix for? Are you dialling a number in the US that starts 1212?
If so it looks like your calling card is expecting to have 01 on the front of the number but I’m not sure that callwithus is. You could edit the cwu trunk in a2billing and try removing that 01 prefix.
2 March 2010, 7:06 amJohn:
Actually the CWU trunk seems to be working fine with both international and U.S. numbers. In fact, I am able to dial all numbers when calling via X-Lite with 011 prefix (including U.S. numbers); I dial 011+1+212 for New York, and I dial 011+44+XXX for the UK. So, the trunk is working fine, and CWU is accepting 011 prefix, but for some reason, the call is going through when the number is dialed via calling card gateway. I searched online and discovered that I am not the only one having exactly the same problem, but noone seems to know what to do. I think something is wrong with the configuration of a2billing itself, but don’t know what.
2 March 2010, 8:05 ammatt:
Does the trunk name you’ve used in a2billing match the name you’ve used in freepbx?
If so I think the only option would be to switch on the debug in a2billing for the agi-conf that you are using and see what the logs think is going on.
2 March 2010, 8:57 amJohn:
I have fixed it, finally and can make calls via calling card gateway. Thanks.
2 March 2010, 5:02 pmahmed:
Hi matt, i have my trunk and extensions working. when i call my DID the call comes to FreePBX i can send it to one of my extensions just fine. but when i try to send it to a2billing it gives busy signal. what do you think where my problem is?
3 May 2010, 10:10 pmany help is greatly appreciated
matt:
How are you putting the call through to a2billing? Doing something like this – http://sysadminman.net/blog/2009/integrating-freepbx-with-a2billing-621
4 May 2010, 7:08 amPhillip:
Hi matt
Everything is working correctly, the only issue i have is that once the balance of a card reaches 0, the clid is still stored on this card. So everytime i call in with this clid i get the message that “i dont have enough credit to make a call”. Is there a way to remove cards with 0 balance from the system?
thanks
9 December 2010, 10:11 ammatt:
Hi Philip,
Do you mean remove the cards automatically? You can obviously remove them manually through the GUI, or you could just remove the associated CLID.
If you mean automatically then I don’t think so. Not sure you’d want to do that anyway as wouldn’t you want them on there in case they decided to top up?
9 December 2010, 4:27 pmPhillip:
Hi Mat
Yes i mean automatically, when a subscriber calls in for the first time and enters his pin number, his CLID is associated with that card, but when that cards balance goes to 0 the association of his CLID is still there, regardless of whether he enters a new pin number the system will not associate the new card with the CLID since it already exists (in the 0 balance card) and the customer has to keep on putting in his new pin number. Therefore, i would like either to remove that association or remove the card automatically. I guess i would need to make a script for that right?
10 December 2010, 6:44 amPhillip:
Hi Mat
I set the Not Enough Credit and New Caller ID to YES. This resolved what i wanted to do. Now when a client doesnt have enough balance and enters a new pin number the new pin number is associated with the CLID and removed from the old pin number.
10 December 2010, 9:28 amPhillip:
The only thing im having an issue with now is that i get negative balance on some accounts, have you encountered this before?
10 December 2010, 9:30 amrachna:
Hey!
I am very new to A2billing and Asterisk. Just want to know I need to do 2 things:
1)Customize the web interface of A2Billing and
2)Customize some features provided by A2Billing
what is the first step , how should i get started?
10 April 2011, 5:27 pmThx
Rachna
matt:
Hi Rachna,
1 – Basic A2Billing customisation can be done by editing templates and CSS.
2 – What features did you want to customise?
I suggest getting started by setting up a2billing (or renting a preconfigured server! – http://sysadminman.net/sysadminman-freepbx-a2billing-hosting.html) and start going through some of the guides here – http://sysadminman.net/documentation.html
10 April 2011, 9:15 pmrachna:
Thanks for the quick response.I want to reduce the number of features showing on a2billing interface and specifically need to customize the reseller panel.
13 April 2011, 4:38 pmrachna:
Hi Matt,
Can you clarify if a2billing gives a feature where you can create mult-level agents?
This is one of my main requirement.
Thanks
10 May 2011, 5:50 pmRegards
Rachna
matt:
I’m pretty sure that agents cannot have ‘sub-agents’ but I would check over at the forum for a definitive answer – http://forum.asterisk2billing.org/
10 May 2011, 7:39 pmRoberto:
Hi Matt,
I´ve configured everything as you suggested and have come across the following issue
After the pin authentication is performed the system doesn´t prompt me for the destination number but tries to dial the DDI number instead. So weird!! Do you know what could be wrong?
Thanks!
7/07/2011 14:14:50]:[file:a2billing.php - line:106 - uniqueid:]:[CallerID:]:[CN:]:[IDCONFIG : 1]
27 July 2011, 3:23 pm[27/07/2011 14:14:50]:[file:a2billing.php - line:107 - uniqueid:]:[CallerID:]:[CN:]:[MODE : standard]
[27/07/2011 14:14:50]:[file:Class.A2Billing.php - line:718 - uniqueid:1311768888.6]:[CallerID:4252010344]:[CN:]:[ get_agi_request_parameter = 4252010344 ; SIP/callcentric-00000006 ; 1311768888.6 ; ; 17772822007]
[27/07/2011 14:14:50]:[file:a2billing.php - line:162 - uniqueid:1311768888.6]:[CallerID:4252010344]:[CN:]:[[ANSWER CALL]]
[27/07/2011 14:15:04]:[file:a2billing.php - line:193 - uniqueid:1311768888.6]:[CallerID:4252010344]:[CN:6442846455]:[[CHANNEL STATUS : 6 = Line is up]
[CREDIT : 10.00000][CREDIT MIN_CREDIT_2CALL : 0]]
[27/07/2011 14:15:04]:[file:a2billing.php - line:396 - uniqueid:1311768888.6]:[CallerID:4252010344]:[CN:6442846455]:[TARIFF ID -> 2]
[27/07/2011 14:15:04]:[file:Class.A2Billing.php - line:881 - uniqueid:1311768888.6]:[CallerID:4252010344]:[CN:6442846455]:[[CALL 2 DID]]
[27/07/2011 14:15:04]:[file:Class.A2Billing.php - line:896 - uniqueid:1311768888.6]:[CallerID:4252010344]:[CN:6442846455]:[DESTINATION ::> 17772822007]
[27/07/2011 14:15:04]:[file:Class.A2Billing.php - line:1017 - uniqueid:1311768888.6]:[CallerID:4252010344]:[CN:6442846455]:[ERROR ::> RateEngine didnt succeed to match the dialed number over the ratecard (Please check : id the ratecard is well create ; if the removeInter_Prefix is set according to your prefix in the ratecard ; if you hooked the ratecard to the Call Plan)]
[27/07/2011 14:15:04]:[CallerID:4252010344]:[CN:6442846455]:[[exit]]
matt:
You should check a setting called use_dnid in the agi-conf you are using. I think it is set to Yes and should be No.
27 July 2011, 3:26 pmRoberto:
Many thanks Matt, It works now!
27 July 2011, 3:46 pmRoberto:
Matt, sorry to bother you again
29 July 2011, 12:09 pmI´ve set up the “say_balance_after_auth” and “say_timetocall” keys to YES in agi-conf1 but when I make a call the system only prompts me to enter the pin and destination number
I´m using EN as default language
I must be missing something in the config but can´t figure it out
Thanks
Roberto:
Matt, sorry to bother you again
29 July 2011, 2:16 pmI´ve set up the “say_balance_after_auth” and “say_timetocall” keys to YES in agi-conf1 but the system only prompts me for the PIN and destination number. It doesn´t provide the balance or time info
The base language is English
Maybe I´m overlooking something in the A2B config
Thanks!
matt:
There’s an overall play_audio setting that needs to be yes. Other than that I can only think of 2 things – the audio prompts are not installed, or you are not using agi-conf1?
29 July 2011, 6:40 pmRoberto:
“play_audio” setting is the winner today. Thanks for making my life much easier
)
30 July 2011, 8:33 am