__________________________________________________________ __________________________________________________________ _______________________________________________ 1. Installation Prerequisites 1. Install Dependencies 1. get A2Billing 2.

Install Database 3. Install the AGI and Sound Files 1. set ownership and permissions on AGI 2. Set up sounds 3. set ownership on sounds 4. Asterisk Manager 5. Install Web Pages 1. Common 2. Admin pages 3. Agent 4. Customer 6. Cronjobs 7. Create Log Files 1. Log files and Permissions 8. Callback 1. Callback Daemon installation Script 9. Dialplan 10. Reboot 11. Login 12. General Setup 13. Guidelines Installation Prerequisites It is assumed that you have already installed Asterisk on a suitable machine. This tutorial does not cover that part of the installation. If you are unfamiliar with the

Alternatively. Trixbox do recommend that their system is secured behind a firewall. so may not be suitable for connection directly to the Internet without some remedial work.com may provide a secure base on which to build A2Billing. Support and Managed Installation and Training services are available through http://www.com.3.install of Asterisk. and are familiar with 1.g. Asterisk Now. PBX in a Flash .www. Install Dependencies yum -y install perl-DBD-Pg subversion get A2Billing . e. or FonicaPABX www. If you have hand-rolled your own distribution.pbxinaflash.star2billing. and indeed. the author has no knowledge of the security measures in place with these distributions.com The distributions mentioned are based on Centos. These distributions can be installed on a VMWare image for testing if no hardware is available. However. so these instructions are Centos biased. then the we assume that you have the necessary dependencies already installed.fonicaprojects. it may be better to start with a pre-built distribution. Elastix and Trixbox are other possibilities to provide a base as part of the family of Asterisk / FreePBX / CentOS distributions.4.

the database password is passw0rd and the location is localhost cd /usr/local/src/a2billing/DataBase/mysql-5. Install the AGI and Sound Files So that we can easily update the system when changes are made during this period of change./install-db. so that an update from the SVN will immediately reflect in your A2Billing install.a2billing. Install Database Note that for Piaf and FonicaPABX. change dbtype to mysql. .conf in /usr/local/src/a2billing/a2billing.net/svn/asterisk2billing/trunk/ /usr/local/src/a2billing copy a2billing. so these will have to be done by hand.conf to suit your installation.g.conf Edit a2billing. e.conf You should now have a database called mya2billing with over 70 tables in it. Note that Database changes will not be included using this methodology. we are going to use links back to the location where we installed the SVN download.mkdir /usr/local/src/a2billing cd /usr/local/src/a2billing svn co --username guest --password guest http://svn.conf to /etc/a2billing.sh Answer the questions appropriately with reference to /etc/a2billing.x .

