Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri May 24, 2019 1:18 pm
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: install script
PostPosted: Sun Mar 21, 2010 11:53 pm 
Offline

Joined: Wed Sep 16, 2009 9:37 pm
Posts: 38
*assume all default passwords
*copy this to a file and make it a executable
* vi installa2billing.sh
*chown 755 installa2billing.sh
* run file
************--------------install a2biling in trixbox2.8-----------------------
mkdir /usr/local/src/a2billing
cd /usr/local/src/a2billing
yum -y install perl-DBD-Pg subversion
svn co --username guest --password guest http://svn.a2billing.net/svn/asterisk2billing/trunk/ /usr/local/src/a2billing
cp /usr/local/src/a2billing/a2billing.conf /etc/a2billing.conf
sed -i '/port/s/port =/port = 3306/g' /etc/a2billing.conf
sed -i '/user =/s/user = a2billing_dbuser/user = a2billinguser/g' /etc/a2billing.conf
sed -i '/password =/s/password = a2billing_dbpassword/password = a2billing/g' /etc/a2billing.conf
sed -i '/dbname =/s/dbname = a2billing_dbname/dbname = mya2billing/g' /etc/a2billing.conf

chmod 775 /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 -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_iax.conf
chown -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_sip.conf
ln -s /usr/local/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/a2billing.php
chown asterisk:asterisk /var/lib/asterisk/agi-bin/a2billing.php
chmod +x /var/lib/asterisk/agi-bin/a2billing.php
cd /usr/local/src/a2billing/addons/sounds
./install_a2b_sounds.sh
chown -R asterisk:asterisk /var/lib/asterisk/

touch /etc/asterisk/manager_custom.conf
echo [myasterisk] >> /etc/asterisk/manager_custom.conf
echo secret = mycode >> /etc/asterisk/manager_custom.conf
echo deny=0.0.0.0/0.0.0.0 >> /etc/asterisk/manager_custom.conf
echo permit=127.0.0.1/255.255.255.0 >> /etc/asterisk/manager_custom.conf
echo read = system,call,log,verbose,command,agent,user >> /etc/asterisk/manager_custom.conf
echo write = system,call,log,verbose,command,agent,user >> /etc/asterisk/manager_custom.conf

mkdir /var/www/html/a2billing
ln -s /usr/local/src/a2billing/common /var/www/html/a2billing/common
ln -s /usr/local/src/a2billing/admin /var/www/html/a2billing/admin
ln -s /usr/local/src/a2billing/agent /var/www/html/a2billing/agent
ln -s /usr/local/src/a2billing/customer /var/www/html/a2billing/customer
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

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
#Remind users of low balance every day at 06:00
0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_check_account.php
#Generate Invoices at 7am everyday
0 7 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_invoice2_cront.php
0 7 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_invoice_cront.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
" >> /etc/crontab


mkdir /var/log/a2billing
touch /var/log/asterisk/a2billing-daemon-callback.log
touch /var/log/a2billing/a2billing-daemon-callback.log
touch /var/log/a2billing/cront_a2b_alarm.log
touch /var/log/a2billing/cront_a2b_autorefill.log
touch /var/log/a2billing/cront_a2b_batch_process.log
touch /var/log/a2billing/cront_a2b_bill_diduse.log
touch /var/log/a2billing/cront_a2b_subscription_fee.log
touch /var/log/a2billing/cront_a2b_currency_update.log
touch /var/log/a2billing/cront_a2b_invoice.log
touch /var/log/a2billing/cront_a2b_check_account.log
touch /var/log/a2billing/a2billing_paypal.log
touch /var/log/a2billing/a2billing_epayment.log
touch /var/log/a2billing/api_ecommerce_request.log
touch /var/log/a2billing/api_callback_request.log
touch /var/log/a2billing/a2billing_agi.log
cp /usr/local/src/a2billing/addons/Doc/extensions_a2billing_1_6.conf /etc/asterisk/extensions_a2billing_1_6.conf
echo \#include extensions_a2billing_1_6.conf >> /etc/asterisk/extensions_custom.conf

sed -i '/define ("PHP_QUICK_PROFILER", true);/s/define ("PHP_QUICK_PROFILER", true);/define ("PHP_QUICK_PROFILER", false);/g' /var/www/html/a2billing/common/lib/admin.defines.php
sed -i '/define ("PHP_QUICK_PROFILER", true);/s/define ("PHP_QUICK_PROFILER", true);/define ("PHP_QUICK_PROFILER", false);/g' /var/www/html/a2billing/common/lib/agent.defines.php
sed -i '/define ("PHP_QUICK_PROFILER", true);/s/define ("PHP_QUICK_PROFILER", true);/define ("PHP_QUICK_PROFILER", false);/g' /var/www/html/a2billing/common/lib/customer.defines.php


