Author Archive

How to install A2billing

Written by admin on November 22, 2014. Posted in A2billing

1. We need to install php 5.2 first because a2billing uses 5.2 but Centos 5 comes with php 5.1

# nano /etc/yum.repos.d/centos-testing.repo

and add the following:

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*

press Ctrl X>Y> Enter

Now update

# yum update

2. Install additional required packages if not already installed

# yum -y install php-mcrypt perl-DBD-Pg

3. Change php folder permission back to what it was set to during Asterisk/FreePBX install before PHP update

# chown -R asterisk:asterisk /var/lib/php/session

4. Add php timezone:

# nano +639 /etc/php.ini

Uncomment date.timezone =Africa/Cairo

Change # date.timezone = to date.timezone =Africa/Cairo
5. Restart apache for the changes to take effect

# service httpd restart

6. Get a2billing source

# cd /usr/src
wget --no-check-certificate https://github.com/Star2Billing/a2billing/tarball/v1-current
dir
Note the filename of the downloaded file and use it as follows:

# tar zxvf  v1-current

# mv Star2Billing-a2billing-xxxxx a2billing

 

7. Prepare MySQL database

# cd /usr/src/a2billing
# mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql
# cd /usr/src/a2billing/DataBase/mysql-5.x
./install-db.sh
Answer questions as follows:

Enter Database Name: mya2billing
Enter Hostname: localhost
Enter UserName: root
Enter Password: 'mysqlrootpassword'
# cp /usr/src/a2billing/a2billing.conf /etc/
nano /etc/a2billing.conf

Make sure the following parameters are set as shown.

