Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 10:05 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: A2Billing 1.4 Install Instructions
PostPosted: Thu Mar 19, 2009 11:37 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
As some of you may be aware, A2Billing 1.4 is shortly to be released under beta, and it would be good to get as many eyes on it as possible.

The more contribution we have, then the better the end product.

There are lots of new features, a clean up of the invoicing, commission agent/reseller functionality and database efficiency savings.

I should mention that this is in no way suitable for commercial deployment, or testing on a production PBX. There is lots of work to be done to bring it up to scratch.

Additionally, there is work progressing on documentation, and we expect the documentation to be the best it's ever been for a new release of A2Billing.

Installation Prerequisites

It is assumed that you have already installed Asterisk on a suitable machine. This tutorial does not cover that part of the installation. If you are unfamiliar with the install of Asterisk, it may be better to start with a pre-built distributiion, e.g.

PBX in a Flash - www.pbxinaflash.com, or the newest entry, http://www.fonicaprojects.com written by me.

Both are based on Centos, so these instructions are Centos biased.

Both these distributions can be installed on a VMWare image for testing if no hardware is available.

If you have handrolled your own distribution, and are familiar with 1.3.4, then the we assume that you have the necessary dependencies already installed.


Install Dependencies

Code:
yum -y install perl-DBD-Pg subversion



#get A2Billing

Code:
mkdir /var/a2billing_install
cd /var/a2billing_install
svn co --username guest --password guest http://svn.a2billing.net/svn/asterisk2billing/trunk

copy a2billing.conf in /var/a2billing_install/trunk to /etc/a2billing.conf

Edit a2billing.conf to suit your installation. e.g. change dbtype to mysql.

Install Database

Note that for Piaf and FonicaPABX, the database password is passw0rd and the location is localhost

Code:
echo "GRANT ALL PRIVILEGES ON *.* TO 'a2billinguser'@'localhost' IDENTIFIED BY 'a2billing' WITH GRANT OPTION;" | mysql -ppassw0rd
mysqladmin create mya2billing -u a2billinguser -pa2billing



Code:
cd /var/a2billing_install/trunk/DataBase/mysql-5.x
./install-db.sh


Answer the questions appropriately with reference to /etc/a2billing.conf

You should now have a database called mya2billing with over 70 tables in it.


Install the AGI and Sound Files

So that we can easily update the system when changes are made during this period of change, we are going to use links back to the location where we installed the SVN download, so that an update from the SVN will immediately reflect in your A2Billing install.

Note that Database changes will not be included using this methodology, so these will have to be done by hand.

This is not the usual way of doing it, but for testing, it works well.

Code:
ln /var/a2billing_install/trunk/AGI/a2billing.php /var/lib/asterisk/agi-bin/a2billing.php


Code:
#set ownership and permissions on AGI
chown asterisk:asterisk /var/lib/asterisk/agi-bin/a2billing.php
chmod +x /var/lib/asterisk/agi-bin/a2billing.php

#Set up sounds
cd /var/a2billing_install/trunk/addons/sounds
./install_a2b_sounds.sh

#set ownership on sounds
chown -R asterisk:asterisk /var/lib/asterisk/


