安装在trixbox, 注意格式和语法.
使用SVN下载A2Billing源码
cd /usr/src/
svn co --username guest http://svn.a2billing.net/svn/asterisk2billing/branches/1.3/ trunk(目录)
密码: guest
cp /usr/src/trunk/a2billing.conf /etc/asterisk/
vi /etc/asterisk/a2billing.conf 改为使用mysql
dbname = mya2billing
dbtype = postgres
;dbtype = mysql
改为
dbname = mya2billing
;dbtype = postgres
dbtype = mysql
添加数据库
mysql -u root -ppassw0rd < /usr/src/trunk/DataBase/mysql/Mysql-3.x_4.x/a2billing-MYSQL-createdb-user.sql
mysql -u root -ppassw0rd mya2billing < /usr/src/trunk/DataBase/mysql/Mysql-3.x_4.x/a2billing-mysql-schema-MYSQL.3.X-4.X_v1.3.0.sql
拷贝文件
cp -rf /usr/src/a2billing/trunk/A2Billing_UI /var/www/html/.
cp -rf /usr/src/a2billing/trunk/A2BCustomer_UI /var/www/html/.
cd /usr/src/a2billing/trunk/A2Billing_AGI
cp a2billing.php /var/lib/asterisk/agi-bin/.
cp -rf libs_a2billing /var/lib/asterisk/agi-bin/.
chmod +x /var/lib/asterisk/agi-bin/a2billing.php
cp /usr/src/trunk/addons/sounds/* /var/lib/asterisk/sounds/.
cp /usr/src/trunk/addons/sounds/en/* /var/lib/asterisk/sounds/.
添加
echo "#include additional_a2billing_sip.conf" >> sip.conf
echo "#include additional_a2billing_iax.conf" >> iax.conf
echo "#include additional_a2billing_extensions.conf" >> extensions.conf
设置权限
chmod 777 /etc/asterisk
mkdir -p /var/lib/asterisk/sounds/a2billing
chmod 777 /var/lib/asterisk/sounds/a2billing
chown –R asterisk:asterisk /var/www/html/A2Billing_UI
chown –R asterisk:asterisk /var/www/html/A2BCustomer_UI
chmod 777 /var/www/html/A2Billing_UI/templates_c
chmod 777 /var/www/html/A2BCustomer_UI/templates_c
创建彩铃文件夹
mkdir -p /var/lib/asterisk/mohmp3/acc_1
....
mkdir -p /var/lib/asterisk/mohmp3/acc_10
vi /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
插入以下字段到additional_a2billing_extensions.conf中
vi additional_a2billing_extensions.conf(若没有此文件,请在/etc/asterisk目录下新建一个)
[a2billing]
exten => _**.,1,Dial(SIP/$ {EXTEN:2},60,r)##内部分机互打使用**加号码
exten => _**.,2,Dial(IAX2/$ {EXTEN:2},60,r)
exten => _**.,n,Hangup
;exten => _X.,1,Answer
exten => _X.,1,DeadAGI(a2billing.php|1)
exten => _X.,n,AGI(a2billing.php|1)
exten => _X.,n,Hangup
exten => _90000,1,Answer
exten => _90000,2,DeadAGI(a2billing.php|1|voucher)##添加充值热线
exten => _90000,2,AGI(a2billing.php|1|voucher)
exten => _90000,n,Hangup
[a2billing-callback]
exten => _X.,1,DeadAGI(a2billing.php|1|callback)
exten => _X.,1,AGI(a2billing.php|1|callback)
exten => _X.,n,Hangup
[a2billing-cid-callback]
exten => _X.,1,DeadAGI(a2billing.php|1|cid-callback|86) ;
exten => _X.,1,AGI(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|86) ;last parameter is the callback area code
exten => _X.,1,AGI(a2billing.php|1|all-callback|34) ;last parameter is the callback area code
exten => _X.,n,Hangup
[a2billing-predictivedialer]
exten => _X.,1,DeadAGI(a2billing.php|1|predictivedialer)
exten => _X.,1,AGI(a2billing.php|1|predictivedialer)
exten => _X.,n,Hangup
[a2billing-did]
exten => _X.,1,DeadAGI(a2billing.php|1|did)
exten => _X.,1,AGI(a2billing.php|1|did)
exten => _X.,2,Hangup
[a2billing-voucher]
exten => _X.,1,DeadAGI(a2billing.php|1|voucher)
exten => _X.,1,AGI(a2billing.php|1|voucher)
exten => _X.,n,Hangup
[\quote]
安装回拨服务
安装perl-DBD-Pg
yum install perl-DBD-Pg
安装Perl 模块 Config::IniFiles
perl -MCPAN -e shell
一路回车然后输入
> install Config::IniFiles
> reload
QUOTE:
安装Perl 模块 Config::IniFiles会出错,因为下载过期了,下载一个自己编译就行了
http://search.cpan.org/dist/Config-IniFiles/IniFiles.pm
命令
perl Makefile.PL
make install
mkdir -p /var/lib/asterisk/a2billing
cp -rf callback-daemon /var/lib/asterisk/a2billing/
cd /var/lib/asterisk/a2billing/callback-daemon/
安装守候进程
install --owner=root --group=root --mode=700 a2billing-callback-daemon.rc /etc/rc.d/init.d/a2billing-callback-daemon
chkconfig --add a2billing-callback-daemon && chkconfig a2billing-callback-daemon on
service a2billing-callback-daemon start
编辑 /etc/asterisk/a2billing.conf :
; MANAGER CONNECTION PARAMETERS
manager_host = localhost
manager_username = admin;和manager.conf相同
manager_secret = amp111 ;和manager.conf的相同
添加到自动运行
crontab -e
添加行
59 9 * * * /etc/a2billing-callback-daemon-start
59 16 * * * /etc/a2billing-callback-daemon-stop
拷贝 a2billing-callback-daemon-* 到 /etc/.
cp a2billing-callback-daemon-* /etc/
chmod 755 /etc/a2billing-callback-daemon-*
登陆到 A2B
打开 http://XX.XX.XX.XX/A2Billing_UI 页面.
默认用户名/密码: root / myroot
完成!
A2billing_UI配置:
首先准备中继
iax.conf
[IAX2-1]
username=user
type=friend
secret=password
host=58.61.XX.XX
disallow=all
allow=g729
allow=g723
sip.conf
[SIP-1]
username=user
type=friend
secret=password
qualify=yes
nat=yes
port=5060
insecure=very
host=61.233.XX.XX
fromuser=user
disallow=all
allow=g729
allow=g723
canreinvite=no
context=new
打开http://XX.XX.XX.XX/A2Billing_UI/ 用root登录 密码myroot
使用SVN下载A2Billing源码
cd /usr/src/
svn co --username guest http://svn.a2billing.net/svn/asterisk2billing/branches/1.3/ trunk(目录)
密码: guest
cp /usr/src/trunk/a2billing.conf /etc/asterisk/
vi /etc/asterisk/a2billing.conf 改为使用mysql
dbname = mya2billing
dbtype = postgres
;dbtype = mysql
改为
dbname = mya2billing
;dbtype = postgres
dbtype = mysql
添加数据库
mysql -u root -ppassw0rd < /usr/src/trunk/DataBase/mysql/Mysql-3.x_4.x/a2billing-MYSQL-createdb-user.sql
mysql -u root -ppassw0rd mya2billing < /usr/src/trunk/DataBase/mysql/Mysql-3.x_4.x/a2billing-mysql-schema-MYSQL.3.X-4.X_v1.3.0.sql
拷贝文件
cp -rf /usr/src/a2billing/trunk/A2Billing_UI /var/www/html/.
cp -rf /usr/src/a2billing/trunk/A2BCustomer_UI /var/www/html/.
cd /usr/src/a2billing/trunk/A2Billing_AGI
cp a2billing.php /var/lib/asterisk/agi-bin/.
cp -rf libs_a2billing /var/lib/asterisk/agi-bin/.
chmod +x /var/lib/asterisk/agi-bin/a2billing.php
cp /usr/src/trunk/addons/sounds/* /var/lib/asterisk/sounds/.
cp /usr/src/trunk/addons/sounds/en/* /var/lib/asterisk/sounds/.
添加
echo "#include additional_a2billing_sip.conf" >> sip.conf
echo "#include additional_a2billing_iax.conf" >> iax.conf
echo "#include additional_a2billing_extensions.conf" >> extensions.conf
设置权限
chmod 777 /etc/asterisk
mkdir -p /var/lib/asterisk/sounds/a2billing
chmod 777 /var/lib/asterisk/sounds/a2billing
chown –R asterisk:asterisk /var/www/html/A2Billing_UI
chown –R asterisk:asterisk /var/www/html/A2BCustomer_UI
chmod 777 /var/www/html/A2Billing_UI/templates_c
chmod 777 /var/www/html/A2BCustomer_UI/templates_c
创建彩铃文件夹
mkdir -p /var/lib/asterisk/mohmp3/acc_1
....
mkdir -p /var/lib/asterisk/mohmp3/acc_10
vi /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
插入以下字段到additional_a2billing_extensions.conf中
vi additional_a2billing_extensions.conf(若没有此文件,请在/etc/asterisk目录下新建一个)
[a2billing]
exten => _**.,1,Dial(SIP/$ {EXTEN:2},60,r)##内部分机互打使用**加号码
exten => _**.,2,Dial(IAX2/$ {EXTEN:2},60,r)
exten => _**.,n,Hangup
;exten => _X.,1,Answer
exten => _X.,1,DeadAGI(a2billing.php|1)
exten => _X.,n,AGI(a2billing.php|1)
exten => _X.,n,Hangup
exten => _90000,1,Answer
exten => _90000,2,DeadAGI(a2billing.php|1|voucher)##添加充值热线
exten => _90000,2,AGI(a2billing.php|1|voucher)
exten => _90000,n,Hangup
[a2billing-callback]
exten => _X.,1,DeadAGI(a2billing.php|1|callback)
exten => _X.,1,AGI(a2billing.php|1|callback)
exten => _X.,n,Hangup
[a2billing-cid-callback]
exten => _X.,1,DeadAGI(a2billing.php|1|cid-callback|86) ;
exten => _X.,1,AGI(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|86) ;last parameter is the callback area code
exten => _X.,1,AGI(a2billing.php|1|all-callback|34) ;last parameter is the callback area code
exten => _X.,n,Hangup
[a2billing-predictivedialer]
exten => _X.,1,DeadAGI(a2billing.php|1|predictivedialer)
exten => _X.,1,AGI(a2billing.php|1|predictivedialer)
exten => _X.,n,Hangup
[a2billing-did]
exten => _X.,1,DeadAGI(a2billing.php|1|did)
exten => _X.,1,AGI(a2billing.php|1|did)
exten => _X.,2,Hangup
[a2billing-voucher]
exten => _X.,1,DeadAGI(a2billing.php|1|voucher)
exten => _X.,1,AGI(a2billing.php|1|voucher)
exten => _X.,n,Hangup
[\quote]
安装回拨服务
安装perl-DBD-Pg
yum install perl-DBD-Pg
安装Perl 模块 Config::IniFiles
perl -MCPAN -e shell
一路回车然后输入
> install Config::IniFiles
> reload
QUOTE:
安装Perl 模块 Config::IniFiles会出错,因为下载过期了,下载一个自己编译就行了
http://search.cpan.org/dist/Config-IniFiles/IniFiles.pm
命令
perl Makefile.PL
make install
mkdir -p /var/lib/asterisk/a2billing
cp -rf callback-daemon /var/lib/asterisk/a2billing/
cd /var/lib/asterisk/a2billing/callback-daemon/
安装守候进程
install --owner=root --group=root --mode=700 a2billing-callback-daemon.rc /etc/rc.d/init.d/a2billing-callback-daemon
chkconfig --add a2billing-callback-daemon && chkconfig a2billing-callback-daemon on
service a2billing-callback-daemon start
编辑 /etc/asterisk/a2billing.conf :
; MANAGER CONNECTION PARAMETERS
manager_host = localhost
manager_username = admin;和manager.conf相同
manager_secret = amp111 ;和manager.conf的相同
添加到自动运行
crontab -e
添加行
59 9 * * * /etc/a2billing-callback-daemon-start
59 16 * * * /etc/a2billing-callback-daemon-stop
拷贝 a2billing-callback-daemon-* 到 /etc/.
cp a2billing-callback-daemon-* /etc/
chmod 755 /etc/a2billing-callback-daemon-*
登陆到 A2B
打开 http://XX.XX.XX.XX/A2Billing_UI 页面.
默认用户名/密码: root / myroot
完成!
A2billing_UI配置:
首先准备中继
iax.conf
[IAX2-1]
username=user
type=friend
secret=password
host=58.61.XX.XX
disallow=all
allow=g729
allow=g723
sip.conf
[SIP-1]
username=user
type=friend
secret=password
qualify=yes
nat=yes
port=5060
insecure=very
host=61.233.XX.XX
fromuser=user
disallow=all
allow=g729
allow=g723
canreinvite=no
context=new
打开http://XX.XX.XX.XX/A2Billing_UI/ 用root登录 密码myroot
转载于:https://blog.51cto.com/ciscooracle/274842