[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
dbtype = mysql

8. Create files and set permissions

# 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 -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_iax.conf
chown -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_sip.conf

9. Run sound installation script

# cd /usr/src/a2billing/addons/sounds
./install_a2b_sounds.sh
chown -R asterisk:asterisk /var/lib/asterisk/sounds/

# nano /etc/asterisk/manager_custom.conf

[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

10. Set up a2billing web folder

# mkdir /var/www/html/a2billing
cp -Rf /usr/src/a2billing/admin /var/www/html/a2billing/admin
cp -Rf /usr/src/a2billing/agent /var/www/html/a2billing/agent
cp -Rf /usr/src/a2billing/customer /var/www/html/a2billing/customer
cp -Rf /usr/src/a2billing/common /var/www/html/a2billing/common

# chown -R asterisk: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

11. Set up AGI

# mkdir /var/lib/asterisk/agi-bin
cd /usr/src/a2billing/AGI
cp a2billing.php /var/lib/asterisk/agi-bin/
chown -R asterisk:asterisk /var/lib/asterisk/agi-bin
chmod 755 /var/lib/asterisk/agi-bin/a2billing.php
ln -s /var/www/html/a2billing/common/lib /var/lib/asterisk/agi-bin/lib

# nano /etc/asterisk/extensions_custom.conf

[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,DeadAGI(a2billing.php,${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()

[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

[a2billing-callback]
exten => _X.,1,deadAGI(a2billing.php,1,callback)
exten => _X.,n,Hangup

[a2billing-cid-callback]
exten => _X.,1,deadAGI(a2billing.php,1,cid-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-all-callback]
exten => _X.,1,deadAGI(a2billing.php,1,all-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php,1,voucher)
exten => _X.,n,Hangup

[custom-a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

Go into FreePBX GUI>Setup>Trunks>Add Custom Trunk give it a name and add the following dial string

Local/$OUTNUM$@a2billing/n
12. Add custom destinations to FreePBX via FreePBX GUI>Tools>Custom Destinations

Custom Destination: custom-a2billing,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Callthrough
Custom Destination: custom-a2billing-did,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - DID

13. Start or restart FreePBX

# amportal restart

Recurring Services
Recurring services are handled via the /etc/crontab.

14 Make directory for A2Billing cron PID

# mkdir -p /var/run/a2billing
chown asterisk:asterisk /var/run/a2billing

Copy cron files to some permanent location such as /usr/local
# 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:asterisk /usr/local/a2billing

15. Add the cron jobs to /var/spool/cron/asterisk.

# nano /var/spool/cron/asterisk

# 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

16. Add log files:

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:asterisk /var/log/a2billing

Add index file to prevent browsing of root folder

#touch /var/www/html/a2billing/index.html

# Log into the webpage

http://<ip-addr>/a2billing/admin

user: root
pass: changepassword

 

How to install A2billing on a VPS

Written by admin on November 22, 2014. Posted in A2billing, Asterisk

1. We need to install php 5.2 first because a2billing uses 5.2 but Centos 5 comes with php 5.1

# nano /etc/yum.repos.d/centos-testing.repo

and add the following:

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*

press Ctrl X>Y> Enter

Now update

# yum update

2. Install additional required packages if not already installed

# yum -y install php-mcrypt perl-DBD-Pg

3. Change php folder permission back to what it was set to during Asterisk/FreePBX install before PHP update

# chown -R asterisk:asterisk /var/lib/php/session

4. Add php timezone:

# nano +639 /etc/php.ini

Uncomment date.timezone =Africa/Cairo

Change # date.timezone = to date.timezone =Africa/Cairo
5. Restart apache for the changes to take effect

# service httpd restart

6. Get a2billing source

# cd /usr/src
wget --no-check-certificate https://github.com/Star2Billing/a2billing/tarball/v1-current

If you are installing on Centos 6 better grab the latest version on

wget https://github.com/Star2Billing/a2billing/archive/master.tar.gz

Note the filename of the downloaded file and use it as follows:

# tar zxvf   v1-current

# mv Star2Billing-a2billing-xxxxxxx   a2billing

7. Prepare MySQL database

# cd /usr/src/a2billing
# mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql
# cd /usr/src/a2billing/DataBase/mysql-5.x
./install-db.sh
Answer questions as follows:

Enter Database Name: mya2billing
Enter Hostname: localhost
Enter UserName: root
Enter Password: 'mysqlrootpassword'
# cp /usr/src/a2billing/a2billing.conf /etc/
nano /etc/a2billing.conf

Make sure the following parameters are set as shown.

[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
dbtype = mysql

8. Create files and set permissions

# 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 -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_iax.conf
chown -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_sip.conf

9. Run sound installation script

# cd /usr/src/a2billing/addons/sounds
./install_a2b_sounds.sh
chown -R asterisk:asterisk /var/lib/asterisk/sounds/

# nano /etc/asterisk/manager_custom.conf

[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

10. Set up a2billing web folder

# mkdir /var/www/html/a2billing
cp -Rf /usr/src/a2billing/admin /var/www/html/a2billing/admin
cp -Rf /usr/src/a2billing/agent /var/www/html/a2billing/agent
cp -Rf /usr/src/a2billing/customer /var/www/html/a2billing/customer
cp -Rf /usr/src/a2billing/common /var/www/html/a2billing/common

# chown -R asterisk: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

11. Set up AGI

# mkdir /var/lib/asterisk/agi-bin
cd /usr/src/a2billing/AGI
cp a2billing.php /var/lib/asterisk/agi-bin/
chown -R asterisk:asterisk /var/lib/asterisk/agi-bin
chmod 755 /var/lib/asterisk/agi-bin/a2billing.php
ln -s /var/www/html/a2billing/common/lib /var/lib/asterisk/agi-bin/lib

# nano /etc/asterisk/extensions_custom.conf

[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,DeadAGI(a2billing.php,${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()

[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

[a2billing-callback]
exten => _X.,1,deadAGI(a2billing.php,1,callback)
exten => _X.,n,Hangup

[a2billing-cid-callback]
exten => _X.,1,deadAGI(a2billing.php,1,cid-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-all-callback]
exten => _X.,1,deadAGI(a2billing.php,1,all-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php,1,voucher)
exten => _X.,n,Hangup

[custom-a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

Go into FreePBX GUI>Setup>Trunks>Add Custom Trunk give it a name and add the following dial string

Local/$OUTNUM$@a2billing/n
12. Add custom destinations to FreePBX via FreePBX GUI>Tools>Custom Destinations

Custom Destination: custom-a2billing,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Callthrough
Custom Destination: custom-a2billing-did,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - DID

13. Start or restart FreePBX

# amportal restart

Recurring Services
Recurring services are handled via the /etc/crontab.

14 Make directory for A2Billing cron PID

mkdir -p /var/run/a2billing
chown asterisk:asterisk /var/run/a2billing
Copy cron files to some permanent location such as /usr/local
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:asterisk /usr/local/a2billing

15. Add the cron jobs to /var/spool/cron/asterisk.

# nano /var/spool/cron/asterisk

# 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

16. Add log files:

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:asterisk /var/log/a2billing

Add index file to prevent browsing of root folder
touch /var/www/html/a2billing/index.html

# Log into the webpage

http://<ip-addr>/a2billing/admin

user: root
pass: changepassword

How to install Asterisk and A2billing on an Ubuntu server (11.04)

Written by admin on November 22, 2014. Posted in A2billing, Asterisk

This installation was carried out on Ubuntu 10.04 Lucid for SolusVM on x86-64

We need to upgrade apt-get

#apt-get upgrade
#apt-get update
Configure your timezone:
#dpkg-reconfigure tzdata

Install some pre-requisites:
#apt-get install libapache2-mod-php5 php5 php5-common
#apt-get install php5-cli php5-mysql mysql-server apache2 php5-gd (note the password for mysql, we will need it later)
#apt-get install php5-mcrypt

Add repos and install Asterisk 1.8
#apt-get install python-software-properties -y
#apt-key adv --keyserver pgp.mit.edu --recv-keys 175E41DF

#add-apt-repository "deb http://packages.asterisk.org/deb `lsb_release -cs` main"
#sudo add-apt-repository "deb-src http://packages.asterisk.org/deb `lsb_release -cs` main" (If you get an error here just ignore and carry on)

#apt-get update
#apt-get upgrade

# apt-get install asterisk

Download and install A2billing:
# cd /usr/local/src

# wget https://github.com/Star2Billing/a2billing/tarball/v1-current

# tar -zxvf v1-current
rm v1-current
mv Star2Billing-a2billing-* a2billing

Prep the database:
#cd a2billing/DataBase/mysql-5.x

# mysql -uroot -p < a2billing-createdb-user.sql

# ./install-db.sh

You will be asked to enter details. Enter them as follows

database name :  mya2billing

hostname : localhost
User : root
Password : mysqlpassword (This is the one we created earlier)
Copy and edit a2billing.conf:
# cp /usr/local/src/a2billing/a2billing.conf /etc/
# nano -w /etc/a2billing.conf
Make sure the first stanza looks like the following:
[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
dbtype = mysqlAdditional files for A2billing:# chmod 777 /etc/asterisk -R
touch /etc/asterisk/additional_a2billing_iax.conf
touch /etc/asterisk/additional_a2billing_sip.conf
echo #include additional_a2billing_sip.conf >> /etc/asterisk/sip.conf
echo #include additional_a2billing_iax.conf >> /etc/asterisk/iax.conf
chown -Rf www-data /etc/asterisk/additional_a2billing_iax.conf
chown -Rf www-data /etc/asterisk/additional_a2billing_sip.confInstall the A2billing sounds:
# cd /usr/local/src/a2billing/addons/sounds
./install_a2b_sounds_deb.sh
chown -R asterisk:asterisk /usr/share/asterisk/sounds/

Edit manager.conf:
# nano -w /etc/asterisk/manager.conf
[myasterisk]
secret=mycode
read=system,call,log,verbose,command,agent,user
write=system,call,log,verbose,command,agent,user

Install the AGI etc:

# mkdir /usr/share/asterisk/agi-bin
cd /usr/local/src/a2billing/AGI
cp a2billing.php /usr/share/asterisk/agi-bin/
chown -R asterisk:asterisk /usr/share/asterisk/agi-bin
chmod 755 /usr/share/asterisk/agi-bin/a2billing.php
cp /usr/local/src/a2billing/common/lib  /usr/share/asterisk/agi-bin/lib -R

Install the webui:
# mkdir /var/www/a2billing
chown www-data:www-data /var/www/a2billing
cp -rf /usr/local/src/a2billing/admin /var/www/a2billing
cp -rf /usr/local/src/a2billing/agent /var/www/a2billing
cp -rf /usr/local/src/a2billing/customer /var/www/a2billing
cp -rf /usr/local/src/a2billing/common /var/www/a2billing

chmod 755 /var/www/a2billing/admin/templates_c
chmod 755 /var/www/a2billing/customer/templates_c
chmod 755 /var/www/a2billing/agent/templates_c

chown -R www-data:www-data /var/www

Add contexts to extensions.conf: (For wholesale termination)
# nano -w /etc/asterisk/extensions.conf

[a2billing]
; CallingCard application
;exten => _X.,1,Answer
;exten => _X.,2,Wait(2)
;exten => _X.,3,deadAGI(a2billing.php)
;exten => _X.,4,Wait(2)
;exten => _X.,5,Hangup
exten => _X.,1,deadAGI(a2billing.php)
exten => _X.,n,Hangup

[did]
; CallingCard application
exten => _X.,1,deadAGI(a2billing.php,1,did)

Add some cron entries:
# crontab -e

# update the currency table
0 6 * * * php /usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php

# manage the monthly services subscription
0 6 1 * * php /usr/local/src/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/src/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/src/a2billing/Cronjobs/a2billing_bill_diduse.php

# This script will take care of the recurring service.
0 12 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_process.php

# To generate invoices and for each user.
0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_billing.php

# to proceed the autodialer
*/5 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_autodialer.php

# manage alarms
0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm.php

Make a logfile:

# mkdir /var/log/a2billing
touch /var/log/a2billing/a2billing_agi.log
chown -R asterisk:asterisk /var/log/a2billing
Add some rotation:
# cd /etc/logrotate.d
nano -w a2billing

/var/log/a2billing/*.log {
daily
missingok
rotate 4
sharedscripts
postrotate
endscript
}

Enable SSL using default certificate for admin:

ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl

# a2enmod rewrite
# service apache2 restart

 

Browse to http://youripaddress/a2billing/admin and login with the following credentials:

Username: root

Password : changepassword

 

REMEMBER TO CHANGE YOUR PASS WORD

How to Install Magnus Billing

Written by admin on November 22, 2014. Posted in Asterisk

Magnus Billing has some of the best features incorporated from first looks. However working around it can be quite taxing if you dont understand Portuguese. Although the program has multi language support some of the items were never translated.

When it comes to installation the original script given at their site doesnt always give the intended results. This is because asterisk does not install correctly. I have managed to tweak the script by just adding 2 lines that remove the originally downloaded file of asterisk. The script is stored on our servers. The following is an updated installation script for Magnus billing in centos.

***NB***  Make sure before you install that the mysql server is installed and running but without root password.

In some cases make sure subversion is installed. The steps are

 

#yum install mysql server

#yum install subversion

#cd /usr/src

wget http://asteriskonvps.com/repo/install.sh
chmod +x install.sh
./install.sh

 

After installation visit  http://ip-address/billing

Use the following login details  username: root    password: magnus

How to use both pinless dialing and calling card feature on a2billing

Written by admin on November 22, 2014. Posted in A2billing

A number of clients keep asking me how to have calling card feature run together with pin-less dialing.  This article is a text follow up of a video i am doing on the process the article must be read together with the video.

The secret is in the agi-conf files. This is the file that tells a2billing how to handle calls. You will need to create a second agi-conf file in a2billing admin panel.

To do this navigate to SYSTEM SETTINGS >>Add agi-conf

Before you proceed with any thing  login to your ssh and do the following

 

# nano /etc/asterisk/extensions_custom.conf

make sure at the end of the file you have the following:

[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
[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php,1,voucher)
exten => _X.,n,Hangup
[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
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()
Click CTRL+X  to save
# amportal restart
Notice that we have use agi -conf2 file for calling cards.
custom-a2billing is for pin-less dialing while a2billing-cc is for calling cards.
Next you need to create these custom destinations in FreePBX via FreePBX GUI>Tools>Custom Destinations

Custom Destination: custom-a2billing,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Callthrough

Custom Destination: a2billing-cc,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Calling cards
Custom Destination: a2billing-voucher,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Voucher
Go to Inbound routes and forward your access numbers to a2billing-cc
Also forward your voucher topup DID to a2billing voucher
Go back to a2billing admin panel and make sure you turn DNID to "no" and Enable CID to "no" in agi-conf2.
That's it your SIP clients can now use pinless dialing while your calling card customers can do so via the access numb

A2billing DID CID

Written by admin on November 17, 2014. Posted in A2billing

I recently carried out some work for client who had the following requirement:

He had clients with DID numbers. Some of the clients wanted the caller ID displayed when the DID was called to be that of the originating caller and others preferred the DID number to show up instead. 

The solution was as follows, i know it took me a long time to figure it out that is why i did this article to remember by.

The DID provider was passing  the DID number in the header and the originating call as caller name. So the process involves extracting the DID number for those who wanted the DID Caller ID. So in /etc/asterisk/extensions_custom.conf  i created two instances of settings for DID passing to a2billing.

# nano /etc/asterisk/extensions_custom.conf

[custom-a2billing-did]
exten => _X.,1,Noop
exten => _X.,2,Set(pseudodid=${CUT(CUT(SIP_HEADER(To),@,1),:,2)})
exten => _X.,3,Set(CALLERID(name)=${pseudodid})
exten => _X.,4,Set(CALLERID(num)=${pseudodid})
exten => _X.,5,deadAGI(a2billing.php,1,did)
exten => _X.,6,Hangup

[custom-a2billing-did2]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup
Ctrl X  and then Y
Now add custom destinations to FreePBX via FreePBX GUI>Tools>Custom Destinations
Custom Destination: custom-a2billing-did,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - DID
Custom Destination: custom-a2billing-did2,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - DID2
Start or restart FreePBX
amportal restart
Now all those clients who want DID numbers as CID can be set up on A2Billing - DID and those who want originating numbers can be set on A2Billing - DID2
This is how its done
Go to FreePBX and click on Inbound routes. Enter your DID and set destination to A2Billing - DID if you want to pass the DID number or A2Billing - DID2 for originating CID.

How to install A2billing on a VPS

Written by admin on November 17, 2014. Posted in A2billing

1. We need to install php 5.2 first because a2billing uses 5.2 but Centos 5 comes with php 5.1

# nano /etc/yum.repos.d/centos-testing.repo

and add the following:

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*

press Ctrl X>Y> Enter

Now update

# yum update

2. Install additional required packages if not already installed

# yum -y install php-mcrypt perl-DBD-Pg

3. Change php folder permission back to what it was set to during Asterisk/FreePBX install before PHP update

# chown -R asterisk:asterisk /var/lib/php/session

4. Add php timezone:

# nano +639 /etc/php.ini

Uncomment date.timezone =Africa/Cairo

Change # date.timezone = to date.timezone =Africa/Cairo
5. Restart apache for the changes to take effect

# service httpd restart

6. Get a2billing source

# cd /usr/src
wget --no-check-certificate https://github.com/Star2Billing/a2billing/tarball/v1-current

If you are installing on Centos 6 better grab the latest version on

wget https://github.com/Star2Billing/a2billing/archive/master.tar.gz

Note the filename of the downloaded file and use it as follows:

# tar zxvf   v1-current

# mv Star2Billing-a2billing-xxxxxxx   a2billing

7. Prepare MySQL database

# cd /usr/src/a2billing
# mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql
# cd /usr/src/a2billing/DataBase/mysql-5.x
./install-db.sh
Answer questions as follows:

Enter Database Name: mya2billing
Enter Hostname: localhost
Enter UserName: root
Enter Password: 'mysqlrootpassword'
# cp /usr/src/a2billing/a2billing.conf /etc/
nano /etc/a2billing.conf

Make sure the following parameters are set as shown.

[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
dbtype = mysql

8. Create files and set permissions

# 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 -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_iax.conf
chown -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_sip.conf

9. Run sound installation script

# cd /usr/src/a2billing/addons/sounds
./install_a2b_sounds.sh
chown -R asterisk:asterisk /var/lib/asterisk/sounds/

# nano /etc/asterisk/manager_custom.conf

[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

10. Set up a2billing web folder

# mkdir /var/www/html/a2billing
cp -Rf /usr/src/a2billing/admin /var/www/html/a2billing/admin
cp -Rf /usr/src/a2billing/agent /var/www/html/a2billing/agent
cp -Rf /usr/src/a2billing/customer /var/www/html/a2billing/customer
cp -Rf /usr/src/a2billing/common /var/www/html/a2billing/common

# chown -R asterisk: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

11. Set up AGI

# mkdir /var/lib/asterisk/agi-bin
cd /usr/src/a2billing/AGI
cp a2billing.php /var/lib/asterisk/agi-bin/
chown -R asterisk:asterisk /var/lib/asterisk/agi-bin
chmod 755 /var/lib/asterisk/agi-bin/a2billing.php
ln -s /var/www/html/a2billing/common/lib /var/lib/asterisk/agi-bin/lib

# nano /etc/asterisk/extensions_custom.conf

[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,DeadAGI(a2billing.php,${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()

[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

[a2billing-callback]
exten => _X.,1,deadAGI(a2billing.php,1,callback)
exten => _X.,n,Hangup

[a2billing-cid-callback]
exten => _X.,1,deadAGI(a2billing.php,1,cid-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-all-callback]
exten => _X.,1,deadAGI(a2billing.php,1,all-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php,1,voucher)
exten => _X.,n,Hangup

[custom-a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

Go into FreePBX GUI>Setup>Trunks>Add Custom Trunk give it a name and add the following dial string

Local/$OUTNUM$@a2billing/n
12. Add custom destinations to FreePBX via FreePBX GUI>Tools>Custom Destinations

Custom Destination: custom-a2billing,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Callthrough
Custom Destination: custom-a2billing-did,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - DID

13. Start or restart FreePBX

# amportal restart

Recurring Services
Recurring services are handled via the /etc/crontab.

14 Make directory for A2Billing cron PID

mkdir -p /var/run/a2billing
chown asterisk:asterisk /var/run/a2billing
Copy cron files to some permanent location such as /usr/local
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:asterisk /usr/local/a2billing

15. Add the cron jobs to /var/spool/cron/asterisk.

# nano /var/spool/cron/asterisk

# 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

16. Add log files:

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:asterisk /var/log/a2billing

Add index file to prevent browsing of root folder
touch /var/www/html/a2billing/index.html

# Log into the webpage

http://<ip-addr>/a2billing/admin

user: root
pass: changepassword

 

How to install Asterisk and A2billing on an Ubuntu server (11.04)

Written by admin on November 17, 2014. Posted in A2billing, Asterisk

This installation was carried out on Ubuntu 10.04 Lucid for SolusVM on x86-64

We need to upgrade apt-get

#apt-get upgrade
#apt-get update
Configure your timezone:
#dpkg-reconfigure tzdata

Install some pre-requisites:
#apt-get install libapache2-mod-php5 php5 php5-common
#apt-get install php5-cli php5-mysql mysql-server apache2 php5-gd (note the password for mysql, we will need it later)
#apt-get install php5-mcrypt

Add repos and install Asterisk 1.8
#apt-get install python-software-properties -y
#apt-key adv --keyserver pgp.mit.edu --recv-keys 175E41DF

#add-apt-repository "deb http://packages.asterisk.org/deb `lsb_release -cs` main"
#sudo add-apt-repository "deb-src http://packages.asterisk.org/deb `lsb_release -cs` main" (If you get an error here just ignore and carry on)

#apt-get update
#apt-get upgrade

# apt-get install asterisk

Download and install A2billing:
# cd /usr/local/src

# wget https://github.com/Star2Billing/a2billing/tarball/v1-current

# tar -zxvf v1-current
rm v1-current
mv Star2Billing-a2billing-* a2billing

Prep the database:
#cd a2billing/DataBase/mysql-5.x

# mysql -uroot -p < a2billing-createdb-user.sql

# ./install-db.sh

You will be asked to enter details. Enter them as follows

database name :  mya2billing

hostname : localhost
User : root
Password : mysqlpassword (This is the one we created earlier)
Copy and edit a2billing.conf:
# cp /usr/local/src/a2billing/a2billing.conf /etc/
# nano -w /etc/a2billing.conf
Make sure the first stanza looks like the following:
[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
dbtype = mysqlAdditional files for A2billing:# chmod 777 /etc/asterisk -R
touch /etc/asterisk/additional_a2billing_iax.conf
touch /etc/asterisk/additional_a2billing_sip.conf
echo #include additional_a2billing_sip.conf >> /etc/asterisk/sip.conf
echo #include additional_a2billing_iax.conf >> /etc/asterisk/iax.conf
chown -Rf www-data /etc/asterisk/additional_a2billing_iax.conf
chown -Rf www-data /etc/asterisk/additional_a2billing_sip.confInstall the A2billing sounds:
# cd /usr/local/src/a2billing/addons/sounds
./install_a2b_sounds_deb.sh
chown -R asterisk:asterisk /usr/share/asterisk/sounds/

Edit manager.conf:
# nano -w /etc/asterisk/manager.conf
[myasterisk]
secret=mycode
read=system,call,log,verbose,command,agent,user
write=system,call,log,verbose,command,agent,user

Install the AGI etc:

# mkdir /usr/share/asterisk/agi-bin
cd /usr/local/src/a2billing/AGI
cp a2billing.php /usr/share/asterisk/agi-bin/
chown -R asterisk:asterisk /usr/share/asterisk/agi-bin
chmod 755 /usr/share/asterisk/agi-bin/a2billing.php
cp /usr/local/src/a2billing/common/lib  /usr/share/asterisk/agi-bin/lib -R

Install the webui:
# mkdir /var/www/a2billing
chown www-data:www-data /var/www/a2billing
cp -rf /usr/local/src/a2billing/admin /var/www/a2billing
cp -rf /usr/local/src/a2billing/agent /var/www/a2billing
cp -rf /usr/local/src/a2billing/customer /var/www/a2billing
cp -rf /usr/local/src/a2billing/common /var/www/a2billing

chmod 755 /var/www/a2billing/admin/templates_c
chmod 755 /var/www/a2billing/customer/templates_c
chmod 755 /var/www/a2billing/agent/templates_c

chown -R www-data:www-data /var/www

Add contexts to extensions.conf: (For wholesale termination)
# nano -w /etc/asterisk/extensions.conf

[a2billing]
; CallingCard application
;exten => _X.,1,Answer
;exten => _X.,2,Wait(2)
;exten => _X.,3,deadAGI(a2billing.php)
;exten => _X.,4,Wait(2)
;exten => _X.,5,Hangup
exten => _X.,1,deadAGI(a2billing.php)
exten => _X.,n,Hangup

[did]
; CallingCard application
exten => _X.,1,deadAGI(a2billing.php,1,did)

Add some cron entries:
# crontab -e

# update the currency table
0 6 * * * php /usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php

# manage the monthly services subscription
0 6 1 * * php /usr/local/src/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/src/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/src/a2billing/Cronjobs/a2billing_bill_diduse.php

# This script will take care of the recurring service.
0 12 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_process.php

# To generate invoices and for each user.
0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_billing.php

# to proceed the autodialer
*/5 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_autodialer.php

# manage alarms
0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm.php

Make a logfile:

# mkdir /var/log/a2billing
touch /var/log/a2billing/a2billing_agi.log
chown -R asterisk:asterisk /var/log/a2billing
Add some rotation:
# cd /etc/logrotate.d
nano -w a2billing

/var/log/a2billing/*.log {
daily
missingok
rotate 4
sharedscripts
postrotate
endscript
}

Enable SSL using default certificate for admin:

ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl

# a2enmod rewrite
# service apache2 restart

 

Browse to http://youripaddress/a2billing/admin and login with the following credentials:

Username: root

Password : changepassword

 

REMEMBER TO CHANGE YOUR PASS WORD

If you like our site please consider donating any amount to keep this site running

How to use both pinless dialing and calling card feature on a2billing

Written by admin on November 17, 2014. Posted in A2billing

A number of clients keep asking me how to have calling card feature run together with pin-less dialing.  This article is a text follow up of a video i am doing on the process the article must be read together with the video.

The secret is in the agi-conf files. This is the file that tells a2billing how to handle calls. You will need to create a second agi-conf file in a2billing admin panel.

To do this navigate to SYSTEM SETTINGS >>Add agi-conf

Before you proceed with any thing  login to your ssh and do the following

 

# nano /etc/asterisk/extensions_custom.conf

make sure at the end of the file you have the following:

[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
[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php,1,voucher)
exten => _X.,n,Hangup
[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
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()
Click CTRL+X  to save
# amportal restart
Notice that we have use agi -conf2 file for calling cards.
custom-a2billing is for pin-less dialing while a2billing-cc is for calling cards.
Next you need to create these custom destinations in FreePBX via FreePBX GUI>Tools>Custom Destinations

Custom Destination: custom-a2billing,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Callthrough

Custom Destination: a2billing-cc,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Calling cards
Custom Destination: a2billing-voucher,${EXTEN},1
Destination Quick Pick: (pick destination)
Description: A2Billing - Voucher
Go to Inbound routes and forward your access numbers to a2billing-cc
Also forward your voucher topup DID to a2billing voucher
Go back to a2billing admin panel and make sure you turn DNID to "no" and Enable CID to "no" in agi-conf2.
That's it your SIP clients can now use pinless dialing while your calling card customers can do so via the access numbers.

How to reset passwords for Freepbx, A2billing, Elastix and PIAF

Written by admin on November 16, 2014. Posted in A2billing, Asterisk, Elastix, Freepbx, PIAF, Server Security

Many times i get asked how to reset passwords in different systems. This article will explain how to do this in some VOIP systems.

 

1. FreePBX® 

To reset the admin password in FreePBX® you do the following:

Login to your ssh client and type the following

amportal admin auth_none

You will get the following response

Please wait...

trying to run as user asterisk:

[AUTHTYPE] changed from previous value: [database] to new value: [none]

Now login to yourFreePBX®  using username admin and no password and edit/add/create  admin details

After that go into your ssh and enter

amportal admin auth_database

You will get this response

Please wait...

trying to run as user asterisk:

[AUTHTYPE] changed from previous value: [none] to new value: [database]

You are done. You can now logout of FreePBX®  and login with new credentials

Please note that FreePBX® is a Registered Trademark of Schmooze Com, Inc and our mention of it in this or any other tutorial does not mean we are in any way associated or affiliated with them.

 

2. A2billing

To reset A2billing password you need to login to your ssh

1. Determine the database name, user and password for your A2Billing database

# head -n 15 /etc/a2billing.conf

The settings are normally at the top of the file so we just need the first 15 lines. They are usually

user = a2billinguser
password = a2billing
dbname = mya2billing

2. Log in to MySQL using the details we just got for the A2Billing database -

# mysql -u a2billing-user -p mya2billing
Enter password: a2billing

3. Change the password for root to ‘changepassword’ by using the following string

#mysql> update cc_ui_authen set pwd_encoded = '410fc6268dd3332226de95e42d9efa4046c5463769d7493b85e65cfa5c26362dc2455cc23c0bc5831deb008def4ab11a9eaa9b76ba3f377da134f39ec60dd758' where login='root';

4. You should now be able to login to A2Billing using the username/password of root/changepassword.

The A2billing password reset part is courtesy of  Matt Newcombe  http://sysadminman.net/blog/2009/reset-a2billing-1-4-root-password-950

 

3. Elastix

For Elastix just login to your ssh and enter the following line

# sqlite3 /var/www/db/acl.db "UPDATE acl_user SET md5_password = '`echo -n password|md5sum|cut -d ' ' -f 1`' WHERE name = 'admin'"

Replace the red coloured password with your desired password.

 

4. PBX in a flash (PIAF)

In PIAF login to ssh and enter the following

# passwd-master

This will change all your access passwords to the new one that you will be prompted to provide.

Thats it for now