a2billing

Centar

Member
Joined
Jan 7, 2010
Messages
53
Reaction score
10
I am looking for an install script for a2billing for incrediblepbx on a Raspberry pi 3b, any help would be greatly appreciated.
 

ajonate

Member
Joined
Jun 18, 2018
Messages
125
Reaction score
15
I installed a2billing on IncrediblePBX a few months back. I did a cloud deployment.

Installation was straightforward. I have no specific warnings or advice for installation. My concern was in what it was capable of. I was told that it would keep track of phone usage in a motel/hotel setting, where guests would be billed for maybe $0.05 per minute of phone usage. A2billing wouldn't be suitable for that.

A2billing is a gateway. It's good for running a calling card business where clients can authenticate through the gateway using a calling card number, then allow calling as long as the account balance stays positive. But I don't know that I would operate a calling card business using a raspberry pi. At least not when you can do a cloud deployment at hiformance for $12/year.
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
I was told that it would keep track of phone usage in a motel/hotel setting, where guests would be billed for maybe $0.05 per minute of phone usage. A2billing wouldn't be suitable for that.
ASTPP and Freeswitch will do that for you. You'd need to manually post to the Folio every night, but may be OK in a small setting. Those night auditors need something to do in the evening now, don't they. :)
 

ajonate

Member
Joined
Jun 18, 2018
Messages
125
Reaction score
15
ASTPP and Freeswitch will do that for you. You'd need to manually post to the Folio every night, but may be OK in a small setting. Those night auditors need something to do in the evening now, don't they. :)

I was hoping to avoid the learning curve of a new PBX.
 

Centar

Member
Joined
Jan 7, 2010
Messages
53
Reaction score
10
I installed a2billing on IncrediblePBX a few months back. I did a cloud deployment.

Installation was straightforward. I have no specific warnings or advice for installation. My concern was in what it was capable of. I was told that it would keep track of phone usage in a motel/hotel setting, where guests would be billed for maybe $0.05 per minute of phone usage. A2billing wouldn't be suitable for that.

A2billing is a gateway. It's good for running a calling card business where clients can authenticate through the gateway using a calling card number, then allow calling as long as the account balance stays positive. But I don't know that I would operate a calling card business using a raspberry pi. At least not when you can do a cloud deployment at hiformance for $12/year.

Yes I am quite familiar with a2billing and indeed I have a project requiring it on a Pi3...you could run a post pay system on a2billing...but I would just use the call data records to monitor (review) each room's calls when they check out and charge them then...How did you do your install? By following step by step the a2billing install document or some other way (ie. script)?
 

ajonate

Member
Joined
Jun 18, 2018
Messages
125
Reaction score
15
As I recall, it was a step by step install. It took awhile.
 

Centar

Member
Joined
Jan 7, 2010
Messages
53
Reaction score
10
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
 
Last edited:
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top