mysql -uroot -ppassw0rd < /usr/local/src/a2billing/DataBase/mysql-5.x/a2billing-createdb-user.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.1-to-v1.4.2.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.2-to-v1.4.3.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.3-to-v1.4.4.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4-to-v1.4.4.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4.1-to-v1.4.5.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.5-to-v1.5.0.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.0-to-v1.5.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.1-to-v1.6.0.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.0-to-v1.6.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.1-to-v1.6.2.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.2-to-v1.7.0.sql


# a2billing realtime setup
echo "
sipusers => mysql,mya2billing,cc_sip_buddies
sippeers => mysql,mya2billing,cc_sip_buddies
iaxusers => mysql,mya2billing,cc_iax_buddies
iaxpeers => mysql,mya2billing,cc_iax_buddies
" >> /etc/asterisk/extconfig.conf

sed -i '/from-sip-external/s/$/\ninclude => a2billing-did/' /var/www/html/admin/modules/core/etc/extensions.conf

sed -i '/exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => _.,n,Set(DID=${IF/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => _.,n,Goto(s,1)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,1,GotoIf($\["${ALLOW_SIP_ANON}"="yes"/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Set(TIMEOUT(absolute)=15)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Answer/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Wait(2)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Playback(ss-noservice)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Playtones(congestion)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Congestion(5)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => h,1,NoOp(Hangup)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => i,1,NoOp(Invalid)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => t,1,NoOp(Timeout)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf

amportal restart


Last edited by niranjan_lk on Wed Apr 14, 2010 6:27 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Mon Mar 22, 2010 12:31 am 
Offline

Joined: Mon Dec 07, 2009 10:09 am
Posts: 62
Location: Assiut, Egypt
thanks man


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Fri Apr 02, 2010 5:05 pm 
Offline
User avatar

Joined: Fri Sep 18, 2009 5:46 pm
Posts: 132
Location: hhhhmmmmm
have you tested it yet?
abakhiet wrote:
thanks man


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Fri Apr 02, 2010 7:14 pm 
Offline

Joined: Mon Dec 07, 2009 10:09 am
Posts: 62
Location: Assiut, Egypt
no, i don't :D
but i fell i must say something to encoyrage this man %-)


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Fri Apr 02, 2010 7:47 pm 
Offline

Joined: Wed Feb 13, 2008 11:11 am
Posts: 224
Quote:
have you tested it yet?


hahah, nice one flatpack. that avatar is cool.
I don't understand why you could use install script, i like getting under the bonnet and see the whole engine.

Rgds
Eamonn


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Sun Apr 04, 2010 8:07 pm 
Offline
User avatar

Joined: Fri Sep 18, 2009 5:46 pm
Posts: 132
Location: hhhhmmmmm
i m under the bonnet but not going to invent wheel again....
already spending lots of time on billing and its customization.


manugmedia wrote:
Quote:
have you tested it yet?


hahah, nice one flatpack. that avatar is cool.
I don't understand why you could use install script, i like getting under the bonnet and see the whole engine.

Rgds
Eamonn


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Thu May 13, 2010 10:44 pm 
Offline

Joined: Thu Sep 24, 2009 8:18 pm
Posts: 9
I'm testing your script, but on Centos 5.4, so there is some adapting to do, so far I have two questions, one is why use a2billing-schema-v1.4.0.sql and then apply all UPDATE* files when I think you could use a2billing-mysql-schema-v1.7.0.sql and then I guess you don't need to apply the updates, btw there is a UPDATE-a2billing-v1.7.0-to-v1.7.1.sql file but it fail to apply with this error:
Code:
ERROR 1054 (42S22) at line 38: Unknown column 'destination' in 'cc_did'


The other question I guess is related to the fact that I'm not using Trixbox, could you tell me what is the "a2billing realtime setup"?, cause I do have /etc/asterisk/extconfig.conf but no rest of the files on that section, I guess those files are from the FreePBX interface that I'm not planing to use for now. Do I want/need "a2billing realtime setup" on a Centos install?

Thanks for putting all this together, I let you know how it went for me on a Centos machine and I also will publish the changes I made to the script, mainly installation of asterisk, mysql and other software that a default Centos install won't have.

