Zeng Yang a.k.a H o w T o

Google

Tuesday, December 20, 2005

[HOWTO] A2Billing

Note: Tested on Fedora Core 2( 2.6.5-1.358), MySQL-4.1.16, Asterisk-1.2

1.0 Download A2Billing
Be sure you have successfully installed Asterisk and MySQL before proceeding. This HOWTO will not cover the installation guide for Asterisk and MySQL.
# cd /usr/src
# mkdir a2bill
# cd a2bill
# wget http://www.areski.net/Open_A2Billing_version_Raccoon.tar.gz

Uncompress the package


# pwd
/usr/sr/a2bill/
# tar zxvf Open_A2Billing_version_Raccoon.tar.gz

2.0 Setting up A2Billing's MySQL database
Create the database for A2Billing, the database name is up to your own preference.
In this example the author will use 'a2bill'
( You might want to consider adding a mysql user, this exampleis done using the root user )

# mysql -p
enter password:
mysql> create database a2bill;
mysql> quit

If you database is not protect by password simply ignore the -p parameter. Next, dump the SQL
syntax into MySQL database.

# cd /usr/src/a2bill/
# mysql -p a2bill <>

To verify if database is AOK.

#mysql -p a2bill
password:
mysqlconsole> SELECT * FROM ui_authen;

This table ui_authen, stores the user information for the webUI users. The above command shall
return with two (2) records.

3.0 Installing php-pcntl module
php-pcntl is a php module that controls UNIX process creation, execution, signaling and
termination.This module is used to detect calls termination so asterisk will close
a2billing.php. If this module is not installed, you have have card in-use even though you have
hang up the call

The version might defer, depending on Fedora Version. For more information check
click here. Current version of php-pcntl is 4.3.10 (FC2), there will be dependency
problem if your php version differs.
Do an up2date (The command will download the latest php and assist you in dependencies issues.)
to grab the latest version of php:

# up2date php

Download and install php-pcntl

# cd /usr/src
# mkdir php-pcntl
# cd php-pcntl
# wget http://optusnet.dl.sourceforge.net/sourceforge/phprpms/php-pcntl-4.3.10-2.4.2.i386.rpm
# rpm -iUvh php-pcntl-4.3.10-2.4.2.i386.rpm


4.0 Installing A2Billing

Installing A2Billing is pretty simple, all you need to do is copy files to designated
directories. First copy the main configuration file, a2billing.conf (located at /usr/src/a2bill/)
to /etc/asterisk/.

# cd /usr/src/a2bill/
# cp a2billing.conf /etc/asterisk/.

This config, a2billing.conf, consist of several main sections:

[database]
~Mainly specifies database connection

[webUI]
~Web Interface customization

[recprocess]
~configuration for the recurring process(cront job) *i've not used it*

[agi-confX]
~Define the behaviour of AGI script (a2billing.php). This section can be customize according
to end-customer's preferences.
*Note: X is replace with numbers you can have multiple agi-conf eg: agi-conf1, agi-conf2


Next, copy the 'rate.inc' file to /etc/asterisk. The file contains the currency rates of most countries

# pwd
/usr/src/a2bill/
# cp rates.inc /etc/asterisk/.

Now, we shall copy the web interface files to httpd document root. There are types of web
user interface, one for admin the other for customers, copy both to httpd document root. httpd
document root for fedora is located at /var/www/html/ may vary depending on operating system.

Copy the admin web interface to /var/www/html/ and rename the directory to a2bill/

# pwd
/usr/src/a2bill/
# cp -rf A2Billing_UI /var/www/html/.
# mv /var/www/html/A2Billing_UI/ /var/www/html/a2bill/

Copy the customer web interface to /var/www/html/ and rename the directory to a2billcust/

# pwd
/usr/src/a2bill/
# cp -rf A2BCustomer_UI /var/www/html/
# mv /var/www/html/A2BCustomer/ /var/www/html/a2billcust/

Lastly, copy the content in A2Billing_AGI/ directory to /var/lib/asterisk/agi-bin/

# cd /usr/src/a2bill/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

Copy the required sound files to /var/lib/asterisk/sounds/

# cp sound/* /var/lib/asterisk/sounds/.
# cp sound/en/* /var/lib/asterisk/sounds/.

5.0 Configuring A2Billing


0 Comments:

Post a Comment

<< Home