Asterisk Voip

Install A2Billing Asterisk



Set up MySQL
service mysqld start
mysqladmin create asteriskcdrdb;
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql;
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY ‘passw0rd’;
flush privileges;
exit;

#

Asterisk Settings for a2billing

nano /etc/asterisk/cdr_mysql.conf
[global]
hostname = localhost
dbname=asteriskcdrdb
password = passw0rd
user = asterisk
userfield=1
loguniqueid=yes
;port=3306
;sock=/tmp/mysql.sock
nano /etc/asterisk/res_mysql.conf
[a2billing]
dbhost = localhost
dbname = a2billing
dbuser = root
dbpass =
dbport = 3306
dbsock = /var/lib/mysql/mysql.sock
#

A2Billing Installation

cd /usr/src
mkdir a2billing
cd a2billing
wget –no-check-certificate http://nodeload.github.com/Star2Billing/a2billing/tarball/v1-current
tar zxf v1-current
cd Star2Billing-a2billing-*
mv * ..
cd ..
rm -rf Star2Billing-a2billing-*
ln -s /usr/src/a2billing/a2billing.conf /etc/a2billing.conf
chmod 777 /etc/asterisk
touch /etc/asterisk/additional_a2billing_iax.conf
touch /etc/asterisk/additional_a2billing_sip.conf
echo \#include additional_a2billing_sip.conf >> /etc/asterisk/sip_custom.conf
echo \#include additional_a2billing_iax.conf >> /etc/asterisk/iax_custom.conf
chown asterisk:asterisk /etc/asterisk/additional_a2billing_sip.conf
chown asterisk:asterisk /etc/asterisk/additional_a2billing_iax.conf
cd addons/sounds/
./install_a2b_sounds.sh
ln -s /usr/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/a2billing.php
ln -s /usr/src/a2billing/AGI/lib/ /var/lib/asterisk/agi-bin/
chmod +x /var/lib/asterisk/agi-bin/a2billing.php
ln -s /usr/src/a2billing/customer/ /var/www/html/billing
ln -s /usr/src/a2billing/admin/ /var/www/html/billing
ln -s /usr/src/a2billing/agent/ /var/www/html/billing
ln -s /usr/src/a2billing/common/ /var/www/html/billing
chmod 777 /var/www/html/billing/admin/templates_c/
chmod 777 /var/www/html/billing/agent/templates_c/
chmod 777 /var/www/html/billing/templates_c/
nano /etc/asterisk/manager.conf
[myasterisk] ;FOR a2billing
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 Database for A2Billing


cd /usr/src/a2billing/DataBase/mysql-5.x
mysqladmin create a2billing
mysql
GRANT ALL PRIVILEGES ON a2billing.* TO a2billing@localhost IDENTIFIED BY ‘changepassword’;
flush privileges;
\q
./install-db.sh
#USE a2billing/changepassword
#Secure MySQL
nano /etc/my.cnf
[mysqld]
bind-address = 127.0.0.1
nano /etc/asterisk/extensions_custom.conf
[a2billing]
; Set by Network staff for manual assignment
exten => _X.,1,AGI(a2billing.php,1)
exten => _X.,n,Wait()
exten => _X.,n,Hangup()
[a2billing-cc]
; Used by Calling Card Platform for incoming calls
exten => _X.,1,AGI(a2billing.php,2)
exten => _X.,n,Wait()
exten => _X.,n,Hangup()
[a2billing-passthrough]
; Set by website signup for automatic assignment
exten => _X.,1,AGI(a2billing.php,3)
exten => _X.,n,Wait()
exten => _X.,n,Hangup()
[a2billing-did]
; This is where inbound DID calls are pointed to if you plan to be a DID service provider
exten => _X.,1,AGI(a2billing.php,1,did)
exten => _x,1,Hangup()
[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit
[custom-freepbx-a2billing]
exten => _X.,1,AGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()
mkdir /var/run/a2billing
#Crontab
crontab -e
i
# update the currency
0 6 * * * php /usr/src/a2billing/Cronjobs/currencies_update_yahoo.php
# monthly services subscription
0 6 1 * * php /usr/src/a2billing/Cronjobs/a2billing_subscription_fee.php
# check account of users
0 * * * * php /usr/src/a2billing/Cronjobs/a2billing_notify_account.php
# did billing
0 2 * * * php /usr/src/a2billing/Cronjobs/a2billing_bill_diduse.php
# recurring service.
0 12 * * * php /usr/src/a2billing/Cronjobs/a2billing_batch_process.php
# generate invoices and for each user.
0 6 * * * php /usr/src/a2billing/Cronjobs/a2billing_batch_billing.php
# autodialer
*/5 * * * * php /usr/src/a2billing/Cronjobs/a2billing_batch_autodialer.php
# manage alarms
0 * * * * php /usr/src/a2billing/Cronjobs/a2billing_alarm.php
esc
:wq!
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
LOAD_LOC=/usr/src/a2billing
easy_install sqlalchemy
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
python setup.py build
python setup.py bdist_egg
easy_install dist/callback_daemon-1.0.prod-py2.6.egg
chkconfig –add a2b-callback-daemon
service a2b-callback-daemon start
chkconfig a2b-callback-daemon on
#FreePBX Custom Destinations in /etc/asterisk/extensions_custom.conf
Custom Destination: a2billing,${EXTEN},1
Description: a2billing
Custom Destination: a2billing-callback,${EXTEN},1
Description: a2billing-callback
Custom Destination: a2billing-cid-callback,${EXTEN},1
Description: a2billing-cid-callback
Custom Destination: a2billing-did,${EXTEN},1
Description: a2billing-did
Custom Destination: a2billing-sip,${EXTEN},1
Description: a2billing-sip
Custom Destination: a2billing-cc,${EXTEN},1
Description: a2billing-cc
Custom Destination: a2billing-passthrough,${EXTEN},1
Description: a2billing-passthrough


Title Post: Install A2Billing Asterisk
Rating:
5/5 5

: We on G+

Thanks for read this post.

Post a Comment

 
Return to top of page Copyright © 2013