Skip to main content

Install A2Billing Asterisk

Set up MySQL
service mysqld start
mysqladmin create asteriskcdrdb;
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql;
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY ‘passw0rd’;
flush privileges;


Asterisk Settings for a2billing

nano /etc/asterisk/cdr_mysql.conf
hostname = localhost
password = passw0rd
user = asterisk
nano /etc/asterisk/res_mysql.conf
dbhost = localhost
dbname = a2billing
dbuser = root
dbpass =
dbport = 3306
dbsock = /var/lib/mysql/mysql.sock

A2Billing Installation

cd /usr/src
mkdir a2billing
cd a2billing
wget –no-check-certificate
tar zxf v1-current
cd Star2Billing-a2billing-*
mv * ..
cd ..
rm -rf Star2Billing-a2billing-*
ln -s /usr/src/a2billing/a2billing.conf /etc/a2billing.conf
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 asterisk:asterisk /etc/asterisk/additional_a2billing_sip.conf
chown asterisk:asterisk /etc/asterisk/additional_a2billing_iax.conf
cd addons/sounds/
ln -s /usr/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/a2billing.php
ln -s /usr/src/a2billing/AGI/lib/ /var/lib/asterisk/agi-bin/
chmod +x /var/lib/asterisk/agi-bin/a2billing.php
ln -s /usr/src/a2billing/customer/ /var/www/html/billing
ln -s /usr/src/a2billing/admin/ /var/www/html/billing
ln -s /usr/src/a2billing/agent/ /var/www/html/billing
ln -s /usr/src/a2billing/common/ /var/www/html/billing
chmod 777 /var/www/html/billing/admin/templates_c/
chmod 777 /var/www/html/billing/agent/templates_c/
chmod 777 /var/www/html/billing/templates_c/
nano /etc/asterisk/manager.conf
[myasterisk] ;FOR a2billing
secret = mycode
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

Install Database for A2Billing

cd /usr/src/a2billing/DataBase/mysql-5.x
mysqladmin create a2billing
GRANT ALL PRIVILEGES ON a2billing.* TO a2billing@localhost IDENTIFIED BY ‘changepassword’;
flush privileges;
#USE a2billing/changepassword
#Secure MySQL
nano /etc/my.cnf
bind-address =
nano /etc/asterisk/extensions_custom.conf
; Set by Network staff for manual assignment
exten => _X.,1,AGI(a2billing.php,1)
exten => _X.,n,Wait()
exten => _X.,n,Hangup()
; Used by Calling Card Platform for incoming calls
exten => _X.,1,AGI(a2billing.php,2)
exten => _X.,n,Wait()
exten => _X.,n,Hangup()
; Set by website signup for automatic assignment
exten => _X.,1,AGI(a2billing.php,3)
exten => _X.,n,Wait()
exten => _X.,n,Hangup()
; This is where inbound DID calls are pointed to if you plan to be a DID service provider
exten => _X.,1,AGI(a2billing.php,1,did)
exten => _x,1,Hangup()
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit
exten => _X.,1,AGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()
mkdir /var/run/a2billing
crontab -e
# update the currency
0 6 * * * php /usr/src/a2billing/Cronjobs/currencies_update_yahoo.php
# monthly services subscription
0 6 1 * * php /usr/src/a2billing/Cronjobs/a2billing_subscription_fee.php
# check account of users
0 * * * * php /usr/src/a2billing/Cronjobs/a2billing_notify_account.php
# did billing
0 2 * * * php /usr/src/a2billing/Cronjobs/a2billing_bill_diduse.php
# recurring service.
0 12 * * * php /usr/src/a2billing/Cronjobs/a2billing_batch_process.php
# generate invoices and for each user.
0 6 * * * php /usr/src/a2billing/Cronjobs/a2billing_batch_billing.php
# autodialer
*/5 * * * * php /usr/src/a2billing/Cronjobs/a2billing_batch_autodialer.php
# manage alarms
0 * * * * php /usr/src/a2billing/Cronjobs/a2billing_alarm.php
mkdir -p /var/lib/a2billing/script
touch /var/log/asterisk/a2billing-daemon-callback.log
touch /var/log/a2billing-daemon-callback.log
touch /var/log/cront_a2b_alarm.log
touch /var/log/cront_a2b_autorefill.log
touch /var/log/cront_a2b_batch_process.log
touch /var/log/cront_a2b_bill_diduse.log
touch /var/log/cront_a2b_subscription_fee.log
touch /var/log/cront_a2b_currency_update.log
touch /var/log/cront_a2b_invoice.log
touch /var/log/a2billing_paypal.log
touch /var/log/a2billing_epayment.log
touch /var/log/api_ecommerce_request.log
touch /var/log/api_callback_request.log
touch /var/log/a2billing_agi.log
easy_install sqlalchemy
cd $LOAD_LOC/CallBack/callback-daemon-py/
cp $LOAD_LOC/CallBack/callback-daemon-py/build/lib/callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-callback-daemon
chmod +x /etc/init.d/a2b-callback-daemon
python build
python bdist_egg
easy_install dist/
chkconfig –add a2b-callback-daemon
service a2b-callback-daemon start
chkconfig a2b-callback-daemon on
#FreePBX Custom Destinations in /etc/asterisk/extensions_custom.conf
Custom Destination: a2billing,${EXTEN},1
Description: a2billing
Custom Destination: a2billing-callback,${EXTEN},1
Description: a2billing-callback
Custom Destination: a2billing-cid-callback,${EXTEN},1
Description: a2billing-cid-callback
Custom Destination: a2billing-did,${EXTEN},1
Description: a2billing-did
Custom Destination: a2billing-sip,${EXTEN},1
Description: a2billing-sip
Custom Destination: a2billing-cc,${EXTEN},1
Description: a2billing-cc
Custom Destination: a2billing-passthrough,${EXTEN},1
Description: a2billing-passthrough


