Академический Документы
Профессиональный Документы
Культура Документы
__________________________________________________________
_______________________________________________
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
If you have hand-rolled your own distribution, and are familiar with
1.3.4, then the we assume that you have the necessary dependencies
already installed.
Install Dependencies
get A2Billing
mkdir /usr/local/src/a2billing
cd /usr/local/src/a2billing
svn co --username guest --password guest
http://svn.a2billing.net/svn/asterisk2billing/trunk/ /usr/local/src/a2billing
Install Database
So that we can easily update the system when changes are made during
this period of change, we are going to use links back to the location
where we installed the SVN
download, so that an update from the SVN will immediately reflect in
your A2Billing install.
Set up sounds
cd /usr/local/src/a2billing/addons/sounds
./install_a2b_sounds.sh
Asterisk Manager
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
If you are using a pre-rolled Distro, then web group and ownership are
asterisk and asterisk, if you are not using a distro, then you probably
know what to set anyway.
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
echo "
# Automatically added for A2Billing
0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm.php
0 12 * * * php
/usr/local/src/a2billing/Cronjobs/a2billing_archive_data_cront.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
#Bill DID usage at 00:00 each day
0 0 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_bill_diduse.php
#Generate Invoices at 6am everyday
0 6 * * * php
/usr/local/src/a2billing/Cronjobs/a2billing_batch_billing.php
#Check if balance below preset value, and email user if so.
1 * * * * php
/usr/local/src/a2billing/Cronjobs/a2billing_notify_account.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
#Update currencies at 01:00 each day
0 1 * * * php
/usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php
" >> /var/spool/cron/asterisk
mkdir -p /var/lib/a2billing/script
touch /var/log/asterisk/a2billing-daemon-callback.log
touch /var/log/a2billing-daemon-callback.log
touch /var/log/cront_a2b_alarm.log
touch /var/log/cront_a2b_autorefill.log
touch /var/log/cront_a2b_batch_process.log
touch /var/log/cront_a2b_bill_diduse.log
touch /var/log/cront_a2b_subscription_fee.log
touch /var/log/cront_a2b_currency_update.log
touch /var/log/cront_a2b_invoice.log
touch /var/log/a2billing_paypal.log
touch /var/log/a2billing_epayment.log
touch /var/log/api_ecommerce_request.log
touch /var/log/api_callback_request.log
touch /var/log/a2billing_agi.log
Callback
LOAD_LOC=/usr/local/src/a2billing
cd $LOAD_LOC/Callback/callback-daemon-py
cp $LOAD_LOC/CallBack/callback-daemon-
py/build/lib/callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-
callback-daemon
chmod +x /etc/init.d/a2b-callback-daemon
cd $LOAD_LOC/CallBack/callback-daemon-py/
python setup.py build
python setup.py bdist_egg
easy_install dist/callback_daemon-1.0.prod_r1528-py2.4.egg
chkconfig --add a2b-callback-daemon
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.3.4. I've not got round to writing the dialplan as yet.
Reboot
Login
http://Your-Switch/a2billing
General Setup
* Set up trunk * Set up callplan * Setup rate plan * add rate table to
callplan * add rates * add customer * test.
Guidelines
http://www.asterisk2billing.org/cgi-bin/trac.cgi/browser/trunk
Make sure that you are running the latest version before reporting a
bug by periodically running.
Bugs can be dicussed in the bugs section here -
http://forum.asterisk2billing.org/viewforum.php?f=22 before reporting
them on the bug tracker.