Part 8 – Create a custom trunk in Elastix for use with A2Billing
This is part 8 of a series of posts on setting up an Elastix extension with A2Billing. See here for details of the other parts – Using A2Billing to account for extension calls in Elastix
Now we are going to make some changes to the Elastix setup we did earlier. We are going to tell Elastix to route our calls via A2Billing, rather than going straight out using the trunk.
First we need to add a trunk so select Trunks and Add Custom Trunk -
All you need to enter is the ‘”Custom Dial String” which should be set to “Local/$OUTNUM$@a2billing/n” -
Now we need to edit the default route that we created earlier and tell it to use the A2Billing trunk that we just setup -
Next we need to edit the extension we setup earlier and enter the a2billing card number in to the “accountcode” field. This will be passed to A2Billing when we make a call, telling it which A2Billing customer account to use.
Now, unfortunately this is where it get’s a little complicated! The version of A2Billing that comes with Elastix 1.6 is a little old (version 1.30) so there are a few settings we can’t make through the GUI. We need to edit the configuration file though SSH. So log in via SSH using the root account. First we’re going to take a copy of the configuration file -
Now we need to tell Asterisk to load the A2Billing configuration file. This seems to be missing by default in Elastix -
Next we need to edit the file /etc/asterisk/a2billing.conf and make the following changes under the [agi-conf1] section (you can tell we are using AGI-CONF1 by looking at the custom trunk in Elastix we set up earlier and the file extensions_a2billing.conf. I won’t go in to the details here.
Change the following settings under the [agi-conf1] section -
asterisk_version = 1_4
play_audio = NO
use_dnid = YES
number_try = 1
Now restart Asterisk by running the following command -
And that’s it!!
If you make some test calls (to UK landlines starting with 1 don’t forget) you should see them appearing in your A2Billing CDR reports -
Related posts:
- Part 3 – Create a trunk in Elastix
- Part 4 – Create an outbound route in Elastix
- Part 5 – Creating a trunk in A2Billing on Elastix

Mohammad:
Dear Sir
Thnak you very much for your kind traning . I hope you have good time in your life and best wishes to you.
GOD BLESS YOU
25 July 2010, 6:41 amLee:
Hey Matt,
Another great tutorial that works.
Cheers.
31 July 2010, 4:38 pmdavid medina:
Hi there. Excellent tutorial, but I have an issue. The call is being cut off after 30 seconds. What can I modify to put everything to work?. Thanks
17 September 2010, 12:57 pmjeleo:
He configurado todos los pasos pero aún no he logrado sacar una llamada, elastix me dice que todas las líneas están ocupadas, osea que algo esta mal.
he revisado todos los pasos mucha veces y no encuentro el por qué, el trunk lo tengo con justvoip y todo funciona des elastix, pero cuando trato de sacar llamadas por a2billing me dice este mensaje.
Tengo dudas en el paso 8, más exantamente en la parte:
” All you need to enter is the ‘”Custom Dial String” which should be set to “Local/$OUTNUM$@a2billing/n” – ”
Por favor todos los comentarios serán vienvenidos, ya tengo una semana en esto y nada. Es lo unico que me falta …
De antemano gracias …
23 September 2010, 5:33 pmSalu2
HectorS:
Great Tutorial. I’m trying to set up Elastix with the new A2Billing 1.6, and I’m finding that step 8 is not the same. When you look for a2billing.conf you don’t have a [agi-conf1] part on it. Do you have any experience with this new release of A2Billing. Any help will be appreciated.
25 September 2010, 12:05 ammatt:
Nearly all of the settings that used to be in the a2billing.conf file are now stored in the database and are accessible via the SYSTEM SETTINGS menu in the admin GUI, and that includes the AGI-CONF settings.
The only settings left in a2billing.conf and the database and log settings.
25 September 2010, 10:04 amsip:
Hi!
7 October 2010, 4:09 amOn elastix 2 a2billing not load extensions_a2billing.conf ?
NOTICE[4396] chan_local.c: No such extension/context 9@a2billing while calling Local channel
sip:
extension load but
7 October 2010, 4:37 amWARNING[5571] res_agi.c: Failed to execute ‘/var/lib/asterisk/agi-bin/a2billing.php|1′: File does not exist.
matt:
That’s strange. Does this file exist on your server – /var/lib/asterisk/agi-bin/a2billing.php
7 October 2010, 8:48 amsip:
elastix 1.6 no problem, but i need elastix2
cd /var/lib/asterisk/agi-bin/
ls -l a2*
-rwxrwxr-x 1 asterisk asterisk 43831 Jul 5 2007 a2billing.php
elastix 2
7 October 2010, 12:45 pm[root@sip agi-bin]# php a2billing.php -v
A2Billing – Version Asterisk2Billing – Version 1.3.0 (Yellowjacket) – Release : July 2007
Asterisk 1.6.2.10 built by root @ rpmbuild32-2.elastix.palosanto.com on a i686 running Linux on 2010-07-29 08:45:42 UTC
matt:
Elastix 2 uses Asterisk 1.6 which uses a comma seperator not a pipe so try changing (a2billing.php|1) to (a2billing.php,1) in /etc/asterisk/extensions_a2billing.conf
7 October 2010, 1:07 pmsip:
Thank You! All working ok.
8 October 2010, 3:04 pmTerry:
Dear Sir,
1 Is this working with Elastix 1.6.12 with a2billing 1.3 ?
18 October 2010, 1:42 pm2 If i need a2billing 1.3 callback function working , should I need start the a2billing callback-Daemon , if Yes, how to do with Elastix 1.6.12 with a2billing 1.3 ?
Thuo:
Wow, what a guide ! Worked so well….. i had struggled with this though,
extensions_a2billing.conf
[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php,1) – HAD TO change from (|) to (,)
exten => _X.,n,Hangup
Thanks
29 October 2010, 4:08 pmmatt:
Thanks for the comment and the tip. I’m glad you found it useful.
Yes, I should make that clear. If you’re running Asterisk 1.6 or later you need to change the (|) to a (,) in any conf files as they changed the seperator in that version of Asterisk.
29 October 2010, 4:20 pmTerry:
Dear All,
30 October 2010, 12:09 amDoes anyone can give me more detail about callback config in freepbx or elastix and running a2billing together?, my customer login in and web callback is working great already
Martin:
Hi Matt,
I have about 5 different trunks which is used for doing Least Cost Routing. when the cheapest trunk fails, I want asterisk/a2billing to use the next cheapest trunk instead of doping the call. is this option possible?
thank you. God bless you
29 April 2011, 9:30 ammatt:
I would double check in the a2billing forums but I don’t think this is how A2Billing behaves. It will place the call via the chosen trunk (or the failover, but then the call will be billed at the chosen trunks rates)
Cheers, Matt
29 April 2011, 9:34 amGravin Kumar:
Hi, On asterisk 1.6 you need to use comma instead of pipe in extensions_a2billing.conf ->>> exten => _X.,n,DeadAGI(a2billing.php,1)
4 May 2011, 4:14 pmmatt:
That’s true. Or changing the ‘asterisk_version’ setting in a2billing to ’1_6′ should correct it too.
4 May 2011, 7:50 pmjose:
hello
I have the latest version of elastix with 1.3 a2billing. I trying to follow all the instruction above but no luck..any help pls
5 May 2011, 5:09 ammatt:
I would suggest getting a FreePBX extension setup and using the trunk from there first. Once you’re sure it’s working you can then use it in a2billing.
5 May 2011, 7:41 amjose:
I tried to configure the trunknd extendtions in the freepbx it’s 100% working but when I change the outbound route for Local/$OUTNUM$@a2billing/n can’t make a call. I’m sure I’ve followed everything as instructed.I’m hoping I’m one of the lucky person who can run it.
5 May 2011, 2:02 pmmatt:
I’d suggest a couple of things. First check with the Simulator in a2billing that it thinks the call should work.
Next you could try creating a SIP customer in a2billing and connecting your softphone too it. Then try making a call directly, rather than through a FreePBX, just to check that a2billing is working.
6 May 2011, 8:22 pmjose:
hello sir
7 May 2011, 2:28 amThank you for your time trying to help me configure a2billing.You really have the big heart for helping other people considering the fact that you don’t get any monetary value in it.I salute you for that…when I used the simulator and putting the number generated, it come out perfectly.but the secret no. and acnt. no. when I directly used it as a sip account it says “registration error403″
matt:
It sounds like your SIP friends are not getting created in a2billing. Is this the version that comes with Elastix 1.3.4?
10 May 2011, 10:35 amjose:
I think it’s elastix 2.0.0 with a2billing 1.3.0 yellowjacket .
11 May 2011, 11:49 ammatt:
There are 2 lines missing from the Asterisk config in Elastix. I think you need to add -
#include additional_a2billing_sip.conf
#include additional_a2billing_iax.conf
to /etc/asterisk/sip_custom.conf
12 May 2011, 8:51 amjose:
Hello Sir
My Linux experience is very limited,can you elaborate a little bit how to execute your instructions. thx
12 May 2011, 10:05 amjose:
The account generated in a2 is already registered in my sip phone. I just copy and paste the instruction above.
12 May 2011, 10:26 ammatt:
The following 2 commands should do it -
echo “#include additional_a2billing_sip.conf” >> /etc/asterisk/sip_custom.conf
echo “#include additional_a2billing_iax.conf” >> /etc/asterisk/iax_custom.conf
then restart Asterisk.
They should be double quotes above – WordPress may mess them up.
12 May 2011, 10:34 amjose:
Yes… it can registered now the numbered generated in my sip phone but the problem can’t make a call
12 May 2011, 10:56 ammatt:
I would check that the call should work by trying under Rates/Simulator.
12 May 2011, 11:42 amjose:
in the simulator it display the time the call plan covered, it really run smoothly but when I used it for real time calling it says ” the person u r callng is not available”.
12 May 2011, 6:14 pmmatt:
Are you definitely sending the number in the correct format to the trunk. Not stripping off the international code (00) maybe?
If it still doesn’t work then it get’s more complicated but you can switch on debugging (under the AGI-CONF config) and see what the logs say.
12 May 2011, 9:40 pmjose:
sorry sir last time I told you that it’s simulate perfectly but now trying to do it again it’s not, but the number generated in a2 it’s registered still in my sip phone when I used it directly..
15 May 2011, 3:46 pmmatt:
The simulator just proves that your rate cards are setup correctly (rather than anything about the status of the phone). Obviously it’s critical that the simulator returns correctly when you try it.
15 May 2011, 8:51 pmjose:
sir
when calling the other extension using the number generated in a2 it really ring but the extension I am calling to is not, then it says “the number you’ved dial is not attended”.
16 May 2011, 3:37 amjose:
the a2 generated account I used it in zoiper “no route to destination” when I tried to call.
18 May 2011, 3:36 pmKevin:
Hi, Thanks for this tutorial. It has been really helpful. Am having a wierd issue, am able to connect elastix 2 with a2billing 1.3 yellow jacket. Am able to make a call but no sound goes through, I mean cant hear a thing but when I talk from my end, the other party can hear you quite well. Am using Express Talk as the client software but in the case of using 3cx softphone, am able to communicate quite well. Kindly help.
9 September 2011, 7:26 amThanks
Ray:
Hi guys
I have had a go at setting this up myself and its sort of working.
I have a trunk and when i make a call with the route set to go via the trunk it works, but when i pass the call via a2billing it fails. “All circuts are busy”
It feels like I am missing something with regard to when the call comes from a2billing back into the outbound routes. So I tried setting up a default route so that everything went out the route except from my extension and it still failed.
I can connect using my sip client directly to a2billing using a calling code number, but that wont make any outgoing calls either. It wont even call the echotest feature code.
I have tried changing the asterisk version to 1_6 and the | to a , in the files as suggested above but still no luck.
My a2billing trunk voip provider ip is set to use the name of the trunk in elastix which is just labeled its phone number 92999082 which is supplied by the voip provider.
I would like to use a2billing inside elastix for call recording and cost accounting for a residential service
Any ideas are much appreciated?
9 September 2011, 10:57 ammatt:
Hi Ray,
First I would check that the call works OK using the Simmulator in A2Billing. That will tell you if you’ve got your rate cards etc setup correctly.
9 September 2011, 2:48 pmmatt:
Hi Kevin,
One way audio is often caused by NAT/Firewall problems. It’s likely that your firewall is blocking the audio stream.
Check here for some info about Asterisk and NAT – http://www.voip-info.org/wiki/view/Asterisk+sip+nat
9 September 2011, 2:50 pmRay:
Hi Matt,
Yes I managed to get it working, but i am back to thinking a2billing wont work for me.
9 September 2011, 9:27 pmWe have a trunk for each household with 2000 free local minutes included each month by our voip provider. Even though i think i have figured out how to do free minutes, i cant seem to figure out how to set them to be local minutes only. And also i would need to direct it through the extension / household’s associated trunk so that one household doesnt use another’s free minutes.
wav:
Hello!
what means “n” in the end of this:Local/$OUTNUM$@a2billing/n ?
Thanks
14 October 2011, 9:28 amJerm:
This is very good work guys
16 October 2011, 3:34 amsong:
Thanks matt follow the tutorial to set up, but as a problem to play in all normal mobile phone, but if you play a fixed telephone (landline) can not answer, do not know what the problem is, my test environment is elastix1.6 a2billing1.3.0
17 November 2011, 1:11 pmmatt:
Sounds like maybe a NAT problem. If your server behind a NAT firewall?
You could try setting ‘canreinvite=no’ on your trunk.
Is the landline ringing? Just no voice when you answer?
17 November 2011, 2:52 pmsong:
Plane with ring tones, but the phone call (mobile phone) all normal, just call the plane, the other party ringing sound is heard
17 November 2011, 3:07 pmsong:
Landline calls without charging the account, with elastix extension to play outside all the normal plane
17 November 2011, 3:10 pmsong:
hi matt elastix is behind a firewall (router) behind the
17 November 2011, 3:45 pmmatt:
Did you try the ‘canreinvite=no’ on the trunk?
17 November 2011, 6:09 pmsong:
Thank you matt set ‘canreinvite = no’ question remains, is not standard with the phone or on line, call the mobile phone is no problem, this problem call landline
18 November 2011, 1:47 amJermaine:
matt i install elastix 2.2 and a2billing 1.4 i follow the steps you provided for the old version of but am not getting through. Please help
7 December 2011, 9:52 pmJermaine:
this is the incoming log
— Goto (a2billing,s,1)
7 December 2011, 10:39 pm— Hanging up on ‘DAHDI/2-1′
— Hungup ‘DAHDI/2-1′
— Starting simple switch on ‘DAHDI/2-1′
— Executing [s@from-zaptel:1] NoOp(“DAHDI/2-1″, “Entering from-dahdi with DID == “) in new stack
— Executing [s@from-zaptel:2] Ringing(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-zaptel:3] Set(“DAHDI/2-1″, “DID=s”) in new stack
— Executing [s@from-zaptel:4] NoOp(“DAHDI/2-1″, “DID is now s”) in new stack
— Executing [s@from-zaptel:5] GotoIf(“DAHDI/2-1″, “1?dahdiok:checkzap”) in new stack
— Goto (from-zaptel,s,9)
— Executing [s@from-zaptel:9] NoOp(“DAHDI/2-1″, “Is a DAHDI Channel”) in new stack
— Executing [s@from-zaptel:10] Set(“DAHDI/2-1″, “CHAN=2-1″) in new stack
— Executing [s@from-zaptel:11] Set(“DAHDI/2-1″, “CHAN=2″) in new stack
— Executing [s@from-zaptel:12] Macro(“DAHDI/2-1″, “from-dahdi-2,s,1″) in new stack
— Executing [s@from-zaptel:13] NoOp(“DAHDI/2-1″, “Returned from Macro from-dahdi-2″) in new stack
— Executing [s@from-zaptel:14] Goto(“DAHDI/2-1″, “from-pstn,s,1″) in new stack
— Goto (from-pstn,s,1)
— Executing [s@from-pstn:1] Set(“DAHDI/2-1″, “__FROM_DID=s”) in new stack
— Executing [s@from-pstn:2] Gosub(“DAHDI/2-1″, “app-blacklist-check,s,1″) in new stack
— Executing [s@app-blacklist-check:1] GotoIf(“DAHDI/2-1″, “0?blacklisted”) in new stack
— Executing [s@app-blacklist-check:2] Set(“DAHDI/2-1″, “CALLED_BLACKLIST=1″) in new stack
— Executing [s@app-blacklist-check:3] Return(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-pstn:3] ExecIf(“DAHDI/2-1″, “1 ?Set(CALLERID(name)=)”) in new stack
— Executing [s@from-pstn:4] Set(“DAHDI/2-1″, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
— Executing [s@from-pstn:5] Set(“DAHDI/2-1″, “CALLERPRES()=allowed_not_screened”) in new stack
— Executing [s@from-pstn:6] Goto(“DAHDI/2-1″, “a2billing,s,1″) in new stack
— Goto (a2billing,s,1)
— Hanging up on ‘DAHDI/2-1′
— Hungup ‘DAHDI/2-1′
Jermaine:
Verbosity is at least 3
7 December 2011, 10:43 pm— Starting simple switch on ‘DAHDI/2-1′
— Executing [s@from-zaptel:1] NoOp(“DAHDI/2-1″, “Entering from-dahdi with DID == “) in new stack
— Executing [s@from-zaptel:2] Ringing(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-zaptel:3] Set(“DAHDI/2-1″, “DID=s”) in new stack
— Executing [s@from-zaptel:4] NoOp(“DAHDI/2-1″, “DID is now s”) in new stack
— Executing [s@from-zaptel:5] GotoIf(“DAHDI/2-1″, “1?dahdiok:checkzap”) in new stack
— Goto (from-zaptel,s,9)
— Executing [s@from-zaptel:9] NoOp(“DAHDI/2-1″, “Is a DAHDI Channel”) in new stack
— Executing [s@from-zaptel:10] Set(“DAHDI/2-1″, “CHAN=2-1″) in new stack
— Executing [s@from-zaptel:11] Set(“DAHDI/2-1″, “CHAN=2″) in new stack
— Executing [s@from-zaptel:12] Macro(“DAHDI/2-1″, “from-dahdi-2,s,1″) in new stack
— Executing [s@from-zaptel:13] NoOp(“DAHDI/2-1″, “Returned from Macro from-dahdi-2″) in new stack
— Executing [s@from-zaptel:14] Goto(“DAHDI/2-1″, “from-pstn,s,1″) in new stack
— Goto (from-pstn,s,1)
— Executing [s@from-pstn:1] Set(“DAHDI/2-1″, “__FROM_DID=s”) in new stack
— Executing [s@from-pstn:2] Gosub(“DAHDI/2-1″, “app-blacklist-check,s,1″) in new stack
— Executing [s@app-blacklist-check:1] GotoIf(“DAHDI/2-1″, “0?blacklisted”) in new stack
— Executing [s@app-blacklist-check:2] Set(“DAHDI/2-1″, “CALLED_BLACKLIST=1″) in new stack
— Executing [s@app-blacklist-check:3] Return(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-pstn:3] ExecIf(“DAHDI/2-1″, “1 ?Set(CALLERID(name)=)”) in new stack
— Executing [s@from-pstn:4] Set(“DAHDI/2-1″, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
— Executing [s@from-pstn:5] Set(“DAHDI/2-1″, “CALLERPRES()=allowed_not_screened”) in new stack
— Executing [s@from-pstn:6] Goto(“DAHDI/2-1″, “a2billing,s,1″) in new stack
— Goto (a2billing,s,1)
— Hanging up on ‘DAHDI/2-1′
— Hungup ‘DAHDI/2-1′
— Starting simple switch on ‘DAHDI/2-1′
— Executing [s@from-zaptel:1] NoOp(“DAHDI/2-1″, “Entering from-dahdi with DID == “) in new stack
— Executing [s@from-zaptel:2] Ringing(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-zaptel:3] Set(“DAHDI/2-1″, “DID=s”) in new stack
— Executing [s@from-zaptel:4] NoOp(“DAHDI/2-1″, “DID is now s”) in new stack
— Executing [s@from-zaptel:5] GotoIf(“DAHDI/2-1″, “1?dahdiok:checkzap”) in new stack
— Goto (from-zaptel,s,9)
— Executing [s@from-zaptel:9] NoOp(“DAHDI/2-1″, “Is a DAHDI Channel”) in new stack
— Executing [s@from-zaptel:10] Set(“DAHDI/2-1″, “CHAN=2-1″) in new stack
— Executing [s@from-zaptel:11] Set(“DAHDI/2-1″, “CHAN=2″) in new stack
— Executing [s@from-zaptel:12] Macro(“DAHDI/2-1″, “from-dahdi-2,s,1″) in new stack
— Executing [s@from-zaptel:13] NoOp(“DAHDI/2-1″, “Returned from Macro from-dahdi-2″) in new stack
— Executing [s@from-zaptel:14] Goto(“DAHDI/2-1″, “from-pstn,s,1″) in new stack
— Goto (from-pstn,s,1)
— Executing [s@from-pstn:1] Set(“DAHDI/2-1″, “__FROM_DID=s”) in new stack
— Executing [s@from-pstn:2] Gosub(“DAHDI/2-1″, “app-blacklist-check,s,1″) in new stack
— Executing [s@app-blacklist-check:1] GotoIf(“DAHDI/2-1″, “0?blacklisted”) in new stack
— Executing [s@app-blacklist-check:2] Set(“DAHDI/2-1″, “CALLED_BLACKLIST=1″) in new stack
— Executing [s@app-blacklist-check:3] Return(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-pstn:3] ExecIf(“DAHDI/2-1″, “1 ?Set(CALLERID(name)=)”) in new stack
— Executing [s@from-pstn:4] Set(“DAHDI/2-1″, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
— Executing [s@from-pstn:5] Set(“DAHDI/2-1″, “CALLERPRES()=allowed_not_screened”) in new stack
— Executing [s@from-pstn:6] Goto(“DAHDI/2-1″, “a2billing,s,1″) in new stack
— Goto (a2billing,s,1)
— Hanging up on ‘DAHDI/2-1′
— Hungup ‘DAHDI/2-1′
— Starting simple switch on ‘DAHDI/2-1′
— Executing [s@from-zaptel:1] NoOp(“DAHDI/2-1″, “Entering from-dahdi with DID == “) in new stack
— Executing [s@from-zaptel:2] Ringing(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-zaptel:3] Set(“DAHDI/2-1″, “DID=s”) in new stack
— Executing [s@from-zaptel:4] NoOp(“DAHDI/2-1″, “DID is now s”) in new stack
— Executing [s@from-zaptel:5] GotoIf(“DAHDI/2-1″, “1?dahdiok:checkzap”) in new stack
— Goto (from-zaptel,s,9)
— Executing [s@from-zaptel:9] NoOp(“DAHDI/2-1″, “Is a DAHDI Channel”) in new stack
— Executing [s@from-zaptel:10] Set(“DAHDI/2-1″, “CHAN=2-1″) in new stack
— Executing [s@from-zaptel:11] Set(“DAHDI/2-1″, “CHAN=2″) in new stack
— Executing [s@from-zaptel:12] Macro(“DAHDI/2-1″, “from-dahdi-2,s,1″) in new stack
— Executing [s@from-zaptel:13] NoOp(“DAHDI/2-1″, “Returned from Macro from-dahdi-2″) in new stack
— Executing [s@from-zaptel:14] Goto(“DAHDI/2-1″, “from-pstn,s,1″) in new stack
— Goto (from-pstn,s,1)
— Executing [s@from-pstn:1] Set(“DAHDI/2-1″, “__FROM_DID=s”) in new stack
— Executing [s@from-pstn:2] Gosub(“DAHDI/2-1″, “app-blacklist-check,s,1″) in new stack
— Executing [s@app-blacklist-check:1] GotoIf(“DAHDI/2-1″, “0?blacklisted”) in new stack
— Executing [s@app-blacklist-check:2] Set(“DAHDI/2-1″, “CALLED_BLACKLIST=1″) in new stack
— Executing [s@app-blacklist-check:3] Return(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-pstn:3] ExecIf(“DAHDI/2-1″, “1 ?Set(CALLERID(name)=)”) in new stack
— Executing [s@from-pstn:4] Set(“DAHDI/2-1″, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
— Executing [s@from-pstn:5] Set(“DAHDI/2-1″, “CALLERPRES()=allowed_not_screened”) in new stack
— Executing [s@from-pstn:6] Goto(“DAHDI/2-1″, “a2billing,s,1″) in new stack
— Goto (a2billing,s,1)
— Hanging up on ‘DAHDI/2-1′
— Hungup ‘DAHDI/2-1′
— Starting simple switch on ‘DAHDI/2-1′
— Executing [s@from-zaptel:1] NoOp(“DAHDI/2-1″, “Entering from-dahdi with DID == “) in new stack
— Executing [s@from-zaptel:2] Ringing(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-zaptel:3] Set(“DAHDI/2-1″, “DID=s”) in new stack
— Executing [s@from-zaptel:4] NoOp(“DAHDI/2-1″, “DID is now s”) in new stack
— Executing [s@from-zaptel:5] GotoIf(“DAHDI/2-1″, “1?dahdiok:checkzap”) in new stack
— Goto (from-zaptel,s,9)
— Executing [s@from-zaptel:9] NoOp(“DAHDI/2-1″, “Is a DAHDI Channel”) in new stack
— Executing [s@from-zaptel:10] Set(“DAHDI/2-1″, “CHAN=2-1″) in new stack
— Executing [s@from-zaptel:11] Set(“DAHDI/2-1″, “CHAN=2″) in new stack
— Executing [s@from-zaptel:12] Macro(“DAHDI/2-1″, “from-dahdi-2,s,1″) in new stack
— Executing [s@from-zaptel:13] NoOp(“DAHDI/2-1″, “Returned from Macro from-dahdi-2″) in new stack
— Executing [s@from-zaptel:14] Goto(“DAHDI/2-1″, “from-pstn,s,1″) in new stack
— Goto (from-pstn,s,1)
— Executing [s@from-pstn:1] Set(“DAHDI/2-1″, “__FROM_DID=s”) in new stack
— Executing [s@from-pstn:2] Gosub(“DAHDI/2-1″, “app-blacklist-check,s,1″) in new stack
— Executing [s@app-blacklist-check:1] GotoIf(“DAHDI/2-1″, “0?blacklisted”) in new stack
— Executing [s@app-blacklist-check:2] Set(“DAHDI/2-1″, “CALLED_BLACKLIST=1″) in new stack
— Executing [s@app-blacklist-check:3] Return(“DAHDI/2-1″, “”) in new stack
— Executing [s@from-pstn:3] ExecIf(“DAHDI/2-1″, “1 ?Set(CALLERID(name)=)”) in new stack
— Executing [s@from-pstn:4] Set(“DAHDI/2-1″, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
— Executing [s@from-pstn:5] Set(“DAHDI/2-1″, “CALLERPRES()=allowed_not_screened”) in new stack
— Executing [s@from-pstn:6] Goto(“DAHDI/2-1″, “a2billing,s,1″) in new stack
— Goto (a2billing,s,1)
— Hanging up on ‘DAHDI/2-1′
— Hungup ‘DAHDI/2-1′
Jermaine:
This is the latest log when i try to make a call
Executing last minute cleanups
7 December 2011, 10:47 pm[root@voip1 ~]# asterisk -vvr
Asterisk 1.8.7.0, Copyright (C) 1999 – 2011 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
=========================================================================
== Parsing ‘/etc/asterisk/asterisk.conf’: == Found
== Parsing ‘/etc/asterisk/extconfig.conf’: == Found
Connected to Asterisk 1.8.7.0 currently running on voip1 (pid = 19233)
Verbosity is at least 3
== Using UDPTL TOS bits 184
== Using UDPTL CoS mark 5
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
— Executing [18763838922@from-internal:1] Macro(“SIP/99915-00000013″, “user-callerid,SKIPTTL,”) in new stack
— Executing [s@macro-user-callerid:1] Set(“SIP/99915-00000013″, “AMPUSER=99915″) in new stack
— Executing [s@macro-user-callerid:2] GotoIf(“SIP/99915-00000013″, “0?report”) in new stack
— Executing [s@macro-user-callerid:3] ExecIf(“SIP/99915-00000013″, “1?Set(REALCALLERIDNUM=99915)”) in new stack
— Executing [s@macro-user-callerid:4] Set(“SIP/99915-00000013″, “AMPUSER=99915″) in new stack
— Executing [s@macro-user-callerid:5] Set(“SIP/99915-00000013″, “AMPUSERCIDNAME=TMS Support”) in new stack
— Executing [s@macro-user-callerid:6] GotoIf(“SIP/99915-00000013″, “0?report”) in new stack
— Executing [s@macro-user-callerid:7] Set(“SIP/99915-00000013″, “AMPUSERCID=99915″) in new stack
— Executing [s@macro-user-callerid:8] Set(“SIP/99915-00000013″, “CALLERID(all)=”TMS Support” “) in new stack
— Executing [s@macro-user-callerid:9] ExecIf(“SIP/99915-00000013″, “0?Set(CHANNEL(language)=)”) in new stack
— Executing [s@macro-user-callerid:10] GotoIf(“SIP/99915-00000013″, “1?continue”) in new stack
— Goto (macro-user-callerid,s,19)
— Executing [s@macro-user-callerid:19] Set(“SIP/99915-00000013″, “CALLERID(number)=99915″) in new stack
— Executing [s@macro-user-callerid:20] Set(“SIP/99915-00000013″, “CALLERID(name)=TMS Support”) in new stack
— Executing [s@macro-user-callerid:21] NoOp(“SIP/99915-00000013″, “Using CallerID “TMS Support” “) in new stack
— Executing [18763838922@from-internal:2] NoOp(“SIP/99915-00000013″, “Calling Out Route: International_Out”) in new stack
— Executing [18763838922@from-internal:3] Set(“SIP/99915-00000013″, “MOHCLASS=default”) in new stack
— Executing [18763838922@from-internal:4] Set(“SIP/99915-00000013″, “_NODEST=”) in new stack
— Executing [18763838922@from-internal:5] Macro(“SIP/99915-00000013″, “record-enable,99915,OUT,”) in new stack
— Executing [s@macro-record-enable:1] GotoIf(“SIP/99915-00000013″, “1?check”) in new stack
— Goto (macro-record-enable,s,4)
— Executing [s@macro-record-enable:4] ExecIf(“SIP/99915-00000013″, “0?MacroExit()”) in new stack
— Executing [s@macro-record-enable:5] GotoIf(“SIP/99915-00000013″, “0?Group:OUT”) in new stack
— Goto (macro-record-enable,s,15)
— Executing [s@macro-record-enable:15] GotoIf(“SIP/99915-00000013″, “0?IN”) in new stack
— Executing [s@macro-record-enable:16] ExecIf(“SIP/99915-00000013″, “1?MacroExit()”) in new stack
— Executing [18763838922@from-internal:6] Macro(“SIP/99915-00000013″, “dialout-trunk,4,18763838922,”) in new stack
— Executing [s@macro-dialout-trunk:1] Set(“SIP/99915-00000013″, “DIAL_TRUNK=4″) in new stack
— Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/99915-00000013″, “0?sub-pincheck,s,1″) in new stack
— Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/99915-00000013″, “0?disabletrunk,1″) in new stack
— Executing [s@macro-dialout-trunk:4] Set(“SIP/99915-00000013″, “DIAL_NUMBER=18763838922″) in new stack
— Executing [s@macro-dialout-trunk:5] Set(“SIP/99915-00000013″, “DIAL_TRUNK_OPTIONS=tr”) in new stack
— Executing [s@macro-dialout-trunk:6] Set(“SIP/99915-00000013″, “OUTBOUND_GROUP=OUT_4″) in new stack
— Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/99915-00000013″, “1?nomax”) in new stack
— Goto (macro-dialout-trunk,s,9)
— Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/99915-00000013″, “0?skipoutcid”) in new stack
— Executing [s@macro-dialout-trunk:10] Set(“SIP/99915-00000013″, “DIAL_TRUNK_OPTIONS=”) in new stack
— Executing [s@macro-dialout-trunk:11] Macro(“SIP/99915-00000013″, “outbound-callerid,4″) in new stack
— Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/99915-00000013″, “0?Set(CALLERPRES()=)”) in new stack
— Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/99915-00000013″, “0?Set(REALCALLERIDNUM=99915)”) in new stack
— Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/99915-00000013″, “1?normcid”) in new stack
— Goto (macro-outbound-callerid,s,6)
— Executing [s@macro-outbound-callerid:6] Set(“SIP/99915-00000013″, “USEROUTCID=”) in new stack
— Executing [s@macro-outbound-callerid:7] Set(“SIP/99915-00000013″, “EMERGENCYCID=”) in new stack
— Executing [s@macro-outbound-callerid:8] Set(“SIP/99915-00000013″, “TRUNKOUTCID=”) in new stack
— Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/99915-00000013″, “1?trunkcid”) in new stack
— Goto (macro-outbound-callerid,s,12)
— Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/99915-00000013″, “0?Set(CALLERID(all)=)”) in new stack
— Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/99915-00000013″, “0?Set(CALLERID(all)=)”) in new stack
— Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/99915-00000013″, “0?Set(CALLERID(all)=)”) in new stack
— Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/99915-00000013″, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
— Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/99915-00000013″, “0?sub-flp-4,s,1″) in new stack
— Executing [s@macro-dialout-trunk:13] Set(“SIP/99915-00000013″, “OUTNUM=18763838922″) in new stack
— Executing [s@macro-dialout-trunk:14] Set(“SIP/99915-00000013″, “custom=AMP”) in new stack
— Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/99915-00000013″, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
— Executing [s@macro-dialout-trunk:16] Macro(“SIP/99915-00000013″, “dialout-trunk-predial-hook,”) in new stack
— Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/99915-00000013″, “”) in new stack
— Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/99915-00000013″, “0?bypass,1″) in new stack
— Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/99915-00000013″, “1?customtrunk”) in new stack
— Goto (macro-dialout-trunk,s,22)
— Executing [s@macro-dialout-trunk:22] Set(“SIP/99915-00000013″, “pre_num=AMP:Local/”) in new stack
— Executing [s@macro-dialout-trunk:23] Set(“SIP/99915-00000013″, “the_num=OUTNUM”) in new stack
— Executing [s@macro-dialout-trunk:24] Set(“SIP/99915-00000013″, “post_num=@a2billing/n”) in new stack
— Executing [s@macro-dialout-trunk:25] GotoIf(“SIP/99915-00000013″, “1?outnum:skipoutnum”) in new stack
— Goto (macro-dialout-trunk,s,26)
— Executing [s@macro-dialout-trunk:26] Set(“SIP/99915-00000013″, “the_num=18763838922″) in new stack
— Executing [s@macro-dialout-trunk:27] Dial(“SIP/99915-00000013″, “Local/18763838922@a2billing/n,300,”) in new stack
— Called Local/18763838922@a2billing/n
— Executing [18763838922@a2billing:1] DeadAGI(“Local/18763838922@a2billing-6933;2″, “a2billing.php,1″) in new stack
— Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
— Local/18763838922@a2billing-6933;1 answered SIP/99915-00000013
— Playing ‘prepaid-enter-pin-number.gsm’ (language ‘en’)
— AGI Script Executing Application: (DIAL) Options: (sip/BroadVoice/8763838922|60|HRrL(5400000:61000:30000))
== Using UDPTL TOS bits 184
== Using UDPTL CoS mark 5
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
— Called sip/BroadVoice/8763838922|60|HRrL(5400000:61000:30000)
== Everyone is busy/congested at this time (1:0/0/1)
— Playing ‘prepaid-enter-dest.gsm’ (language ‘en’)
voip1*CLI>
matt:
I’ve not really played with A2Billing in Elastix 2.2 yet unfortunately It looks like you are trying to do both inbound and outbound calling and neither are working? Are you sure the telephone number is in the format BroadVoice expects it?
7 December 2011, 10:59 pmDennis:
Hi matt, its about elastix 2.2 and a2billing, i’ve already tried creating a trunk or custom destination in free embedded freepbx, but no luck, could you please help regarding this. i manage to configure configure sipgate as an incoming, voipcheap as outgoing and a single extension. also some further instruction please using ukddi configuration as a trunk. esp registration, host, password setting.
many thanks in advance
dennis
13 January 2012, 8:06 ammatt:
Hi Dennis,
It’s difficult to give detailed support to non SysAdminMan customers on the blog. If you are are SysAdminMan customer please open a support ticket and I’ll check what’s going on.
Regards, Matt
13 January 2012, 11:26 amsebastian escapil:
HI Matt. Tks for this useful guide
4 February 2012, 9:40 pmI have successful configured the billing system using a2b 1.9 / asterisk 1.6 and freepbx 2.9 and works perfects after doing a few adjustments.
my only concern is I have a few customers doing a forward to a external number when he’s extension is busy or unavailable , and is not working
is like a2b don’t recognize the account code on the extension and asks for a pin/card number
Please do You have any Idea how to fix this
tks Again
Sebastian
sebastian escapil:
FIXED
after hours of research I found a script called (Preserve Accountcode) from freepbx org at the section ( third party Contributed Modules) and works perfect on freepbx 2.8 and later
module description:
6 February 2012, 4:56 pmDescription for version 2.8.0.0
This module preservers the first callee’s account code, that has an accountcode, that it encounters. This preserved accoutcode will be used to set the CDR(accountcode) for any outbound calls that result from any type of redirected call (CF, VmX, Follow-Me, etc.). The account code for each user is pulled out of their associated device settings, which means this is only supported in extension mode and would have to be updated for deviceanduser mode, requiring a new accountcode field to be defined for the user on the extension/user screen.