yum -y update && yum -y groupinstall core && yum -y groupinstall base && yum -y install epel-release yum -y install php-mcrypt php-xml perl-DBD-Pg git
cd /usr/src git clone -b 'v2.2.0' --single-branch https://github.com/Star2Billing/a2billing.git
cd /usr/src/a2billing curl -sS https://getcomposer.org/installer | php php composer.phar update php composer.phar install
cd /usr/src/a2billing mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql
Database name: mya2billing Database user: a2billinguser Database user password: a2billing
cd /usr/src/a2billing/DataBase/mysql-5.x ./install-db.sh
cp /usr/src/a2billing/a2billing.conf /etc/
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. /etc/asterisk/additional_a2billing_iax.conf chown -Rf asterisk. /etc/asterisk/additional_a2billing_sip.conf chmod -R 640 /etc/asterisk
cd /usr/src/a2billing/addons/sounds ./install_a2b_sounds.sh chown -R asterisk:asterisk /var/lib/asterisk/sounds/
[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
vi /etc/asterisk/freepbx_chown.conf
[blacklist] directory=/var/www/html/a2billing/
mkdir /var/www/html/a2billing cp -rf /usr/src/a2billing/admin /var/www/html/a2billing cp -rf /usr/src/a2billing/agent /var/www/html/a2billing cp -rf /usr/src/a2billing/customer /var/www/html/a2billing cp -rf /usr/src/a2billing/common /var/www/html/a2billing cp -rf /usr/src/a2billing/vendor /var/www/html/a2billing chown -R asterisk. /var/www/html/a2billing chmod 755 /var/www/html/a2billing/admin/templates_c chmod 755 /var/www/html/a2billing/customer/templates_c chmod 755 /var/www/html/a2billing/agent/templates_c
mkdir /var/lib/asterisk/agi-bin cd /usr/src/a2billing/AGI cp a2billing.php /var/lib/asterisk/agi-bin cp a2billing_monitoring.php /var/lib/asterisk/agi-bin chown -R asterisk. /var/lib/asterisk/agi-bin chmod 755 /var/lib/asterisk/agi-bin/a2billing.php chmod 755 /var/lib/asterisk/agi-bin/a2billing_monitoring.php ln -s /var/www/html/a2billing/common/lib /var/lib/asterisk/agi-bin/lib ln -s /var/www/html/a2billing/vendor /var/lib/asterisk/vendor
[a2billing-did] exten => _X.,1,AGI(a2billing.php,1,did) exten => _X.,n,Hangup() [a2billing-out] exten => _X.,1,AGI(a2billing.php,1) exten => _X.,n,Hangup()
fwconsole restart
mkdir -p /usr/local/a2billing cp -R /usr/src/a2billing/Cronjobs /usr/local/a2billing/ ln -sf /var/www/html/a2billing/common/lib /usr/local/a2billing/Cronjobs/lib chown -R asterisk. /usr/local/a2billing
# update the currency table 0 6 * * * php /usr/local/a2billing/Cronjobs/currencies_update_yahoo.php # manage the monthly services subscription 0 6 1 * * php /usr/local/a2billing/Cronjobs/a2billing_subscription_fee.php # To check account of each Users and send an email if the balance is less than the user have choice. 0 * * * * php /usr/local/a2billing/Cronjobs/a2billing_notify_account.php # this script will browse all the DID that are reserve and check if the customer need to pay for it. # bill them or warn them per email to know if they want to pay in order to keep their DIDs. 0 2 * * * php /usr/local/a2billing/Cronjobs/a2billing_bill_diduse.php # This script will take care of the recurring service. 0 12 * * * php /usr/local/a2billing/Cronjobs/a2billing_batch_process.php # To generate invoices and for each user. 0 6 * * * php /usr/local/a2billing/Cronjobs/a2billing_batch_billing.php # to proceed the autodialer */5 * * * * php /usr/local/a2billing/Cronjobs/a2billing_batch_autodialer.php # manage alarms 0 * * * * php /usr/local/a2billing/Cronjobs/a2billing_alarm.php # manage archive 0 12 * * * php /usr/local/a2billing/Cronjobs/a2billing_archive_data_cront.php #autorefill 0 10 21 * * php /usr/local/a2billing/Cronjobs/a2billing_autorefill.php 15 * * * * php /usr/local/a2billing/Cronjobs/a2billing_batch_cache.php
mkdir -p /var/log/a2billing 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_archive_data.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/a2billing_api_ecommerce_request.log touch /var/log/a2billing/a2billing_api_callback_request.log touch /var/log/a2billing/a2billing_api_card.log touch /var/log/a2billing/a2billing_agi.log chown -R asterisk. /var/log/a2billing