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/[email protected]/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

103 thoughts on “Part 8 – Create a custom trunk in Elastix for use with A2Billing

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

  3. 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/[email protected]/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

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

  5. matt Post author

    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.

  6. sip

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

  7. matt Post author

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

  8. 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
    [[email protected] 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

  9. matt Post author

    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

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

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

  12. matt Post author

    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.

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

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

  15. matt Post author

    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

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

  17. matt Post author

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

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

  19. matt Post author

    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.

  20. jose

    I tried to configure the trunknd extendtions in the freepbx it’s 100% working but when I change the outbound route for Local/[email protected]/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.

  21. matt Post author

    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.

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

  23. matt Post author

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

  24. matt Post author

    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

  25. jose

    Hello Sir

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

  26. jose

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

  27. matt Post author

    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.

  28. jose

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

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

  30. matt Post author

    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.

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

  32. matt Post author

    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.

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

  34. jose

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

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

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

  37. matt Post author

    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.

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

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

  40. matt Post author

    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?

  41. song

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

  42. song

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

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

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

  45. 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 [[email protected]:1] NoOp(“DAHDI/2-1”, “Entering from-dahdi with DID == “) in new stack
    — Executing [[email protected]:2] Ringing(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] Set(“DAHDI/2-1”, “DID=s”) in new stack
    — Executing [[email protected]:4] NoOp(“DAHDI/2-1”, “DID is now s”) in new stack
    — Executing [[email protected]:5] GotoIf(“DAHDI/2-1”, “1?dahdiok:checkzap”) in new stack
    — Goto (from-zaptel,s,9)
    — Executing [[email protected]:9] NoOp(“DAHDI/2-1”, “Is a DAHDI Channel”) in new stack
    — Executing [[email protected]:10] Set(“DAHDI/2-1”, “CHAN=2-1”) in new stack
    — Executing [[email protected]:11] Set(“DAHDI/2-1”, “CHAN=2”) in new stack
    — Executing [[email protected]:12] Macro(“DAHDI/2-1”, “from-dahdi-2,s,1”) in new stack
    — Executing [[email protected]:13] NoOp(“DAHDI/2-1”, “Returned from Macro from-dahdi-2”) in new stack
    — Executing [[email protected]:14] Goto(“DAHDI/2-1”, “from-pstn,s,1”) in new stack
    — Goto (from-pstn,s,1)
    — Executing [[email protected]:1] Set(“DAHDI/2-1”, “__FROM_DID=s”) in new stack
    — Executing [[email protected]:2] Gosub(“DAHDI/2-1”, “app-blacklist-check,s,1”) in new stack
    — Executing [[email protected]:1] GotoIf(“DAHDI/2-1”, “0?blacklisted”) in new stack
    — Executing [[email protected]:2] Set(“DAHDI/2-1”, “CALLED_BLACKLIST=1”) in new stack
    — Executing [[email protected]:3] Return(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] ExecIf(“DAHDI/2-1”, “1 ?Set(CALLERID(name)=)”) in new stack
    — Executing [[email protected]:4] Set(“DAHDI/2-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
    — Executing [[email protected]:5] Set(“DAHDI/2-1”, “CALLERPRES()=allowed_not_screened”) in new stack
    — Executing [[email protected]: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’

  46. Jermaine

    Verbosity is at least 3
    — Starting simple switch on ‘DAHDI/2-1’
    — Executing [[email protected]:1] NoOp(“DAHDI/2-1”, “Entering from-dahdi with DID == “) in new stack
    — Executing [[email protected]:2] Ringing(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] Set(“DAHDI/2-1”, “DID=s”) in new stack
    — Executing [[email protected]:4] NoOp(“DAHDI/2-1”, “DID is now s”) in new stack
    — Executing [[email protected]:5] GotoIf(“DAHDI/2-1”, “1?dahdiok:checkzap”) in new stack
    — Goto (from-zaptel,s,9)
    — Executing [[email protected]:9] NoOp(“DAHDI/2-1”, “Is a DAHDI Channel”) in new stack
    — Executing [[email protected]:10] Set(“DAHDI/2-1”, “CHAN=2-1”) in new stack
    — Executing [[email protected]:11] Set(“DAHDI/2-1”, “CHAN=2”) in new stack
    — Executing [[email protected]:12] Macro(“DAHDI/2-1”, “from-dahdi-2,s,1”) in new stack
    — Executing [[email protected]:13] NoOp(“DAHDI/2-1”, “Returned from Macro from-dahdi-2”) in new stack
    — Executing [[email protected]:14] Goto(“DAHDI/2-1”, “from-pstn,s,1”) in new stack
    — Goto (from-pstn,s,1)
    — Executing [[email protected]:1] Set(“DAHDI/2-1”, “__FROM_DID=s”) in new stack
    — Executing [[email protected]:2] Gosub(“DAHDI/2-1”, “app-blacklist-check,s,1”) in new stack
    — Executing [[email protected]:1] GotoIf(“DAHDI/2-1”, “0?blacklisted”) in new stack
    — Executing [[email protected]:2] Set(“DAHDI/2-1”, “CALLED_BLACKLIST=1”) in new stack
    — Executing [[email protected]:3] Return(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] ExecIf(“DAHDI/2-1”, “1 ?Set(CALLERID(name)=)”) in new stack
    — Executing [[email protected]:4] Set(“DAHDI/2-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
    — Executing [[email protected]:5] Set(“DAHDI/2-1”, “CALLERPRES()=allowed_not_screened”) in new stack
    — Executing [[email protected]: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 [[email protected]:1] NoOp(“DAHDI/2-1”, “Entering from-dahdi with DID == “) in new stack
    — Executing [[email protected]:2] Ringing(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] Set(“DAHDI/2-1”, “DID=s”) in new stack
    — Executing [[email protected]:4] NoOp(“DAHDI/2-1”, “DID is now s”) in new stack
    — Executing [[email protected]:5] GotoIf(“DAHDI/2-1”, “1?dahdiok:checkzap”) in new stack
    — Goto (from-zaptel,s,9)
    — Executing [[email protected]:9] NoOp(“DAHDI/2-1”, “Is a DAHDI Channel”) in new stack
    — Executing [[email protected]:10] Set(“DAHDI/2-1”, “CHAN=2-1”) in new stack
    — Executing [[email protected]:11] Set(“DAHDI/2-1”, “CHAN=2”) in new stack
    — Executing [[email protected]:12] Macro(“DAHDI/2-1”, “from-dahdi-2,s,1”) in new stack
    — Executing [[email protected]:13] NoOp(“DAHDI/2-1”, “Returned from Macro from-dahdi-2”) in new stack
    — Executing [[email protected]:14] Goto(“DAHDI/2-1”, “from-pstn,s,1”) in new stack
    — Goto (from-pstn,s,1)
    — Executing [[email protected]:1] Set(“DAHDI/2-1”, “__FROM_DID=s”) in new stack
    — Executing [[email protected]:2] Gosub(“DAHDI/2-1”, “app-blacklist-check,s,1”) in new stack
    — Executing [[email protected]:1] GotoIf(“DAHDI/2-1”, “0?blacklisted”) in new stack
    — Executing [[email protected]:2] Set(“DAHDI/2-1”, “CALLED_BLACKLIST=1”) in new stack
    — Executing [[email protected]:3] Return(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] ExecIf(“DAHDI/2-1”, “1 ?Set(CALLERID(name)=)”) in new stack
    — Executing [[email protected]:4] Set(“DAHDI/2-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
    — Executing [[email protected]:5] Set(“DAHDI/2-1”, “CALLERPRES()=allowed_not_screened”) in new stack
    — Executing [[email protected]: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 [[email protected]:1] NoOp(“DAHDI/2-1”, “Entering from-dahdi with DID == “) in new stack
    — Executing [[email protected]:2] Ringing(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] Set(“DAHDI/2-1”, “DID=s”) in new stack
    — Executing [[email protected]:4] NoOp(“DAHDI/2-1”, “DID is now s”) in new stack
    — Executing [[email protected]:5] GotoIf(“DAHDI/2-1”, “1?dahdiok:checkzap”) in new stack
    — Goto (from-zaptel,s,9)
    — Executing [[email protected]:9] NoOp(“DAHDI/2-1”, “Is a DAHDI Channel”) in new stack
    — Executing [[email protected]:10] Set(“DAHDI/2-1”, “CHAN=2-1”) in new stack
    — Executing [[email protected]:11] Set(“DAHDI/2-1”, “CHAN=2”) in new stack
    — Executing [[email protected]:12] Macro(“DAHDI/2-1”, “from-dahdi-2,s,1”) in new stack
    — Executing [[email protected]:13] NoOp(“DAHDI/2-1”, “Returned from Macro from-dahdi-2”) in new stack
    — Executing [[email protected]:14] Goto(“DAHDI/2-1”, “from-pstn,s,1”) in new stack
    — Goto (from-pstn,s,1)
    — Executing [[email protected]:1] Set(“DAHDI/2-1”, “__FROM_DID=s”) in new stack
    — Executing [[email protected]:2] Gosub(“DAHDI/2-1”, “app-blacklist-check,s,1”) in new stack
    — Executing [[email protected]:1] GotoIf(“DAHDI/2-1”, “0?blacklisted”) in new stack
    — Executing [[email protected]:2] Set(“DAHDI/2-1”, “CALLED_BLACKLIST=1”) in new stack
    — Executing [[email protected]:3] Return(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] ExecIf(“DAHDI/2-1”, “1 ?Set(CALLERID(name)=)”) in new stack
    — Executing [[email protected]:4] Set(“DAHDI/2-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
    — Executing [[email protected]:5] Set(“DAHDI/2-1”, “CALLERPRES()=allowed_not_screened”) in new stack
    — Executing [[email protected]: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 [[email protected]:1] NoOp(“DAHDI/2-1”, “Entering from-dahdi with DID == “) in new stack
    — Executing [[email protected]:2] Ringing(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] Set(“DAHDI/2-1”, “DID=s”) in new stack
    — Executing [[email protected]:4] NoOp(“DAHDI/2-1”, “DID is now s”) in new stack
    — Executing [[email protected]:5] GotoIf(“DAHDI/2-1”, “1?dahdiok:checkzap”) in new stack
    — Goto (from-zaptel,s,9)
    — Executing [[email protected]:9] NoOp(“DAHDI/2-1”, “Is a DAHDI Channel”) in new stack
    — Executing [[email protected]:10] Set(“DAHDI/2-1”, “CHAN=2-1”) in new stack
    — Executing [[email protected]:11] Set(“DAHDI/2-1”, “CHAN=2”) in new stack
    — Executing [[email protected]:12] Macro(“DAHDI/2-1”, “from-dahdi-2,s,1”) in new stack
    — Executing [[email protected]:13] NoOp(“DAHDI/2-1”, “Returned from Macro from-dahdi-2”) in new stack
    — Executing [[email protected]:14] Goto(“DAHDI/2-1”, “from-pstn,s,1”) in new stack
    — Goto (from-pstn,s,1)
    — Executing [[email protected]:1] Set(“DAHDI/2-1”, “__FROM_DID=s”) in new stack
    — Executing [[email protected]:2] Gosub(“DAHDI/2-1”, “app-blacklist-check,s,1”) in new stack
    — Executing [[email protected]:1] GotoIf(“DAHDI/2-1”, “0?blacklisted”) in new stack
    — Executing [[email protected]:2] Set(“DAHDI/2-1”, “CALLED_BLACKLIST=1”) in new stack
    — Executing [[email protected]:3] Return(“DAHDI/2-1”, “”) in new stack
    — Executing [[email protected]:3] ExecIf(“DAHDI/2-1”, “1 ?Set(CALLERID(name)=)”) in new stack
    — Executing [[email protected]:4] Set(“DAHDI/2-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
    — Executing [[email protected]:5] Set(“DAHDI/2-1”, “CALLERPRES()=allowed_not_screened”) in new stack
    — Executing [[email protected]: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’

  47. Jermaine

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

    Executing last minute cleanups
    [[email protected] ~]# 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 [[email protected]:1] Macro(“SIP/99915-00000013”, “user-callerid,SKIPTTL,”) in new stack
    — Executing [[email protected]:1] Set(“SIP/99915-00000013”, “AMPUSER=99915”) in new stack
    — Executing [[email protected]:2] GotoIf(“SIP/99915-00000013”, “0?report”) in new stack
    — Executing [[email protected]:3] ExecIf(“SIP/99915-00000013”, “1?Set(REALCALLERIDNUM=99915)”) in new stack
    — Executing [[email protected]:4] Set(“SIP/99915-00000013”, “AMPUSER=99915”) in new stack
    — Executing [[email protected]:5] Set(“SIP/99915-00000013”, “AMPUSERCIDNAME=TMS Support”) in new stack
    — Executing [[email protected]:6] GotoIf(“SIP/99915-00000013”, “0?report”) in new stack
    — Executing [[email protected]:7] Set(“SIP/99915-00000013”, “AMPUSERCID=99915”) in new stack
    — Executing [[email protected]:8] Set(“SIP/99915-00000013”, “CALLERID(all)=”TMS Support” “) in new stack
    — Executing [[email protected]:9] ExecIf(“SIP/99915-00000013”, “0?Set(CHANNEL(language)=)”) in new stack
    — Executing [[email protected]:10] GotoIf(“SIP/99915-00000013”, “1?continue”) in new stack
    — Goto (macro-user-callerid,s,19)
    — Executing [[email protected]:19] Set(“SIP/99915-00000013”, “CALLERID(number)=99915”) in new stack
    — Executing [[email protected]:20] Set(“SIP/99915-00000013”, “CALLERID(name)=TMS Support”) in new stack
    — Executing [[email protected]:21] NoOp(“SIP/99915-00000013”, “Using CallerID “TMS Support” “) in new stack
    — Executing [[email protected]:2] NoOp(“SIP/99915-00000013”, “Calling Out Route: International_Out”) in new stack
    — Executing [[email protected]:3] Set(“SIP/99915-00000013”, “MOHCLASS=default”) in new stack
    — Executing [[email protected]:4] Set(“SIP/99915-00000013”, “_NODEST=”) in new stack
    — Executing [[email protected]:5] Macro(“SIP/99915-00000013”, “record-enable,99915,OUT,”) in new stack
    — Executing [[email protected]:1] GotoIf(“SIP/99915-00000013”, “1?check”) in new stack
    — Goto (macro-record-enable,s,4)
    — Executing [[email protected]:4] ExecIf(“SIP/99915-00000013”, “0?MacroExit()”) in new stack
    — Executing [[email protected]:5] GotoIf(“SIP/99915-00000013”, “0?Group:OUT”) in new stack
    — Goto (macro-record-enable,s,15)
    — Executing [[email protected]:15] GotoIf(“SIP/99915-00000013”, “0?IN”) in new stack
    — Executing [[email protected]:16] ExecIf(“SIP/99915-00000013”, “1?MacroExit()”) in new stack
    — Executing [[email protected]:6] Macro(“SIP/99915-00000013”, “dialout-trunk,4,18763838922,”) in new stack
    — Executing [[email protected]:1] Set(“SIP/99915-00000013”, “DIAL_TRUNK=4”) in new stack
    — Executing [[email protected]:2] GosubIf(“SIP/99915-00000013”, “0?sub-pincheck,s,1”) in new stack
    — Executing [[email protected]:3] GotoIf(“SIP/99915-00000013”, “0?disabletrunk,1”) in new stack
    — Executing [[email protected]:4] Set(“SIP/99915-00000013”, “DIAL_NUMBER=18763838922”) in new stack
    — Executing [[email protected]:5] Set(“SIP/99915-00000013”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
    — Executing [[email protected]:6] Set(“SIP/99915-00000013”, “OUTBOUND_GROUP=OUT_4”) in new stack
    — Executing [[email protected]:7] GotoIf(“SIP/99915-00000013”, “1?nomax”) in new stack
    — Goto (macro-dialout-trunk,s,9)
    — Executing [[email protected]:9] GotoIf(“SIP/99915-00000013”, “0?skipoutcid”) in new stack
    — Executing [[email protected]:10] Set(“SIP/99915-00000013”, “DIAL_TRUNK_OPTIONS=”) in new stack
    — Executing [[email protected]:11] Macro(“SIP/99915-00000013”, “outbound-callerid,4”) in new stack
    — Executing [[email protected]:1] ExecIf(“SIP/99915-00000013”, “0?Set(CALLERPRES()=)”) in new stack
    — Executing [[email protected]:2] ExecIf(“SIP/99915-00000013”, “0?Set(REALCALLERIDNUM=99915)”) in new stack
    — Executing [[email protected]:3] GotoIf(“SIP/99915-00000013”, “1?normcid”) in new stack
    — Goto (macro-outbound-callerid,s,6)
    — Executing [[email protected]:6] Set(“SIP/99915-00000013”, “USEROUTCID=”) in new stack
    — Executing [[email protected]:7] Set(“SIP/99915-00000013”, “EMERGENCYCID=”) in new stack
    — Executing [[email protected]:8] Set(“SIP/99915-00000013”, “TRUNKOUTCID=”) in new stack
    — Executing [[email protected]:9] GotoIf(“SIP/99915-00000013”, “1?trunkcid”) in new stack
    — Goto (macro-outbound-callerid,s,12)
    — Executing [[email protected]:12] ExecIf(“SIP/99915-00000013”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [[email protected]:13] ExecIf(“SIP/99915-00000013”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [[email protected]:14] ExecIf(“SIP/99915-00000013”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [[email protected]:15] ExecIf(“SIP/99915-00000013”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
    — Executing [[email protected]:12] GosubIf(“SIP/99915-00000013”, “0?sub-flp-4,s,1”) in new stack
    — Executing [[email protected]:13] Set(“SIP/99915-00000013”, “OUTNUM=18763838922”) in new stack
    — Executing [[email protected]:14] Set(“SIP/99915-00000013”, “custom=AMP”) in new stack
    — Executing [[email protected]:15] ExecIf(“SIP/99915-00000013”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
    — Executing [[email protected]:16] Macro(“SIP/99915-00000013”, “dialout-trunk-predial-hook,”) in new stack
    — Executing [[email protected]:1] MacroExit(“SIP/99915-00000013”, “”) in new stack
    — Executing [[email protected]:17] GotoIf(“SIP/99915-00000013”, “0?bypass,1”) in new stack
    — Executing [[email protected]:18] GotoIf(“SIP/99915-00000013”, “1?customtrunk”) in new stack
    — Goto (macro-dialout-trunk,s,22)
    — Executing [[email protected]:22] Set(“SIP/99915-00000013”, “pre_num=AMP:Local/”) in new stack
    — Executing [[email protected]:23] Set(“SIP/99915-00000013”, “the_num=OUTNUM”) in new stack
    — Executing [[email protected]:24] Set(“SIP/99915-00000013”, “[email protected]/n”) in new stack
    — Executing [[email protected]:25] GotoIf(“SIP/99915-00000013”, “1?outnum:skipoutnum”) in new stack
    — Goto (macro-dialout-trunk,s,26)
    — Executing [[email protected]:26] Set(“SIP/99915-00000013”, “the_num=18763838922”) in new stack
    — Executing [[email protected]:27] Dial(“SIP/99915-00000013”, “Local/[email protected]/n,300,”) in new stack
    — Called Local/[email protected]/n
    — Executing [[email protected]:1] DeadAGI(“Local/[email protected];2”, “a2billing.php,1”) in new stack
    — Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
    — Local/[email protected];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>

  48. matt Post author

    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?

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

  50. matt Post author

    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

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

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

  53. longstand

    Can you give a Link to that Download Page of where you got Preserve accountcode, and how to install it please. dont leave us hanging. haha.. you fix it. now we need to fix ours. share. share. LOL

  54. lyly

    Hi,

    I want to add new customers on A2billing but i don’t know different to payment type prepaid vs postpaid. Please tell me if you know. Thanks

  55. matt Post author

    Prepay = customer must be in positive balance before they can call
    Postpay = customer can make calls then pay for them afterwards

  56. lyly

    Hi Matt,
    Thanks for your answer. I have add new customer with payment type is postpaid. Then I make call with it. And I see money in BALANCE was reduced immediately after the call. I don’t understand it. Please tell me why so? Have I set wrong?

  57. matt Post author

    Sounds correct to me. Postpaid balances will go negative when a call is made.

  58. lyly

    Hi Matt,
    Can you give to me guide setup new customer with payment type postpaid? I have tried again but result remains the same. I do not know what I was doing wrong step. Do you use Skype? I could ask you on it? Thanks so much ^^

  59. John

    The simple change 1_4 to 1_6 it saved me a week of work. Many thanks, God Bless You!

  60. Evil

    Hi MAtt
    I use Elastix 2.3 I logged Account A2billing on the softphone success: making calls, listening to the notice of the amount available in the account and asked to press a phone number to call, When you click the phone number to call,do not call Please help .Thank you very much

  61. matt Post author

    If it’s working in the simulator it’s most likely the trunk setup that’s wrong.

    But you say you are calling from an Elastix extension? That complicates things as the call is passed from FreePBX to A2Billing.

    While setting up I would advise using a SIP device (or softphone) directly connected to an a2billing SIP user account.

  62. Evil

    hi Matt
    sorry to bother last time
    when I use a2billing SIP account to call the number 84979076610 is not known to be
    Please help me .. thank a lot

  63. Brian

    Hi.

    I am using freepbx 2.10.1.2 with asterisk 1.8.16.0 and A2billing 1.9.4

    My install of A2billing was done from the instructions on the URL http://www.powerpbx.org/content/a2billing-install-guide-v1

    I followed your instuctions on youtube for connecting freepbx to A2billing, but I am still unable to get Freepbx to pass a call to A2billing.

    I can recieve calls from my DID to an extension. However when I change the destination on the inbound route to “custom destination & A2billing – callthrough” or “custom destination & A2billing – DID” I get a busy signal.

    I have also tried sending the calls to the A2billing custom trunk that was created from the instructions on the website i mentioned above. But still without success.

    Any help to get this system working would be greatly appreciated.

  64. Brian

    below is one of the errors that i am receiving.

    [2012-10-18 19:20:30] WARNING[5227]: channel.c:5638 ast_request: No channel type registered for ‘A2B’
    [2012-10-18 19:20:30] WARNING[5227]: app_dial.c:2341 dial_exec_full: Unable to create channel of type ‘A2B’ (cause 66 – Channel not implemented)
    == Everyone is busy/congested at this time (1:0/0/1)
    — Executing [[email protected]:11] Hangup(“SIP/145934-00000013”, “”) in new stack
    == Spawn extension (ext-trunk, tcustom, 11) exited non-zero on ‘SIP/145934-00000013’

  65. Evil

    Yes..SIP account of a2billing work in the simulator
    But when I register with softphone,it can not be called

  66. Amit

    This guide is a tutorial!
    I’m trying to set up Elastix 2.3 with the new A2Billing 1.9.4, and step 8 seems to be off. I can’t seem to find a2billing.conf nor extensions_a2billing.conf. Do you have any experience with this new release of A2Billing. Any help will be appreciated.

  67. Amit

    I did a little more digging and an found an a2billing context in extension_a2billing_additionals.conf

  68. matt Post author

    Those instructions are a for an older version of a2billing than you are running. The a2billing.conf file now lives under /etc, but it only contains database connection details, all other configuration settings are now stored in the MySQL database.

    If A2Billing is not running in ‘realtime’ mode (non realtime mode will be the default), when you create a SIP account in a2billing those details are written to a file called additional_a2billing_sip.conf. You need to make sure that Asterisk config file is being loaded by Asterisk. There will be a line saying – “#include additional_a2billing_sip.conf’ in one of the other Asterisk config files.

  69. Sidnei

    Alguem se disponibilizaria para dar um treinamento, para empresa após negociarmos um valor.

  70. Monowar

    When i press completely pin number system gave me sip iax number. what is sip iax number please help me urgent………………………pls

  71. matt Post author

    I don’t understand? The SIP number is the SIP account number you use to connect a SIP client to A2Billing.

  72. Monowar

    when i called the customer it asks me the enter sip-iax number and no sipiax number match . which number i should enter when it asks me??
    Sound file is Playing ‘prepaid-sipiax-enternumber.gsm’ (language ‘en’)

  73. Moustafa

    Hello,
    I need your help .
    I make all the steps but after i set Custom trunk and make Outbound Routes to Custom trunk ( Local/[email protected]/n )
    it not work and i get .all circuits are busy now .
    I’m try all this steps with call with us to free test call and it work good without make Custom trunk .
    So please Help Me Step by Step .
    also i need to know after make echo is ” or ‘ witch one
    Thanks

  74. Moustafa

    Thank you i do i change Elastix from 1.6 to 2.4
    and all Steps Work Good .
    Can you help me to know how can VOUCHER work ? to can any Clint call through the calling card ?
    Thanks

  75. Desire

    Hello Matt,

    I am trying to setup elastix-a2billing 1.8.1 on asterisk 1.8.5.0. i have managed to check the a2billing settings using the simulator but when i check my extensions_a2billing.conf i find it empty! i think that is supposed to contain a2billing dialplan.
    i would like to ask you if you can guide me or troubleshoot.

    Thank you

  76. Nesreen

    hello,
    I tried this in elastix 2.6.1 and A2billing 1.9.4 but the last step in astrix doesn’t work ,
    can you help me please,
    thanks.

  77. Abhishek

    First of all thank you for all your help. It helps alot to beginners.

    I have installed Elastix 2.4.0 in my cloud server and I have a2billing 1.9.4.

    I have created trunk,outbound route, custom trunk etc everything step by step following your blog. But after completing the step “Part 8 – Create a custom trunk in Elastix for use with A2Billing” when i make call from my extension i get “please enter the number you wish to call and then press the pound key” just after hearing this message call gets hangup automatically.

    Can you please suggest me what to do? I am new in PBX and VoIP Switch

Comments are closed.