ゆる~くつながる新感覚コミュニケーション♪

ログイン
ユーザー名:

パスワード:


SSL パスワード紛失

新規登録
言語選択



 携帯からCu-townを使おう♪
携帯電話から上記QRコードを読み込むとアクセスできます。
TOP  >  日記  >  hori  >  asterisk覚書  >  A2Billing installation on CentOS

hori さんの日記

カテゴリー [asterisk覚書] 
 
2012
3月 2
(金)
03:44
A2Billing installation on CentOS
本文

http://shirker.blog.com/2011/07/08/a2billing-installation-on-centos/

 

A2Billing installation on CentOS

2011 July 8
 
Posted by shirker2006

Install Dependencies

yum -y install perl-DBD-Pg subversion

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

copy a2billing.conf in /usr/local/src/a2billing/a2billing.conf to /etc/a2billing.conf

Edit a2billing.conf to suit your installation. e.g. change dbtype to mysql. Install Database 

  Note that for Piaf and FonicaPABX, the database password is passw0rd and the location is localhost

cd /usr/local/src/a2billing/DataBase/mysql-5.x
./install-db.sh

Answer the questions appropriately with reference to /etc/a2billing.conf
You should now have a database called mya2billing with over 70 tables in it.
Install the AGI and Sound Files
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.   Note that Database changes will not be included

using this methodology, so these will have to be done by hand.   This is not the usual way of doing it,

but for testing, it works well. You can also simply move or copy the files into the appropriate location.

ln -s /usr/local/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin
/a2billing.php

chmod +x /var/lib/asterisk/agi-bin/a2billing.php

Set up sounds

cd /usr/local/src/a2billing/addons/sounds
./install_a2b_sounds.sh

Asterisk Manager

Now edit /etc/asterisk/manager.conf . Add the following lines

[myasterisk]
secret = mycode
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

Install Web Pages

vim /etc/httpd/conf.d/a2billing.conf

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

Alias /a2billing "/usr/local/src/a2billing"
    <Directory "/usr/local/src/a2billing">   
        Options None 
        AllowOverride None   
        Order allow,deny   
        Allow from all
    </Directory>

Alias /a2billing/common "/usr/local/src/a2billing/common"

     <Directory "/usr/local/src/a2billing/common">   
        Options None   
        AllowOverride None   
        Order allow,deny   
        Allow from all
     </Directory>

Alias /a2billing/agent "/usr/local/src/a2billing/agent"

     <Directory "/usr/local/src/a2billing/agent">
         Options None   
         AllowOverride None   
         Order allow,deny   
         Allow from all
     </Directory>
Alias /a2billing/customer "/usr/local/src/a2billing/customer"

     <Directory "/usr/local/src/a2billing/customer">   
          Options None   
          AllowOverride None   
          Order allow,deny   
          Allow from all
     </Directory>
#service httpd restart

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.php	0 12 * * 
* php /usr/local/src/a2billing/Cronjobs/a2billing_archive_data_c
ront.php	0 10 21 * * php /usr/local/src/a2billing/Cronjobs/a2bil
ling_autorefill.php	

#Batch process at 00:20 each day 20 0 * * * php /usr/local/src/a2
billing/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/Cron
jobs/currencies_update_yahoo.php	" >> /var/spool/cron/asterisk

Add directory for monitoring Script

mkdir -p /var/lib/a2billing/script

Create Log Files
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

Here is a little script to install the call-back Daemon.

#!/bin/bash
LOAD_LOC=/usr/src/a2billing
yum -y install python-setuptools.noarch
yum -y install MySQL-python
easy_install sqlalchemy
cd $LOAD_LOC/CallBack/callback-daemon-py
cp callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-callback-daemon
chmod +x /etc/init.d/a2b-callback-daemon
cp dist/callback_daemon-1.0.prod-r1528.tar.gz /tmp
cd /tmp
tar xvfz callback_daemon-1.0.prod-r1528.tar.gz
cd callback_daemon-1.0.prod-r1528
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

Login

http://Your-Switch/a2billing   Log into the admin pages with root and changepassword

閲覧(9288)
投稿された内容の著作権はコメントの投稿者に帰属します。



Copyright (C) 2011 Cu-town. All rights Reserved. Powered by Cu-town 実行委員会.