Getting started with A2Billing – Part 3 Creating an access DID
Now we’ve got a trunk setup and a rate card and call plan we need a way for our potential customers to actually connect to our system! One way for them to do this is via an access phone number. To test this I’m going to use the IPKall DID we setup here in FreePBX.
This assumes that FreePBX has been setup with some a2billing custom destinations as described here – http://www.freepbx.org/forum/freepbx/installation/inbound-sip-trunk-doesnt-call-extensions. Sysadminman VOIP VPSs are preconfigured for this.
Setting the inbound access number (DID) in FreePBX
This is changing the access DID we created here
In FreePBX click on Inbound Routes on the left hand main menu
Then select “ipkall” (the DID we created here)

Scroll down to the bottom of the page and change the Destination to “Custom Destinations – a2billing” then click Submit

Don’t forget to click on “Apply Configuration Changes”
Now if we dial our IPKall DID we should be asked by a2billing to “Please enter your complete PIN number”
![]()
Last updated by .
Related posts:
- Getting started with A2Billing – Part 4 Creating a customer and making a call
- Getting started with FreePBX – Part 4 Setting up a DID number
- Getting started with FreePBX – Part 5 Setting up an IVR
Avaialble systems include FreePBX, PBX-in-a-Flash, Elastix, A2Billing and FusionPBX.
More details and prices can be found at sysadminman.net

mepj:
Hi,
14 June 2009, 2:30 amI was just wondering how you created a2billing “custom destination” as you did not make mention of steps to create it. I tried to create it but it turned errors only.
thank you.
Mepj
matt:
Hi Mepj,
I have made a post here describing how to create those destinations. It does involve editing some config files on the server.
Regards, Matt
15 June 2009, 7:34 pmmepj:
thank you Matt, i tried the guide to create the custom a2b in freepbx but when I dial into the system nothing happens I only get busy signal hungup and see the following in console. all out going calls from extensions are “call rejected”
Set(“SIP/abc-trunk-c0136058″, “__FROM_DID=1111111111″) in new stack
— Executing [1111111111@from-trunk:2] ExecIf(“SIP/abc-trunk-c0136058″, “0 ?Set(CALLERID(name)=5555555555)”) in new stack
— Executing [1111111111@from-trunk:3] Set(“SIP/abc-trunk-c0136058″, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
— Executing [1111111111@from-trunk:4] Set(“SIP/abc-trunk-c0136058″, “CALLERPRES()=allowed_not_screened”) in new stack
— Executing [1111111111@from-trunk:5] Goto(“SIP/abc-trunk-c0136058″, “custom-a2billing-did,1111111111,1″) in new stack
— Goto (custom-a2billing-did,1111111111,1)
— Executing [1111111111@custom-a2billing-did:1] DeadAGI(“SIP/abc-trunk-c0136058″, “a2billing.php|1|did”) in new stack
— Executing [1111111111@custom-a2billing-did:2] Hangup(“SIP/abc-trunk-c0136058″, “”) in new stack
== Spawn extension (custom-a2billing-did, 1111111111, 2) exited non-zero on ‘SIP/abc-trunk-c0136058′
what is likely the reason?
thanks.
19 June 2009, 3:34 pmMepj
matt:
Hi mepj, looks like it’s hitting that custom destination ok and trying to be passed to a2billing. Does the php file exist in the correct place? You should have a file called /var/lib/asterisk/agi-bin/a2billing.php (and also /var/lib/asterisk/agi-bin/libs_a2billing)
19 June 2009, 4:07 pmmepj:
Thanks Matt,
19 June 2009, 10:32 pmthe file(a2billing.php) and the folder(libs_a2billing) exist.
matt:
You could try checking in /etc/asterisk/a2billing.conf to see what “debug” is set to. Try setting “debug=3″, hopefully that will give you more information in the logs about what is going on.
20 June 2009, 4:14 amDec:
Hello Matt..
I am having the same issue and i cant find the libs_a2billing directory in my a2billing 1.4.1 installation.. Any ideas?
Regards.
Dec
26 September 2009, 4:18 pmmatt:
Hi Dec,
I think you should be able to find it at – /var/lib/asterisk/agi-bin/lib – or at least a symbolic link to where the files actually are. What do you have there?
Matt
26 September 2009, 5:28 pmsana:
Hi Mat
18 November 2009, 6:34 amI have a problem with this setup. I can call through callwithus sip without a2billing configuration successfully. However, with a2billing I can enter customer pin number and enter the phone number.Then it tell remaining minutes and DISCONNECTED. my log file gave “Got SIP response 484 “Address Incomplete” “. Do you have any idea?
matt:
Can you see from the logs what SIP URL is being sent to CallWithUs? Does it look ok?
18 November 2009, 8:38 pmRiyaz:
Hi Matt,
First i would like to thank to you for you excellent how to on Freepbx + A2billing, thanks a lot.Well, i got a problem on assigning DID with a2billing, i followed you tutorial steps by steps more than 10 times, seriously i can’t find any link between the trunk created on freepbx and my a2billing customers to making calls trough that trunk, and also if i make a call like that, dialing to my did the call disconnect immediatly, and this is what i got on my asterisk cli :
- http://paste.ubuntu.com/547077/
Could you please check and tell me what’s wrong ? thanks a lot
24 December 2010, 12:17 am