한국어

IPPBX/GW

온누리070 플레이스토어 다운로드
    acrobits softphone
     온누리 070 카카오 프러스 친구추가온누리 070 카카오 프러스 친구추가친추
     카카오톡 채팅 상담 카카오톡 채팅 상담카톡
    
     라인상담
     라인으로 공유

     페북공유

   ◎위챗 : speedseoul


  
     PAYPAL
     
     PRICE
     

pixel.gif

    before pay call 0088 from app


https://www.powerpbx.org/content/a2billing-install-guide-v2-2


This guide will show how to install A2Billing v2.2 on CentOS v7.  It is assumed you already have Linux and Asterisk and Freepbx installed using a procedure similar to this one.  It is also assumed you have compiled asterisk realtime driver module (res_config_mysql) by selecting it in asterisk menuselect before compiling asterisk. We do not cover the installation of the callback daemon.

Tested using the following software:

Assumptions:

Console text mode (multi-user.target)
Installation done as root user (#)

The following 2 diagrams illustrate A2billing inbound and outbound call flow.

A2billing inbound call flow

A2billing outbound call flow

Install additional required packages if not already installed

yum -y update && yum -y groupinstall core && yum -y groupinstall base && yum -y install epel-release
yum -y install php-mcrypt php-xml perl-DBD-Pg git

Other

If using this procedure on an Asterisk only system without freepbx, you still need many of the freepbx required packages installed.  They can be found at the beginning of this procedure.

Get A2Billing source
cd /usr/src
git clone -b 'v2.2.0' --single-branch https://github.com/Star2Billing/a2billing.git

Get vendor packages using composer.

cd /usr/src/a2billing
curl -sS https://getcomposer.org/installer | php
php composer.phar update
php composer.phar install

Create MySQL root password

If you did not create a mysql root password during the asterisk install you should create one now.

mysqladmin -u root password 'rootmysqlpassword'

Create A2Billing Database

cd /usr/src/a2billing
mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql

which, after you enter your root password, will create:

Database name: mya2billing
Database user: a2billinguser
Database user password: a2billing

Now run script to create tables and insert some basic configuration data

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: {mysql-root-password...not a2billing db password}

Now check that the database and 90+ tables have been created

mysql -u root -p mya2billing
>show tables;

Should produce

+-------------------------+
| Tables_in_mya2billing    
| +-----------------------+
| cc_agent                |
| cc_agent_commission     |
| cc_agent_signup         |
. . .                     |
| cc_ui_authen            |
| cc_version              |
| cc_voucher              |
+-------------------------+
97 rows in set (0.00 sec)
\q
cp /usr/src/a2billing/a2billing.conf /etc/

Make sure the following parameters are set as shown.

nano /etc/a2billing.conf
[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
dbtype = mysql

Create files and set permissions

Only required if not using Asterisk realtime.  We are including this section for legacy purposes.  

Some of these files assume you have FreePBX installed and not just Asterisk.  If you just have Asterisk installed then use the files specified in the INSTALL.rst instructions included with A2billing source files.

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. /etc/asterisk/additional_a2billing_iax.conf
chown -Rf asterisk. /etc/asterisk/additional_a2billing_sip.conf
chmod -R 640 /etc/asterisk

Run sound installation script

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

Add the following to /etc/asterisk/manager_custom.conf

You can also do it via the Freepbx Asterisk API module.  If you don't have Freepbx installed then you should follow the INSTALL.rst instructions included with the a2billing source files.

[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

Add fwconsole blacklist

This is very important. Without this, a reboot or fwconsole restart or fwconsole chown command will delete necessary symlinks in a2billing.

nano /etc/asterisk/freepbx_chown.conf
[blacklist]
directory=/var/www/html/a2billing/

Set up a2billing web folders

A2billing has 3 GUI sections.  adminagent, and customer.

mkdir /var/www/html/a2billing
cp -rf /usr/src/a2billing/admin /var/www/html/a2billing
cp -rf /usr/src/a2billing/agent /var/www/html/a2billing
cp -rf /usr/src/a2billing/customer /var/www/html/a2billing
cp -rf /usr/src/a2billing/common /var/www/html/a2billing
cp -rf /usr/src/a2billing/vendor /var/www/html/a2billing
chown -R 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
Prevent public access to /common and /vendor folders.  This has not been exhaustively tested.  If it causes internal access problems please let us know. 
echo 'Deny from all' > /var/www/html/a2billing/common/.htaccess
echo 'Deny from all' > /var/www/html/a2billing/vendor/.htaccess

Check admin web interface

From a web browser go to http://{my-ip-address}/a2billing/admin and make sure you get the authentication screen.  Log in as follows.

user: root
password: changepassword

Once logged in click change password link at bottom left and change it.

Set up AGI

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

Add the following extensions to /etc/asterisk/extensions_custom.conf

If not using Freepbx then this would go into /etc/asterisk/extensions.conf.  Customize this to your needs.

The 1 in a2billing.php,1 refers to the default agi-conf1 configuration in a2billing system settings.  It is possible to add additional agi-conf such as agi-conf2 etc. via System Settings > Add agi-conf.

nano /etc/asterisk/extensions_custom.conf
[a2billing-did]
exten => _X.,1,AGI(a2billing.php,1,did)
exten => _X.,n,Hangup()

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

Add custom destinations to FreePBX via FreePBX GUI>Admin>Custom Destinations

These destinations are referring to the custom extensions created above in /etc/asterisk/extensions_custom.conf

Target: a2billing-did,${EXTEN},1 
Description: A2Billing - Inbound

Target: a2billing-out,${EXTEN},1 
Description: A2Billing - Outbound

Create inbound route

We are creating a universal DID inbound route.  This requires _. in the DID number field.  That is underscore character followed by period or dot character. 

Connectivity > Inbound Routes

Description: Some descriptive name

DID number: _.

Set Destination: Custom Destinations
                               A2Billing - Inbound

Start or restart FreePBX

fwconsole restart

Cron

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. /usr/local/a2billing

Add the cron jobs to /var/spool/cron/asterisk as follows

crontab -e -u 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

# Check the account of each user and send an email if the balance is below mimimum.
0 * * * * php /usr/local/a2billing/Cronjobs/a2billing_notify_account.php

# Browse all the DID's that are reserved and check if the customer need to pay.
# Bill them or warn them via email that they need 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

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

# Process 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

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

Add index file to prevent browsing of folders

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

Log into the webpage

http://{my-ip-address}/a2billing/admin
  • user:  root
  • pass: mynewpassword

Or use default password changepassword if you have not changed it yet and then click the change password link at the bottom left.

Set Asterisk version in A2Billing

Go into System settings>Global list.  Go to the bottom left and set to display all.  From your web browser search for "asterisk_version".  It will find that setting twice.  One for Global group and one for agi-conf1 group.  Change both accordingly.  If using Asterisk v11 or v13 then use "1_11"

Disable Asterisk Realtime if not setting up the following Asterisk Realtime procedure. Go to System settings>Global search for "realtime".  Change that setting to "no".

Asterisk Realtime

If using Asterisk Realtime you do not need to reload every time you add/remove/change a customer.  It also allows you to share the A2billing database between multiple Asterisk/Freepbx servers.  If you need to create many customers it makes more sense to use a database rather than a flat text file.

Double check you have the Asterisk Realtime module installed. 

cd /usr/lib64/asterisk/modules
dir

There should be a file there called res_config_mysql.so.  If not you need to re-compile Asterisk and set it to compile the res_config_mysql.so realtime module in menuselect.

Add the following to /etc/asterisk/extconfig.conf

nano /etc/asterisk/extconfig.conf

NOTE: [settings] is already included and uncommented in this file in asterisk sample configurations.  So if you installed asterisk samples or Freepbx and this file already exists and you are trying to add to it, do not add this line twice.

[settings]
iaxusers => mysql,general,cc_iax_buddies
iaxpeers => mysql,general,cc_iax_buddies
sipusers => mysql,general,cc_sip_buddies
sippeers => mysql,general,cc_sip_buddies

Add the following to /etc/asterisk/res_config_mysql.conf

nano /etc/asterisk/res_config_mysql.conf

NOTE: [general] is already included and uncommented in this file in asterisk samples.  So if you installed asterisk samples or Freepbx and this file already exists and you are trying to add to it, do not add this line twice.

[general]
dbhost = 127.0.0.1
dbname = mya2billing
dbuser = a2billinguser
dbpass = a2billing
dbport = 3306
;dbsock = /var/lib/mysql/mysql.sock

Assuming (as we did in this guide) that the dbname=mya2billing, dbuser=a2billinguser, dbpassword=a2billing.  Double check that these settings match /etc/a2billing.conf and substitute as necessary.

Now restart freepbx/asterisk

fwconsole restart

To check if realtime is working:

From Asterisk CLI>

asterisk -vvvr
 
core show config mappings

Should produce:

Config Engine: mysql
===> iaxpeers (db=general, table=cc_iax_buddies)
===> iaxusers (db=general, table=cc_iax_buddies)
===> sippeers (db=general, table=cc_sip_buddies)
===> sipusers (db=general, table=cc_sip_buddies)

After you add a customer to A2Billing, and assuming that customer's account number is, for example, 1234567890

realtime load sipusers name 1234567890

should produce:

Column Name  Column Value
-----------  ------------
id           1 
id_cc_card   1 
name         1234567890
accountcode  1234567890
regexten     1234567890
amaflags     billing
callgroup
callerid . . .
maxcallbitrate
outboundproxy
rtpkeepalive  0 
useragent
callbackextension
...
...
...

In the A2Billing GUI go into System settings>Global and search forrealtime. Change that setting to yes if no. If already yesand having problems try change it to no and save and then change back to yes and save.

번호 제목 글쓴이 날짜 조회 수
98 php memory and filesize increase upload wav admin 2019.06.25 5018
97 changing SIP drivers to CHAN_PJSIP Please err 에러 admin 2019.06.21 6026
96 /dev/mapper/ubuntu--vg-root filling up admin 2019.04.08 12302
95 VICIdial Scratch Installation CentOS 7 & MariaDB & Asterisk 11 & Latest VICIdial SVN admin 2017.09.02 22437
94 Asterisk Answering Machine Detection (AMD) Configuration admin 2017.09.01 22164
93 List of 5 Open Source Call Center Software Programs admin 2017.08.31 23582
92 Smart Predictive Auto calling Software System: Automatic Phone Calling admin 2017.08.31 21924
91 WombatDialer is highly scalable, multi-server, works with your existing Asterisk PBX. admin 2017.08.31 21578
90 Asterisk based auto dialer test and verified by 300+ concurrent. admin 2017.08.31 20801
89 Automatic Call Distribution (ACD) Asterisk as Call Center admin 2017.08.31 22011
88 Introducing Asterisk Call Distribution ACD asterisk admin 2017.08.31 21951
87 How to build an outbound Call Center with Newfies-Dialer and Asterisk/FreePBX admin 2017.08.31 21492
86 IVR actions asterisk admin 2017.08.31 20873
85 iptables for asterisk simple example configuration admin 2017.08.31 21130
84 초보) Asterisk , AsteriskNow 무엇인가? 무슨차이인가? 시작 배우기 쉽게 이해 공부 사용 admin 2017.08.29 21605
83 Installing FreePBX 14 on Debian 8.8 These instructions work fine admin 2017.08.29 21607
82 FreePBX 12 – Getting Started Guide admin 2017.08.29 20985
81 Playing text to speech inside read function in asterisk admin 2017.08.28 22110
80 Speech Recognition on Asterisk: Getting Started admin 2017.08.28 22954
79 github A2Billing is commercially supported by Star2Billing admin 2017.08.26 21055
78 Insert into dialplan Asterisk admin 2017.08.26 21342
77 Google letter agi admin 2017.08.26 20790
76 Top 10 greater worker admin 2017.08.26 21174
75 Dialplan handler routines allow customization admin 2017.08.26 21974
74 AGI asterisk gateway interface synopsis admin 2017.08.26 21986
73 Make Your Own IVR with Asterisk admin 2017.08.26 34768
72 Asterisk dialolan detail explan good easy clean admin 2017.08.26 20695
71 download Installing+AsteriskNOW admin 2017.08.25 20906
70 TwistedWave Online A browser-based audio editor admin 2017.08.25 21262
69 Asterisk/IVR/PBX/VoIP/Contact center/Voicebroadcast engineer admin 2017.08.25 21010
68 asterisk Chapter 6. Dialplan Basics admin 2017.08.25 21198
67 RPi Text to Speech (Speech Synthesis) admin 2017.08.24 20775
66 asterisk freepbx TTS Engine Custom - Amazon Polly - 24 languages admin 2017.08.24 21005
65 asterisk CRM SUGARCRM SuiteCRM admin 2017.08.24 20999
64 Hosting Cheap VPS Hosting that doesn’t feel cheap admin 2017.08.24 22828
63 HOW TO INSTALL FREEPBX ON CENTOS 7 admin 2017.08.24 21179
62 Setup Asterisk 13 with FreePBX 13 in CentOS 7 admin 2017.08.24 21741
61 asterisk XactView V3-CRM Widget admin 2017.08.24 20928
60 Text to Speech User Guide admin 2017.08.24 21111
59 Text to speech for asterisk using Google Translate admin 2017.08.24 22453
58 User Control Panel (UCP) 14+ admin 2017.08.23 21011
57 라즈베리파이, 아스타리스크(asterisk) PBX(사설교환기) admin 2017.08.23 28473
56 How to Install Asterisk on CentOS 7 easy clean explain 깔금한 쉬운 설명 admin 2017.08.23 27688
55 Fusionpbx v4 Freeswitch v1.6 CentOS v7 Install Guide admin 2017.08.23 26302
54 Asterisk Freepbx Install Guide (CentOS v7, Asterisk v13, Freepbx v13) admin 2017.08.23 21404
» A2Billing v2.2 Install Guide CentOS v7 Asterisk v11 v13 seems to work FreePBX v13 admin 2017.08.23 24490
52 How to install and setup Asterisk 14 (PBX) on CentOS 7 admin 2017.08.23 21753
51 How to Install Asterisk 13 on Ubuntu 16.04 from Source admin 2017.08.23 21462
50 thirdlane PBX price admin 2017.08.23 20862
49 SUGAR CRM admin 2017.08.23 20849
48 NAT 와 VoIP 시그널과 RTP 전송 영향 NAT와 방화벽/STUN/TURN/ICE/SBC admin 2017.08.19 20997
47 음성통화 서버 Asterisk + FreePBX / 통화 시연해보기 admin 2017.08.18 21255
46 우분투 Mumble VoIP 음성채팅서버 구축 admin 2017.08.18 21384
45 User Control Panel (UCP) asterisk freepbx admin 2017.08.17 21551
44 Configuring Your PBX admin 2017.08.17 20740
43 Installing SNG7 Official Distro admin 2017.08.17 21675
42 OPUS and VP9 Bitrates admin 2017.08.17 21348
41 Capturing SIP and RTP traffic using tcpdump admin 2017.08.17 21197
40 Asterisk Answering Machine Detection (AMD) Configuration admin 2017.08.17 21776
39 Price ,,Install Commercial Modules on CentOS and RHEL based admin 2017.08.16 21561
38 asterisk IVR 쉽게 설정하기 admin 2017.08.16 21132
37 Asterisk 가장쉬운 설치 및 설정 사용 방법 이해 할수있게 배우는 순서 안내 설명 admin 2017.08.16 23154
36 /sbin/service httpd start stop web start stop admin 2017.08.16 20863
35 asterisk FreePBX 14, Distro 14 & More! admin 2017.08.16 21357
34 asterisk dialplan 설명 admin 2017.08.16 22124
33 how-to-freepbx-13-firewall-setup admin 2017.08.14 20726
32 AsterSwitchboard CTI Operator Panel for Asterisk admin 2017.08.08 21030
31 Brand New Sealed Sangoma FreePBX 60 - 75 Users or 30 Calls admin 2017.08.05 21443
30 Asterisk 설치 준비 admin 2015.11.15 21483
29 Asterisk 13 Debian 8 admin 2015.11.13 21024
28 FOIP: T.38 Fax Relay vs. G.711 Fax Pass-Through (Fax Over IP) admin 2015.09.24 21177
27 Considerations for Using T.38 versus G.711 for Fax over IP file admin 2015.09.24 21431
26 MP3 to WAV, WMA to WAV, OGG Convert audio to WAV online admin 2015.05.09 22027
25 FAX over IP sofware admin 2015.05.05 21688
24 Fax Configuration FREE PBX and asterisk FAX admin 2015.05.05 21393
23 Asterisk AGI/AMI to ARI Asterisk&FreePbx - IVR setting admin 2015.05.05 30786
22 A simple IVR and Queue example where customer listens to marketing materials .. admin 2015.05.05 21527
21 Asterisk A simple IVR admin 2015.05.05 21608
20 Asterisk tips ivr menu Interactive voice response menus admin 2015.05.05 22513
19 Setup install Asterisk PBX telephony system | VOIP Tutorial admin 2015.05.05 21307
18 Asterisk Downloads AsteriskNOW Software PBX admin 2015.05.05 21294
17 Fax For Asterisk download add on 1 port free IVR prompt G.729 admin 2015.05.05 22014
16 T.38 Fax Gateway Asterisk admin 2015.05.05 21685
15 Setup FAX on Asterisk with DIDForSale SIP DIDs admin 2015.05.05 22052
14 FaxServer using Asterisk admin 2015.05.05 21555
13 fax licenses Asterisk admin 2015.05.05 21445
12 Configuring an Asterisk server admin 2015.05.05 21278
11 FreePBX – Custom FAX to email admin 2015.05.05 21459
10 Incoming Fax Handling admin 2015.05.05 21763
9 Using Asterisk to Detect and Redirect Fax Calls for Communications Server admin 2015.05.05 21912
8 Asterisk fax Asterisk and fax calls Fax over IP admin 2015.05.05 24106
7 Securing Your Asterisk VoIP Server with IPTables admin 2015.05.05 25097
6 A2Billing v2 Install Guide admin 2015.05.05 24887
5 Freepbx on Debian (Debian v7, Asterisk v11, Freepbx v2.11) admin 2015.05.05 23685
4 Asterisk Freepbx Install Guide (CentOS v6, Asterisk v13, Freepbx v12) admin 2015.05.05 25719
3 Asterisk Quick Start Guide admin 2015.05.05 24319
2 Installing AsteriskNOW Official Distro admin 2015.05.05 22924
1 Generic Asterisk SIP Configuration Guide admin 2015.05.05 21614