command.verbose. You can also simply move or copy the files into the appropriate location.log.verbose.0 permit=127. but for testing.php chmod +x /var/lib/asterisk/agi-bin/a2billing.0.user Install Web Pages Assumption is that apache2 root folder is /var/www/html .0.0.call.This is not the usual way of doing it.user write = system. Add the following lines [myasterisk] secret = mycode deny=0.agent.command.0.0.0.255.sh set ownership on sounds chown -R asterisk:asterisk /var/lib/asterisk/ Asterisk Manager Now edit /etc/asterisk/manager_custom.php set ownership and permissions on AGI chown asterisk:asterisk /var/lib/asterisk/agi-bin/a2billing.php Set up sounds cd /usr/local/src/a2billing/addons/sounds .log.agent.0 read = system.call.conf for those not using a pre-rolled distribution including FreePBX).php /var/lib/asterisk/agibin/a2billing. it works well.1/255./install_a2b_sounds. ln -s /usr/local/src/a2billing/AGI/a2billing.conf (or manager.0/0.255.

then you probably know what to set anyway. if you are not using a distro. then web group and ownership are asterisk and asterisk. chown -R asterisk:asterisk /var/www/html/a2billing/ chown -R asterisk:asterisk /usr/local/src/a2billing/common chown -R asterisk:asterisk /usr/local/src/a2billing/admin chown -R asterisk:asterisk /usr/local/src/a2billing/customer chown -R asterisk:asterisk /usr/local/src/a2billing/agent Cronjobs Create folder directory for Cronts PID #mkdir -p /var/run/a2billing echo " # Automatically added for A2Billing 0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm. If you are using a pre-rolled Distro.Common ln -s /usr/local/src/a2billing/common /var/www/html/a2billing/common Admin pages ln -s /usr/local/src/a2billing/admin /var/www/html/a2billing/admin Agent ln -s /usr/local/src/a2billing/agent /var/www/html/a2billing/agent Customer ln -s /usr/local/src/a2billing/customer /var/www/html/a2billing/customer Now we need to set permissions for Apache.php .

php " >> /var/spool/cron/asterisk Add directory for monitoring Script mkdir -p /var/lib/a2billing/script Create Log Files Log files and Permissions touch /var/log/asterisk/a2billing-daemon-callback.php #Check if balance below preset value.php #Charge subscriptions at 06:05 on the 1st of each month 0 6 1 * * php /usr/local/src/a2billing/Cronjobs/a2billing_subscription_fee.php #Bill DID usage at 00:00 each day 0 0 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_bill_diduse.0 12 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_archive_data_cront. and email user if so. 1 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_notify_account.php #Update currencies at 01:00 each day 0 1 * * * php /usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php 0 10 21 * * php /usr/local/src/a2billing/Cronjobs/a2billing_autorefill.php #Batch process at 00:20 each day 20 0 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_process.php #Generate Invoices at 6am everyday 0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_billing.log touch /var/log/cront_a2b_alarm.log touch /var/log/cront_a2b_batch_process.log touch /var/log/a2billing-daemon-callback.log touch /var/log/cront_a2b_autorefill.log .

log touch /var/log/cront_a2b_subscription_fee. Callback Daemon installation Script LOAD_LOC=/usr/local/src/a2billing yum -y install python-setuptools.log touch /var/log/cront_a2b_invoice.noarch yum -y install MySQL-python easy_install sqlalchemy cd $LOAD_LOC/Callback/callback-daemon-py cp $LOAD_LOC/CallBack/callback-daemonpy/build/lib/callback_daemon/a2b-callback-daemon.egg chkconfig --add a2b-callback-daemon . Change the LOAD_LOC variable to reflect where you have downloaded A2Billing.4.log touch /var/log/a2billing_agi.log Callback Here is a little script to install the call-back Daemon.d/a2b-callback-daemon cd $LOAD_LOC/CallBack/callback-daemon-py/ python setup.log touch /var/log/a2billing_epayment.py bdist_egg easy_install dist/callback_daemon-1.log touch /var/log/api_ecommerce_request.log touch /var/log/a2billing_paypal.log touch /var/log/cront_a2b_currency_update.touch /var/log/cront_a2b_bill_diduse.log touch /var/log/api_callback_request.py build python setup.prod_r1528-py2.rc /etc/init.0.d/a2bcallback-daemon chmod +x /etc/init.

org/cgi-bin/trac. I've not got round to writing the dialplan as yet. http://www.4.cgi/browser/trunk Make sure that you are running the latest version before reporting a bug by periodically running. Reboot Login http://Your-Switch/a2billing Log into the admin pages with root and changepassword General Setup The general setup is similar to 1. and the order of events is approximately similar * Set up trunk * Set up callplan * Setup rate plan * add rate table to callplan * add rates * add customer * test.3.asterisk2billing.3. Guidelines Keep an eye on the development of A2Billing here.service a2b-callback-daemon start chkconfig a2b-callback-daemon on Dialplan The dialplan you put into Asterisk is the same as it was for A2Billing 1. .4.

org/cgi-bin/trac.Bugs can be dicussed in the bugs section here http://forum.php?f=22 before reporting them on the bug tracker.asterisk2billing.asterisk2billing.cgi/report . Bugs tracking and reporting can be done here:http://www.org/viewforum.

Sign up to vote on this title
UsefulNot useful