-1

I am trying to configure asterisk to work with a2billing. I need a prepaid billing system for the extensions provisioned on my system, so I will only be billing extension to extension calls for now.

I cannot seem to find any comprehensive tutorial that does this(i.e without outside connectivity billing). Any help would be appreciated.

user3317524
  • 63
  • 1
  • 10

1 Answers1

0

You need setup context like this in /etc/asterisk/extensions.conf:

 [a2billing]
 exten => _X.,1,AGI(a2billing.php,1)

After that in agi-conf1 you need set use-dnid=yes, number-try=1, play-audio=no

And assign to your extension accountcode=username(pin) in a2billing and context=a2billing

After that you can call ext2ext using 5555 prefix(default).

Or you can use context

  [exts]
  exten => _X.,1,Set(CDR(DNID)=5555${EXTEN})
  exten => _X.,2,Goto(a2billing,5555${EXTEN},1)
arheops
  • 15,544
  • 1
  • 21
  • 27
  • Thanks arheops..I get the following error when attempting a call: **Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php PHP Fatal error: Class 'AGI' not found in /var/lib/asterisk/agi-bin/a2billing.php on line 59** what do you think?? – user3317524 Mar 14 '14 at 22:47
  • That mean you not installed a2billing correctly(acordinly to INSTALL file). Please reinstall as described. – arheops Mar 15 '14 at 02:49
  • In this particular situation most likly you have no link from /usr/local/src/a2billing/common/lib to /var/lib/asterisk/agi-conf/lib. But better do full correct install, can be other issues. – arheops Mar 15 '14 at 02:51
  • thanks soo much. i went back to setup the AGI correctly and it worked: **cd /usr/src/a2billing/AGI cp a2billing.php /var/lib/asterisk/agi-bin cp a2billing_monitoring.php /var/lib/asterisk/agi-bin chown -R asterisk:asterisk /var/lib/asterisk/agi-bin chmod 755 /var/lib/asterisk/agi-bin/a2billing.php chmod 755 /var/lib/asterisk/agi-bin/a2billing_monitoring.php ln -s /var/www/html/a2billing/common/lib /var/lib/asterisk/agi-bin/lib** – user3317524 Mar 15 '14 at 14:18