Carlos

niranjan_lk wrote:
mysql -uroot -ppassw0rd < /usr/local/src/a2billing/DataBase/mysql-5.x/a2billing-createdb-user.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.1-to-v1.4.2.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.2-to-v1.4.3.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.3-to-v1.4.4.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4-to-v1.4.4.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4.1-to-v1.4.5.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.5-to-v1.5.0.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.0-to-v1.5.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.1-to-v1.6.0.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.0-to-v1.6.1.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.1-to-v1.6.2.sql
mysql -u root -ppassw0rd mya2billing < /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.2-to-v1.7.0.sql


# a2billing realtime setup
echo "
sipusers => mysql,mya2billing,cc_sip_buddies
sippeers => mysql,mya2billing,cc_sip_buddies
iaxusers => mysql,mya2billing,cc_iax_buddies
iaxpeers => mysql,mya2billing,cc_iax_buddies
" >> /etc/asterisk/extconfig.conf

sed -i '/from-sip-external/s/$/\ninclude => a2billing-did/' /var/www/html/admin/modules/core/etc/extensions.conf

sed -i '/exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => _.,n,Set(DID=${IF/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => _.,n,Goto(s,1)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,1,GotoIf($\["${ALLOW_SIP_ANON}"="yes"/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Set(TIMEOUT(absolute)=15)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Answer/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Wait(2)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Playback(ss-noservice)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Playtones(congestion)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => s,n,Congestion(5)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => h,1,NoOp(Hangup)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => i,1,NoOp(Invalid)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf
sed -i '/exten => t,1,NoOp(Timeout)/s/exten =>/#exten =>/g' /var/www/html/admin/modules/core/etc/extensions.conf

amportal restart


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Fri May 14, 2010 4:54 am 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
I second the issue with update of mysql from 1.7.0 to 1.7.1 with error:

Code:
ERROR 1054 (42S22) at line 38: Unknown column 'destination' in 'cc_did'


Also, wanted to pose my own question regarding realtime:
- Can A2Billing use realtime and FreePBX use .conf files for SIP peers? I just hate it when "sip show peers" shows both the PBX extensions and A2Billing extensions at the same time. Plus there could be many A2B SIP peers which won't fit on one page and I never want to display them.

Thanks


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Fri May 14, 2010 7:58 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Yes, Asterisk can use both sip/iax.conf files and asterisk realtime, although when you so sip show peers, it will show all that are registered.

Joe


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Mon May 31, 2010 2:03 pm 
Offline

Joined: Wed Nov 25, 2009 12:01 pm
Posts: 90
Hi...

Is it necessary to install realtime setup for prepaid call system?
i have tried installing the realtime setup and i get the following error in the log:

[May 31 14:46:04] ERROR[2964] res_config_mysql.c: MySQL RealTime: Failed to connect database server asterisk on /tmp/mysql.sock (err 2002). Check debug for more info.

and yes the script works..

thanks.


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Mon May 31, 2010 2:07 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Check you have extconfig.conf correctly configured, and you have configured res_mysql.conf, and it should all just work.

Joe


Top
 Profile  
 
 Post subject: Re: install script
PostPosted: Thu Jul 15, 2010 11:17 am 
Offline

Joined: Fri Mar 06, 2009 9:12 pm
Posts: 188
May I ask what the following code is for?

-------------
cp /usr/local/src/a2billing/addons/Doc/extensions_a2billing_1_6.conf /etc/asterisk/extensions_a2billing_1_6.conf
echo \#include extensions_a2billing_1_6.conf >> /etc/asterisk/extensions_custom.conf

sed -i '/define ("PHP_QUICK_PROFILER", true);/s/define ("PHP_QUICK_PROFILER", true);/define ("PHP_QUICK_PROFILER", false);/g' /var/www/html/a2billing/common/lib/admin.defines.php
sed -i '/define ("PHP_QUICK_PROFILER", true);/s/define ("PHP_QUICK_PROFILER", true);/define ("PHP_QUICK_PROFILER", false);/g' /var/www/html/a2billing/common/lib/agent.defines.php
sed -i '/define ("PHP_QUICK_PROFILER", true);/s/define ("PHP_QUICK_PROFILER", true);/define ("PHP_QUICK_PROFILER", false);/g' /var/www/html/a2billing/common/lib/customer.defines.php
-------------

Thank you,
Netizen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 
Predictive Dialer


All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group