Professional Documents
Culture Documents
Elastix A2billing
November 23, 2009 at 3:49 am Leave a comment
Step 3: Download a2billing tar package and create under folder /usr/local/src
[root@elastix agi-bin]# cd /usr/local/src/a2billing/
[root@elastix a2billing]#
[root@elastix a2billing]# wget http://www.asterisk2billing.org/downloads/A2Billing_1.4.1.tar.gz
–14:57:54– http://www.asterisk2billing.org/downloads/A2Billing_1.4.1.tar.gz
Resolving Error! Hyperlink reference not valid.; 94.23.22.127
Connecting to http://www.asterisk2billing.org|94.23.22.127|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 9658300 (9.2M) [application/x-gzip]
Saving to: `A2Billing_1.4.1.tar.gz’
100%[==========================================================================
=================>] 9,658,300 91.2K/s in 58s
14:58:54 (163 KB/s) – `A2Billing_1.4.1.tar.gz’ saved [9658300/9658300]
[root@elastix a2billing]#
Step 4: Untar tha package
[root@elastix a2billing]# tar zxvf A2Billing_1.4.1.tar.gz
Step 5: create a MySQL database (mya2billing) for the billing software.
The file a2billing-createdb-user.sql includes a script that creates the database with the correct access
control users and permissions.
#cd /usr/local/src/a2billing
After creating the database structure, we will create a set of tables and insert some initial basic
configuration data
[root@elastix a2billing]# cd /usr/local/src/a2billing
[root@elastix a2billing]# mysql -u root -p
Enter password: eLaStIx.2oo7
[root@elastix a2billing]# mysql -u root -p mya2billing
Enter password: eLaStIx.2oo7
[root@elastix a2billing]# mysql -u root -p mya2billing
Enter password: eLaStIx.2oo7
Step 6: Copy the a2billing configuration file to /etc folder
[root@elastix a2billing]# cp /usr/local/src/a2billing/a2billing.conf /etc/
#vi /etc/a2billing.conf
Change the “database” paramenter as follow, the other paramaters must remain unchanged:
[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
dbtype = mysql
Step 8: Create the additional files and setup the correct owner:
Create the additional files and setup the correct owner
#touch /etc/asterisk/additional_a2billing_iax.conf
#touch /etc/asterisk/additional_a2billing_sip.conf
secret=mycode
read=system,call,log,verbose,command,agent,user
write=system,call,log,verbose,command,agent,user
Step 11: Copy the entire content of the AGI directory into asterisk agi-bin directory.
#cd /usr/local/src/a2billing/AGI
#chmod +x /var/lib/asterisk/agi-bin/a2billing.php
Step 12: Installing the GUI interface
#mv /var/www/html/a2billing /var/www/html/a2billing-old
#mkdir /var/www/html/a2billing
pass: changepassword
Step 13 : Add the file /etc/asterisk/extensions_a2billing.conf with the follow lines:
[a2billing]
; CallingCard application
; CallingCard application
0 6 * * * php /usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php
# manage the monthly services subscription
0 6 1 * * php /usr/local/src/a2billing/Cronjobs/a2billing_subscription_fee.php
# To check account of each Users and send an email if the balance is
# bill them or warn them per email to know if they want to pay in
0 2 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_bill_diduse.php
# This script will take care of the recurring service.
0 12 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_process.php
# To generate invoices and for each user.
0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_invoice_cront.php
# to proceed the autodialer
0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm.php