Getting started with A2Billing – Part 3 Creating an access DID

Now we’ve got a trunk setup and a rate card and call plan we need a way for our potential customers to actually connect to our system! One way for them to do this is via an access phone number. To test this I’m going to use the IPKall DID we setup here in FreePBX.

This assumes that FreePBX has been setup with some a2billing custom destinations as described here – http://www.freepbx.org/forum/freepbx/installation/inbound-sip-trunk-doesnt-call-extensions. Sysadminman VOIP VPSs are preconfigured for this.

Setting the inbound access number (DID) in FreePBX

This is changing the access DID we created here

In FreePBX click on Inbound Routes on the left hand main menu

Then select “ipkall” (the DID we created here)

screenshot-3_2_2009-12_49_14-pm

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

screenshot-3_2_2009-12_37_47-pm

Don’t forget to click on “Apply Configuration Changes”

Now if we dial our IPKall DID we should be asked by a2billing to “Please enter your complete PIN number”

screenshot-3_2_2009-12_38_08-pm

17 thoughts on “Getting started with A2Billing – Part 3 Creating an access DID

  1. mepj

    Hi,
    I was just wondering how you created a2billing “custom destination” as you did not make mention of steps to create it. I tried to create it but it turned errors only.
    thank you.
    Mepj

  2. matt Post author

    Hi Mepj,

    I have made a post here describing how to create those destinations. It does involve editing some config files on the server.

    Regards, Matt

  3. mepj

    thank you Matt, i tried the guide to create the custom a2b in freepbx but when I dial into the system nothing happens I only get busy signal hungup and see the following in console. all out going calls from extensions are “call rejected”

    Set(“SIP/abc-trunk-c0136058”, “__FROM_DID=1111111111”) in new stack
    — Executing [[email protected]:2] ExecIf(“SIP/abc-trunk-c0136058”, “0 ?Set(CALLERID(name)=5555555555)”) in new stack
    — Executing [[email protected]:3] Set(“SIP/abc-trunk-c0136058”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
    — Executing [[email protected]:4] Set(“SIP/abc-trunk-c0136058”, “CALLERPRES()=allowed_not_screened”) in new stack
    — Executing [[email protected]:5] Goto(“SIP/abc-trunk-c0136058”, “custom-a2billing-did,1111111111,1”) in new stack
    — Goto (custom-a2billing-did,1111111111,1)
    — Executing [[email protected]:1] DeadAGI(“SIP/abc-trunk-c0136058”, “a2billing.php|1|did”) in new stack
    — Executing [[email protected]:2] Hangup(“SIP/abc-trunk-c0136058”, “”) in new stack
    == Spawn extension (custom-a2billing-did, 1111111111, 2) exited non-zero on ‘SIP/abc-trunk-c0136058’

    what is likely the reason?

    thanks.
    Mepj

  4. matt Post author

    Hi mepj, looks like it’s hitting that custom destination ok and trying to be passed to a2billing. Does the php file exist in the correct place? You should have a file called /var/lib/asterisk/agi-bin/a2billing.php (and also /var/lib/asterisk/agi-bin/libs_a2billing)

  5. matt Post author

    You could try checking in /etc/asterisk/a2billing.conf to see what “debug” is set to. Try setting “debug=3”, hopefully that will give you more information in the logs about what is going on.

  6. Dec

    Hello Matt..

    I am having the same issue and i cant find the libs_a2billing directory in my a2billing 1.4.1 installation.. Any ideas?

    Regards.

    Dec

  7. matt Post author

    Hi Dec,

    I think you should be able to find it at – /var/lib/asterisk/agi-bin/lib – or at least a symbolic link to where the files actually are. What do you have there?

    Matt

  8. sana

    Hi Mat
    I have a problem with this setup. I can call through callwithus sip without a2billing configuration successfully. However, with a2billing I can enter customer pin number and enter the phone number.Then it tell remaining minutes and DISCONNECTED. my log file gave “Got SIP response 484 “Address Incomplete” “. Do you have any idea?

  9. Riyaz

    Hi Matt,

    First i would like to thank to you for you excellent how to on Freepbx + A2billing, thanks a lot.Well, i got a problem on assigning DID with a2billing, i followed you tutorial steps by steps more than 10 times, seriously i can’t find any link between the trunk created on freepbx and my a2billing customers to making calls trough that trunk, and also if i make a call like that, dialing to my did the call disconnect immediatly, and this is what i got on my asterisk cli :

    http://paste.ubuntu.com/547077/

    Could you please check and tell me what’s wrong ? thanks a lot 🙂

  10. Yan

    hi Matt

    i have the same issue as Dec i do have the lib folder but do not have any A2billing.conf file in /etc/asterisk/a2billing.conf
    i am using A2Billing 1.9.4

    any idea

    thanks

  11. matt Post author

    For 1.9.4 the a2billing config file should be /etc/a2billing.conf

    All this does really is have access details to the database. All other config is stored in the database.

  12. Yan

    Hi Matt

    yes, the files is there since i changed the extension.conf adding the line mentioned in the Integrating FreePBX with A2Billing tuto when i then dial a number for outbond, i got call unable to be established and this log in console

    — Executing [[email protected]:2] Goto(“SIP/7605848339-00000007”, “ext-did,s,1”) in new stack
    — Goto (ext-did,s,1)
    — Executing [[email protected]:1] Set(“SIP/7605848339-00000007”, “__FROM_DID=s”) in new stack
    — Executing [[email protected]:2] Gosub(“SIP/7605848339-00000007”, “app-blacklist-check,s,1”) in new stack
    — Executing [[email protected]:1] GotoIf(“SIP/7605848339-00000007”, “0?blacklisted”) in new stack
    — Executing [[email protected]:2] Return(“SIP/7605848339-00000007”, “”) in new stack
    — Executing [[email protected]:3] ExecIf(“SIP/7605848339-00000007”, “0 ?Set(CALLERID(name)=7605848339)”) in new stack
    — Executing [[email protected]:4] Set(“SIP/7605848339-00000007”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
    — Executing [[email protected]:5] Set(“SIP/7605848339-00000007”, “CALLERPRES()=allowed_not_screened”) in new stack
    — Executing [[email protected]:6] Goto(“SIP/7605848339-00000007”, “a2billing,s,1”) in new stack
    — Goto (a2billing,s,1)
    — ast_get_srv: SRV lookup for ‘_sip._UDP.sip.callwithus.com’ mapped to host sip.callwithus.com, port 5060
    trixbox1*CLI>

    The trunk work when i use an asterisk extension extension i could dial out , but not with a2billing
    also my did inbound number does not work with a2billing. wheni put a2billing in destination i received an answer msg on the phone, if changed to en asterisk extension or hold forever it does work,

    any ideas

    thanks

  13. elmohem

    Hi

    I am ready used IPKALL number but can not get any result. I will copy part of out on the CLI
    us.invalid-00000004″, “1?skiprg”) in new stack
    — Goto (macro-hangupcall,s,45)
    — Executing [[email protected]:45] GotoIf(“SIP/anonymous.invalid-00000004”, “1?skipblkvm”) in new stack
    — Goto (macro-hangupcall,s,48)
    — Executing [[email protected]:48] GotoIf(“SIP/anonymous.invalid-00000004”, “1?theend”) in new stack
    — Goto (macro-hangupcall,s,50)
    — Executing [[email protected]:50] AGI(“SIP/anonymous.invalid-00000004”, “hangup.agi”

  14. elmohem

    — Executing [[email protected]:9] NoOp(“SIP/anonymous.invalid-0000000d”, “End of MIXMON check”) in new stack
    — Executing [[email protected]:10] GotoIf(“SIP/anonymous.invalid-0000000d”, “1?nomeetmemon”) in new stack
    — Goto (macro-hangupcall,s,28) — Executing [[email protected]:28] NoOp(“SIP/anonymous.invalid-0000000d”, “End of MEETME check”) in new stack
    — Executing [[email protected]:29] GotoIf(“SIP/anonymous.invalid-0000000d”, “1?noautomon”) in new stack
    — Goto (macro-hangupcall,s,34) — Executing [[email protected]:34] NoOp(“SIP/anonymous.invalid-0000000d”, “TOUCH_MONITOR_OUTPUT=”) in new stack
    — Executing [[email protected]:35] GotoIf(“SIP/anonymous.invalid-0000000d”, “1?noautomon2”) in new stack
    — Goto (macro-hangupcall,s,41) — Executing [[email protected]:41] NoOp(“SIP/anonymous.invalid-0000000d”, “MONITOR_FILENAME=”) in new stack
    — Executing [[email protected]:42] GotoIf(“SIP/anonymous.invalid-0000000d”, “1?skiprg”) in new stack
    — Goto (macro-hangupcall,s,45) — Executing [[email protected]:45] GotoIf(“SIP/anonymous.invalid-0000000d”, “1?skipblkvm”) in new stack
    — Goto (macro-hangupcall,s,48) — Executing [[email protected]:48] GotoIf(“SIP/anonymous.invalid-0000000d”, “1?theend”) in new stack
    — Goto (macro-hangupcall,s,50) — Executing [[email protected]:50] AGI(“SIP/anonymous.invalid-0000000d”, “hangup.agi”) in new stack
    — Launched AGI Script /var/lib/asterisk/agi-bin/hangup.agi
    — AGI Script hangup.agi completed, returning 0
    — Executing [[email protected]:51] Hangup(“SIP/anonymous.invalid-0000000d”, “”) in new stack
    == Spawn extension (macro-hangupcall, s, 51) exited non-zero on ‘SIP/anonymous.invalid-0000000d’ in macro ‘hangupcall’ == Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/anonymous.invalid-0000000d’
    fostatel*CLI>

Comments are closed.