Now edit /etc/asterisk/manager_custom.conf (or manager.conf for those not using a pre-rolled distribution). Add the following lines
Code:
[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


Install Web Pages

Code:
mkdir /var/www/html/a2billing

Common

Code:
ln -s /var/a2billing_install/trunk/common /var/www/html/a2billing/common



Admin pages


Code:
ln -s /var/a2billing_install/trunk/admin /var/www/html/a2billing/admin


Agent

Code:
ln -s /var/a2billing_install/trunk/agent /var/www/html/a2billing/agent


Customer

Code:
ln -s /var/a2billing_install/trunk/customer /var/www/html/a2billing/customer


Now we need to set permissions for Apache.

If you are using a pre-rolled Distro, then web group and ownership are asterisk and asterisk, if you are not using a distro, then you probably know what to set anyway.
Code:
chown -R asterisk:asterisk /var/www/html/a2billing/
chown -R asterisk:asterisk /var/a2billing_install/trunk/common
chown -R asterisk:asterisk /var/a2billing_install/trunk/admin
chown -R asterisk:asterisk /var/a2billing_install/trunk/customer
chown -R asterisk:asterisk /var/a2billing_install/trunk/agent


Cronjobs

Code:
echo "
# Automatically added for A2Billing
0 * * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_alarm.php
0 12 * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_archive_data_cront.php
0 10 21 * * php /var/a2billing_install/trunk/Cronjobs/a2billing_autorefill.php
#Batch process at 00:20 each day
20 0 * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_batch_process.php
#Bill DID usage at 00:00 each day
0 0 * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_bill_diduse.php
#Remind users of low balance every day at 06:00
0 6 * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_check_account.php
#Generate Invoices at 7am everyday
0 7 * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_invoice2_cront.php
0 7 * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_invoice_cront.php
#Check if balance below preset value, and email user if so.
1 * * * * php /var/a2billing_install/trunk/Cronjobs/a2billing_notify_account.php
#Charge subscriptions at 06:05 on the 1st of each month
0 6 1 * * php /var/a2billing_install/trunk/Cronjobs/a2billing_subscription_fee.php
#Update currencies at 01:00 each day
0 1 * * * php /var/a2billing_install/trunk/Cronjobs/currencies_update_yahoo.php
" >> /var/spool/cron/asterisk



Create Log Files

# Ensure all log files exist so we can set their permissions correctly
Code:
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/cront_a2b_check_account.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


Callback

At the moment, I have not cracked the installation of Callback on version 5.2 of Centos, so if anyone has any ideas on how to do this, or a brief howto, then please let me know.

The instructions are in /var/a2billing_install/trunk/addons/Doc

The files are in /var/a2billing_install/trunk/CallBack

Dialplan

The dialplan you put into Asterisk is the same as it was for A2Billing 1.3.4. I've not got round to writing the dialplan as yet.


Reboot

Login

http://Your-Switch/a2billing

Log into the admin pages with root and changepassword

General Setup

The general setup is similar to 1.3.4, and the order of events is approximately similar

    Set up trunk
    Set up callplan
    Setup rate plan
    add rate table to callplan
    add rates
    add customer
    test.

Guidelines

Keep an eye on the development of A2Billing 1.4 here.

http://www.asterisk2billing.org/cgi-bin ... wser/trunk

Make sure that you are running the latest version before reporting a bug by periodically running.

Code:
cd /var/a2billing_install
svn co --username guest --password guest http://svn.a2billing.net/svn/asterisk2billing/trunk
chown -R asterisk:asterisk /var/a2billing_install/trunk/common
chown -R asterisk:asterisk /var/a2billing_install/trunk/admin
chown -R asterisk:asterisk /var/a2billing_install/trunk/customer
chown -R asterisk:asterisk /var/a2billing_install/trunk/agent
chown asterisk:asterisk /var/lib/asterisk/agi-bin/a2billing.php
chmod +x /var/lib/asterisk/agi-bin/a2billing.php


Bugs can be dicussed in the 1.4 bugs section here - http://forum.asterisk2billing.org/viewforum.php?f=22
before reporting them on the bug tracker.

Bugs tracking and reporting can be done here:-
http://www.asterisk2billing.org/cgi-bin/trac.cgi/report

The instructions were written from memory and my notes, so I am not guaranteeing accuracy, any corrections, let me know.

Finally, did I mention that A2Billing should not be put into a production environment, and its probably not a good idea to install it on a production PBX.


Yours

Joe Roper


Last edited by jroper on Mon Mar 30, 2009 8:03 am, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 19, 2009 1:43 pm 
Offline
Moderator
User avatar

Joined: Tue Jun 06, 2006 12:14 pm
Posts: 685
Location: florida
Joe, wow - that's great. Now I need to find time for setting up testing.

Will you be creating a nice install script for this like you did on 1.3.4 on PIAF? (please) :D ... just makes life so easy.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 19, 2009 10:53 pm 
Offline

Joined: Wed Dec 24, 2008 3:59 am
Posts: 4
good news :o so ,reseller module very important for people


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 7:46 pm 
Offline

Joined: Sun Mar 30, 2008 5:52 pm
Posts: 138
Friends, I can not enter the a2billing 1.4, see below the image of the sql, I changed the field pwd_encoded but not resolve.Estou using the 1713 revision. thanks


Attachments:
LoginV1_4.JPG
LoginV1_4.JPG [ 14.26 KiB | Viewed 56668 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 12:32 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Upon installing (or upgrading to) v1.4 all the admin users' passwords are set to 'changepassword'.
Now you know this you may want to change it back to the default password: '410fc6268dd3332226de95e42d9efa4046c5463769d7493b85e65cfa5c26362dc2455cc23c0bc5831deb008def4ab11a9eaa9b76ba3f377da134f39ec60dd758'.

Of course, if you hadn't double posted your question I wouldn't have had to waste time answering it for a second time. :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 2:13 am 
Offline

Joined: Sun Mar 30, 2008 5:52 pm
Posts: 138
Entered in the database mysql and back to the default password'410fc6268dd3332226de95e42d9efa4046c5463769d7493b85e65cfa5c26362dc2455cc23c0bc5831deb008def4ab11a9eaa9b76ba3f377da134f39ec60dd758 '.
I try to log on (user> "root") and (password> "Changepassword") but not enter, the error: "Authentication refused, please check your user / password!" What am I doing wrong? Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 2:19 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Using a capital 'C' rather than a small one: 'changepassword'


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 27, 2009 9:14 pm 
Offline

Joined: Thu Dec 11, 2008 7:59 pm
Posts: 19
WOW.. You guys are unbelievable... I will install it and defintely let you knwo how it works..
Great work Jonathan

rookie


Top
 Profile  
 
 Post subject: Re: A2Billing 1.4 Install Instructions
PostPosted: Sun Mar 29, 2009 8:52 pm 
Offline

Joined: Sun Mar 29, 2009 3:24 pm
Posts: 6
jroper wrote:
copy a2billing.conf in /var/a2billing_install/trunk to /etc/a2billing.conf

Copy a2billing.conf to /etc/a2billing.conf or /etc/asterisk/a2billing.conf?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 29, 2009 11:13 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
The former; the location has changed since v1.3.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 6:45 am 
Offline

Joined: Sun Mar 29, 2009 3:24 pm
Posts: 6
stavros wrote:
The former; the location has changed since v1.3.

Ok, tnx

2 small fixes to install instruction (for install to TrixBox 2.6.2.2)

- before
Code:
cd /var/a2billing_install/trunk/DataBase/mysql-5.x
./install-db.sh

add
Code:
echo "GRANT ALL PRIVILEGES ON *.* TO 'a2billinguser'@'localhost' IDENTIFIED BY 'a2billing' WITH GRANT OPTION;" | mysql -ppassw0rd
mysqladmin create mya2billing -u a2billinguser -pa2billing


- after
Quote:
Install Web Pages

and before
Quote:
Common

add
Code:
mkdir /var/www/html/a2billing


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 8:06 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Thanks for that, I've updated the post.

Note that when installing on Trixbox, they advise that Trixbox is well covered by some sort of firewall, rather than connecting it directly to a public IP with no firewall in place.

Joe


Top
 Profile  
 
 Post subject: not at all
PostPosted: Sat Apr 04, 2009 8:24 pm 
Offline
User avatar

Joined: Tue Dec 04, 2007 12:05 am
Posts: 295
hi I make like you
But I get in Mysql 5.02
the error
ERROR 1064 (42000) at line 625: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `cc_card_serial_set`' at line 1

Any idea


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 16, 2009 6:51 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Here is a script to install callback, assuming you have followed the instructions above, and assuming the trunk is in the same place. Edit as required.

This appears to work for CentOS, and has been tested on FonicaPABX and PiaF.

Please check and revert back if any problems.

Joe Roper


Code:
#!/bin/sh
#   Installation script for A2Billing, Jonathan Roper.
#   Copyright (C) <2009>  <Jonathan Roper>

#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.

#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.

#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#    [email protected]
#installs the Callback Daemon

LOAD_LOC=/var/a2billing_install/trunk


yum -y install python-setuptools.noarch
yum -y install MySQL-python
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


cd $LOAD_LOC/CallBack/callback-daemon-py/
python setup.py build
python setup.py bdist_egg
easy_install dist/callback_daemon-1.0.prod_r1528-py2.4.egg
chkconfig --add a2b-callback-daemon
service a2b-callback-daemon start
chkconfig a2b-callback-daemon on


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 16, 2009 1:05 pm 
Offline

Joined: Wed Mar 15, 2006 8:46 am
Posts: 109
service a2b-callback-daemon didn't start on the boot, but it can start manually, chkconfig show it is on for level2345.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group