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 -

add a custom trunk

All you need to enter is the ‘”Custom Dial String” which should be set to “Local/$OUTNUM$@a2billing/n” -

set a2billing as default route

Now we need to edit the default route that we created earlier and tell it to use the A2Billing trunk that we just setup -

edit default route

setup a2billing trunk

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.

set extension account code

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 -

cp /etc/asterisk/a2billing.conf /etc/asterisk/a2billing.conf.orig

Now we need to tell Asterisk to load the A2Billing configuration file. This seems to be missing by default in Elastix -

echo '#include extensions_a2billing.conf' >> extensions_custom.conf

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 -

debug = 0
asterisk_version = 1_4
play_audio = NO
use_dnid = YES
number_try = 1

Now restart Asterisk by running the following command -

amportal restart

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 -

See call logs is A2Billing CDR




Related posts:
  1. Part 3 – Create a trunk in Elastix
  2. Part 4 – Create an outbound route in Elastix
  3. Part 5 – Creating a trunk in A2Billing on Elastix

62 Comments

  1. 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

  2. Lee:

    Hey Matt,

    Another great tutorial that works.

    Cheers.

  3. david 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

  4. jeleo:

    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 …
    Salu2

  5. 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.

  6. matt:

    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.

  7. sip:

    Hi!
    On elastix 2 a2billing not load extensions_a2billing.conf ?
    NOTICE[4396] chan_local.c: No such extension/context 9@a2billing while calling Local channel

  8. sip:

    extension load but
    WARNING[5571] res_agi.c: Failed to execute ‘/var/lib/asterisk/agi-bin/a2billing.php|1′: File does not exist.

  9. matt:

    That’s strange. Does this file exist on your server – /var/lib/asterisk/agi-bin/a2billing.php

  10. sip:

    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
    [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

  11. 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

  12. sip:

    Thank You! All working ok.

  13. Terry:

    Dear Sir,

    1 Is this working with Elastix 1.6.12 with a2billing 1.3 ?
    2 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 ?

  14. 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

  15. matt:

    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.

  16. Terry:

    Dear All,
    Does 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

  17. 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

  18. matt:

    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

  19. Gravin 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)

  20. matt:

    That’s true. Or changing the ‘asterisk_version’ setting in a2billing to ’1_6′ should correct it too.

  21. jose:

    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

  22. matt:

    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.

  23. jose:

    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.

  24. matt:

    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.

  25. jose:

    hello sir
    Thank 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″

  26. matt:

    It sounds like your SIP friends are not getting created in a2billing. Is this the version that comes with Elastix 1.3.4?

  27. jose:

    I think it’s elastix 2.0.0 with a2billing 1.3.0 yellowjacket .

  28. matt:

    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

  29. jose:

    Hello Sir

    My Linux experience is very limited,can you elaborate a little bit how to execute your instructions. thx

  30. jose:

    The account generated in a2 is already registered in my sip phone. I just copy and paste the instruction above.

  31. matt:

    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.

  32. jose:

    Yes… it can registered now the numbered generated in my sip phone but the problem can’t make a call

  33. matt:

    I would check that the call should work by trying under Rates/Simulator.

  34. jose:

    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”.

  35. matt:

    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.

  36. jose:

    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..

  37. matt:

    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.

  38. jose:

    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”.

  39. jose:

    the a2 generated account I used it in zoiper “no route to destination” when I tried to call.

  40. Kevin:

    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.
    Thanks

  41. 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?

  42. matt:

    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.

  43. matt:

    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

  44. Ray:

    Hi Matt,

    Yes I managed to get it working, but i am back to thinking a2billing wont work for me.
    We 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.

  45. wav:

    Hello!

    what means “n” in the end of this:Local/$OUTNUM$@a2billing/n ?

    Thanks

  46. Jerm:

    This is very good work guys

  47. song:

    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

  48. matt:

    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?

  49. song:

    Plane with ring tones, but the phone call (mobile phone) all normal, just call the plane, the other party ringing sound is heard

  50. song:

    Landline calls without charging the account, with elastix extension to play outside all the normal plane

  51. song:

    hi matt elastix is behind a firewall (router) behind the

  52. matt:

    Did you try the ‘canreinvite=no’ on the trunk?

  53. song:

    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

  54. Jermaine:

    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

  55. Jermaine:

    this is the incoming log

    — 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′

  56. Jermaine:

    Verbosity is at least 3
    — 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′

  57. Jermaine:

    This is the latest log when i try to make a call

    Executing last minute cleanups
    [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>

  58. 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?

  59. Dennis:

    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

  60. matt:

    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

  61. sebastian escapil:

    HI Matt. Tks for this useful guide
    I 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

  62. 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:
    Description 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.

Leave a comment