Popular posts from this blog

Asterisk – CLI commands

Agent commands agent logoff  - Sets an agent offline agent show  - Show status of agents agent show online  - Show all online agents AGI commands agi dump html  - Dumps a list of AGI commands in HTML format agi exec  - Add AGI command to a channel in Async AGI agi set debug [on|off]  - Enable/Disable AGI debugging agi show commands [topic]  - List AGI commands or specific help dnsmgr refresh  - Performs an immediate refresh dnsmgr reload  - Reloads the DNS manager configuration dnsmgr status  - Display the DNS manager status Calendar commands calendar dump sched  - Dump calendar sched context calendar show calendar  - Display information about a calendar calendar show calendars  - Show registered calendars Channel commands channel originate  - Originate a call channel redirect  - Redirect a call channel request hangup  - Request a hangup on a given channel Cli commands cli check permissions  - Try a permissions config for a user cli reload permi

Step by step: Configure call recording - Asterisk tutorials

This article will cover enabling asterisk to record calls. You may want this to interview people over the phone, podcast, or some other purpose. In features.conf, under: [featuremap] uncomment the line that looks like this: automixmon => *3 ; One Touch Record a.k.a. Touch MixMonitor — Make sure to set the X and/or x option in the Dial() or    Queue() app call! Then, enable the X option for Dial() in your dialplan in extensions.conf: PLEASE NOTE:  change you need to make – add the X  your dial rule make look different with me. exten => s,n,Dial(SIP/100,60) make it this instead: exten => s,n,Dial(SIP/100,60,X) The X is what tells Asterisk to allow callers to dial *3 during a call to enable or disable recording. From the asterisk console (run asterisk -r), you should see a line like this appear when the user starts a recording: – User hit ‘*3′ to record call. filename: auto-xxxxx-EXTENSION-DIALEDNUMBER When the recording ends, un

Making video calls – Asterisk tutorial

sip.conf To be able to send video during a call, codec h263 and video support must be enabled. This is done by adding three lines in the sip.conf file (Location: /etc/asterisk/sip.conf). Add the following lines in the [general] tab of the file. videosupport = yes ; Enable video allow = h263 ; H.263 is our video codec allow = h263p ; H.263p is the enhanced video codec Reload Reload the sip.conf file by running the following command in the CLI console:  reload Config in Softphone  Click “Softphone”  Click “Preferences”    Click “Video Codecs”  Verify that h263 and h263+ are selected Click “OK”  Click the video (Webcam) icon to display the video  Dial the other sip phone (number 1002)  Click “Show Video” on the two sip phones.