UPDATED as of 12/14/2018
I found an old script online and modified it to work with the latest incrediblepbx for raspberry pi3...strongly suggest running apt-get update && sudo apt-get upgrade and rebooting before running this script but it does work without doing so...
I'd like to see this script included in future Incrediblepbx updates.
When asked to input database info enter:
Database = a2billing_db
Hostname = 127.0.0.1
User = root
passord = passw0rd <--thats a zero no an O
and when installed the a2billing default login is:
username - root
password - changepassword
Here is the tested and updated as of 12/14/2018 script...any input on improvements would be very welcome.
#Installing A2Billing
##########################
mkdir -p /usr/share/a2billing/
cd /usr/share/a2billing/
wget -O master.tar.gz --no-check-certificate
https://codeload.github.com/Star2Billing/a2billing/tar.gz/master
tar zxf master.tar.gz
mv a2billing-master/* /usr/share/a2billing/
rm -rf a2billing-master master.tar.gz
chmod u+xwr /usr/share/a2billing/admin/templates_c
chmod a+w /usr/share/a2billing/admin/templates_c
chmod u+xwr /usr/share/a2billing/agent/templates_c
chmod a+w /usr/share/a2billing/agent/templates_c
chmod u+xwr /usr/share/a2billing/customer/templates_c
chmod a+w /usr/share/a2billing/customer/templates_c
rm -rf /usr/share/a2billing/admin/templates_c/*
rm -rf /usr/share/a2billing/agent/templates_c/*
rm -rf /usr/share/a2billing/customer/templates_c/*
# copy conf files
cp /usr/share/a2billing/a2billing.conf /etc/a2billing.conf
cd /etc/apache2/sites-enabled/
wget
https://raw.github.com/Star2Billing/a2billing/develop/addons/apache2/a2billing_admin.conf
wget
https://raw.github.com/Star2Billing/a2billing/develop/addons/apache2/a2billing_customer.conf
ln -s /usr/share/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
# Install Audio files
cd /usr/share/a2billing/addons/sounds
./install_a2b_sounds.sh
cp -R /usr/share/a2billing/addons/sounds/ /var/lib/asterisk/
#set ownership on sounds
chown -R asterisk:asterisk /usr/share/asterisk/
cd /etc/asterisk
wget -O extensions_a2billing.conf
https://raw.github.com/Star2Billing...s/asterisk-conf/extensions_a2billing_1_8.conf
#include "extensions_a2billing.conf"
echo "Adding A2Billing extensions to /etc/asterisk/extensions_custom.conf"
cat /etc/asterisk/extensions_a2billing.conf > /etc/asterisk/extensions_custom.conf
#Install A2billing DB
/etc/init.d/mysql start
mysql -uroot -ppassw0rd -e "CREATE DATABASE a2billing_db;"
cd /usr/share/a2billing/DataBase/mysql-5.x
bash install-db.sh
sed -i "s/a2billing_dbuser/root/g" /etc/a2billing.conf
sed -i "s/a2billing_dbpassword/passw0rd/g" /etc/a2billing.conf
sed -i "s/a2billing_dbname/a2billing_db/g" /etc/a2billing.conf
#Install Composer needed to avoid "Error 500" when loading a2billing admin page.
cd /usr/share/a2billing
curl -sS
https://getcomposer.org/installer | php
php composer.phar update
php composer.phar install
#Create a2billing symbolic link to apache2 web root directory.
cd /
ln -s /usr/share/a2billing /var/www/html/a2billing
chown -R asterisk:asterisk /var/www/html/a2billing
#Restart Mysql & Apache2 service
/etc/init.d/mysql restart
/etc/init.d/apache2 restart
#write out current crontab
crontab -l > a2billing_cron
#echo new cron into cron file
echo "00 09 * * 1-5 echo hello" >> a2billing_cron
# update the currency table
echo "0 6 * * * php /usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php" >> a2billing_cron
# manage the monthly services subscription
echo "0 6 1 * * php /usr/local/src/a2billing/Cronjobs/a2billing_subscription_fee.php" >> a2billing_cron
# To check account of each Users and send an email if the balance is
#less than the user have choice.
echo "0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_notify_account.php" >> a2billing_cron
# 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
echo "0 2 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_bill_diduse.php" >> a2billing_cron
# This script will take care of the recurring service.
echo "0 12 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_process.php" >> a2billing_cron
# To generate invoices and for each user.
echo "0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_billing.php" >> a2billing_cron
# to proceed the autodialer
echo "*/5 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_autodialer.php" >> a2billing_cron
# manage alarms
echo "0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm.php" >> a2billing_cron
#install new cron file
crontab -u asterisk a2billing_cron
rm a2billing_cron
# Creating A2Billing log file
mkdir /var/log/a2billing
touch /var/log/a2billing/a2billing_agi.log
chown -R asterisk:asterisk /var/log/a2billing
#Log rotation
cd /etc/logrotate.d
touch a2billing
cat >> /etc/logrotate.d/a2billing << EOF
/var/log/a2billing/*.log {
daily
missingok
rotate 4
sharedscripts
postrotate
endscript
}
EOF
reboot