Supporting Custom trunk -> A2B/$OUTNUM$?


I was wondering if it was possible to add A2Billing trunks into FreePBX. The goal is to simply add a trunk, which will be called A2B on the local machine. It will pass through the normal dialout procedures but then it will transfer the outbound CID and number to be called to A2B.

Right now I have it setup as a so called extension via a manual edit of the extensions_custom.conf file however, the problem I have is with the Caller ID information. I can not transmit the extension’s callerID info cause it is transmitting the extension number instead of the Outbound CallerID information.

This is what I have in my extension_custom.conf file


exten => _1NXXNXXXXXX,1,Answer
exten => _1NXXNXXXXXX,2,Wait,1
exten => _1NXXNXXXXXX,3,DeadAGI,a2billing.php
exten => _1NXXNXXXXXX,4,Congestion
exten => _1NXXNXXXXXX,5,Wait,2
exten => _1NXXNXXXXXX,6,Hangup

exten => _011.,1,Answer
exten => _011.,2,Wait,1
exten => _011.,3,DeadAGI,a2billing.php
exten => _011.,4,Congestion
exten => _011.,5,Wait,2
exten => _011.,6,Hangup

exten => _225,1,Answer
exten => _225,2,Wait,1
exten => _225,3,DeadAGI,a2billing.php
exten => _225,4,Congestion
exten => _225,5,Wait,2
exten => _225,6,Hangup

What I would like it to do is to somehow modify the macro-dialout-trunk, if it sees a custom trunk that says A2B/$OUTNUM$ then it would call up the DeadAGI for a2billing.php and dialout with the actual Outbound CallerID instead of the Extension.

Has anyone done this or has anyone been able to integrate FreePBX via the web interface to work with A2Billing without the need to enter a custom hack like I did above?


Made a fix for this. If anyone wants it, check the patches area in TRAC.

Hi Cyber,

I am trying to exactly the same.

Firstly, I want all of my SIP extensions to go through a2billing. Whether calling internal extensions or any PSTN number, I want them to be billed.

How do I go about ?

Secondly, I want all of my calling card users to be routed to 0800 extension. I just installed my A2Billing. I have set up an extension 0800 in my extensions.conf

For Calling Card
exten => 0800,1,Answer
exten => 0800,2,Wait,2
exten => 0800,3,DeadAGI,a2billing.php
exten => 0800,4,Wait,2
exten => 0800,5,Hangup

Whenever I dial the 0800 extensioin from one of my FreepBX created extensions,

I do not get the “Welcome to the calling card system” prompt. The file is there in /var/lib/asterisk/sounds. I wonder why it is not being played.

I do get a prompt for entering you pin number. Once I dial the pin number the IVR prompts me to put in the destination number.

As soon as I put in the destination number, I get a prompt from the IVR saying that , “This number is is unavailable”. I do have a trunk created in my FreeBX and I have made successful calls when dialing directly from my SIP extensions.

I wonder why a2billing is not able to utilize that trunk whereas I given all the parameters correctly.

I’ll apperciate if you can help me with this.