Faça o download do
A2Billing com os comandos abaixo:
# cd /usr/src
# mkdir a2billing
# cd a2billing
# wget http://a2billing.net/downloads/A2Billing_1.3.0.tar.gz
# tar -xzvf a2billing.tar.gz
Crie o atalho para o site virtual do A2Billing:
# ln -s /usr/src/a2billing/A2Billing_UI /var/www/a2billing
Alterando o A2billing:
Execute os comandos abaixo:
# mysql
GRANT ALL PRIVILEGES ON *.* TO 'a2billinguser'@'%' IDENTIFIED BY 'a2billing' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'a2billinguser'@'localhost' IDENTIFIED BY 'a2billing' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'a2billinguser'@'localhost.localdomain' IDENTIFIED BY 'a2billing' WITH GRANT OPTION;
quit;
# mysqladmin create mya2billing -u a2billinguser -p
# mysql mya2billing -u a2billinguser -p < /usr/src/a2billing/DataBase/mysql/Mysql-5.x/\
a2billing-mysql-schema-MYSQL.5.X-v1.3.0.sql
# mysql mya2billing -u a2billinguser -p (password a2billing)
mysql>
use mya2billing;
mysql>
select * FROM cc_ui_authen;
# nano /usr/src/a2billing/a2billing.conf
Insira o texto abaixo:
[database]
hostname=localhost
port=5432
user=a2billinguser
password=a2billing
dbname=mya2billing
dbtype=mysql
Saia e salve com "Ctrl + X seguido de Y ou S e tecle "Enter".
# cp /usr/src/a2billing/a2billing.conf /etc/asterisk/
# ln -s /usr/src/a2billing/A2Billing_UI /var/www/a2billing
# ln -s /usr/src/a2billing/ACustomer_UI /var/www/a2billingcustom
# nano /etc/asterisk/a2billing.conf
e
# nano /usr/src/a2billing/a2billing.conf
Na sessão [webui]
configuration for the Web interface
[webui]
; Path to store the asterisk configuration files
buddyfilepath = /etc/asterisk/
; Email of the admin (not used yet)
email_admin = info@areski.net
; Card lenght
len_cardnumber = 10
; Voucher lenght
len_voucher = 15
; amount of MOH class you have created in musiconhold.conf :
acc_1, acc_2... acc_10 class etc...
num_musiconhold_class = 10
;MANAGER CONNECTION PARAMETERS
manager_host = localhost
manager_username = myasterisk
manager_secret = mycode
; Allow to display the help section inside the admin interface
(YES - NO)
show_help="YES"
; Parameter of the upload
my_max_file_size_import = 512000
my_max_file_size = 512000 ; in bytes
; Not used yet, goal is to upload files and use them directly in
the IVR
dir_store_audio = /var/lib/asterisk/sounds/a2billing
; Parameter of the upload
my_max_file_size_audio=3072000 ; in bytes
; the file type extensions allowed to be uploaded such as "gsm,
mp3, wav" (separate by ,)
file_ext_allow = gsm, mp3, wav
; the file type extensions allowed to be uploaded for the
musiconhold such as "gsm, mp3, wav" (separate by ,)
file_ext_allow_musiconhold = mp3
; ENABLE THE CDR VIEWER TO LINK ON THE MONITOR FILES (YES - NO)
link_audio_file = "NO"
; PATH TO LINK ON THE RECORDED MONITOR FILES
monitor_path = /var/spool/asterisk/monitor
// grant access to apache user on read mode for the directory :>
chmod 755 /var/spool/asterisk/monitor/
; FORMAT OF THE RECORDED MONITOR FILE
monitor_formatfile = gsm
; Display the icon in the invoice
show_icon_invoice = "YES"
; Display the top frame (useful if you want to save space on your
little tiny screen )
show_top_frame = "NO"
Saia e salve com "Ctrl + X seguido de Y ou S e tecle "Enter".
# chmod 777 /etc/asterisk
# chmod 777 /usr/src/a2billing
# mkdir /var/lib/asterisk/moh/mp3
# for X in `seq 1 10`; do mkdir /var/lib/asterisk/moh/mp3/acc_$X; done
# chmod 777 /var/lib/asterisk/moh/mp3/acc_*
# mkdir /var/lib/asterisk/sounds/a2billing
# chmod 777 /var/lib/asterisk/sounds/a2billing
No
sip.conf, adicione a seguinte linha no fim do texto:
#include additional_a2billing_sip.conf
Saia e salve com "Ctrl + X seguido de Y ou S e tecle "Enter".
No
iax.conf, adicione a seguinte linha no fim do texto:
#include additional_a2billing_iax.conf
Saia e salve com "Ctrl + X seguido de Y ou S e tecle "Enter".
Execute os comandos abaixo:
# nano /etc/asterisk/manager.conf
Verifique o enabled=yes:
[general] enabled = yes
port = 5038
bindaddr = 0.0.0.0
;displayconnects = yes
Adicione a linha abaixo:
[myasterisk]
secret = mycode
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
Saia e salve com "Ctrl + X seguido de Y ou S e tecle "Enter".
Edite o
musichold.conf conforme segue abaixo:
# nano /etc/asterisk/musiconhold.conf
; class definitions For A2Billing
acc_1 => mp3:/var/lib/asterisk/mohmp3/acc_1
acc_2 => mp3:/var/lib/asterisk/mohmp3/acc_2
acc_3 => mp3:/var/lib/asterisk/mohmp3/acc_3
acc_4 => mp3:/var/lib/asterisk/mohmp3/acc_4
acc_5 => mp3:/var/lib/asterisk/mohmp3/acc_5
acc_6 => mp3:/var/lib/asterisk/mohmp3/acc_6
acc_7 => mp3:/var/lib/asterisk/mohmp3/acc_7
acc_8 => mp3:/var/lib/asterisk/mohmp3/acc_8
acc_9 => mp3:/var/lib/asterisk/mohmp3/acc_9
acc_10 => mp3:/var/lib/asterisk/mohmp3/acc_10
Saia e salve com "Ctrl + X seguido de Y ou S e tecle "Enter".
Reinicie o banco de dados MYSQL:
# /etc/init.d/mysql restart
Inicie o ASTERISK com o comando:
# asterisk -vvvvgc
Abra o seu navegador da Internet e digite o IP do servidor. Se o navegador abrir uma página do FTP com o endereço A2Billing, clique 2x e pronto. Faça login com user=root & pass=myroot e bom trabalho.
Por: FÁBIO GARCIA
Analista de Sistemas
Infotel - ClickTelecom
msn: fabio_vgarcia@msn.com