a2billing-v1.9.3-0 ok

anthonyfr

Joined
Nov 9, 2010
Messages
21
Likes
0
Points
0
#1
#!/bin/sh

DATETAG=`date +%Y%m%d%H%k%M%S`

echo "This is the Elastix A2Billing 1.9.3-0 setup/update script"
echo ""

# Step1: Removing A2billing Old files
rm -f -R /var/www/html/a2billing/
rm -f -R /var/www/html/a2customer/
rm -f -R /var/lib/asterisk/agi-bin/a2billing.php
rm -f -R /var/lib/asterisk/agi-bin/libs_a2billing/
rm -f -R /var/lib/asterisk/agi-bin/lib/
rm -f -R /etc/asterisk/additional_a2billing_iax.conf
rm -f -R /etc/asterisk/additional_a2billing_sip.conf
rm -f /etc/asterisk/a2billing.conf
rm -f /etc/a2billing.conf
rm -f -R /var/www/html/agent/
rm -f -R /var/www/html/common/
rm -f -R /usr/src/a2billing/

# Drop the old database (if it exists)
mysqladmin drop mya2billing -u root -peLaStIx.2oo7


# Step2: A2billing installation
echo " Creating work spaces.."

cd /usr/src
mkdir a2billing
cd a2billing
wget http://download.github.com/Star2Billing ... f0f.tar.gz
tar -xzf Star2Billing-a2billing-v1.9.3-0-g42cdf0f.tar.gz
chown -R root:root /usr/src/a2billing

echo " Building the new database and loading new schemas into it.."

mysql -u root -peLaStIx.2oo7 < /usr/src/a2billing/DataBase/mysql-5.x/a2billing-createdb-user.sql
mysql mya2billing -u root -peLaStIx.2oo7 < /usr/src/a2billing/DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql

mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.1-to-v1.4.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.2-to-v1.4.3.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.3-to-v1.4.4.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4-to-v1.4.4.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4.1-to-v1.4.5.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.5-to-v1.5.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.0-to-v1.5.1.sql
mysql mya2billing -u root -ppassw0rd </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.1-to-v1.6.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.1-to-v1.6.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.2-to-v1.7.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.0-to-v1.7.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.1-to-v1.7.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.2-to-v1.8.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.1-to-v1.8.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.2-to-v1.8.3.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.3-to-v1.8.4.sql
mysql mya2billing -u root -ppeLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.4-to-v1.8.5.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.5-to-v1.8.6.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.6-to-v1.9.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.9.0-to-v1.9.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.9.1-to-v1.9.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.9.2-to-v1.9.3.sql






echo " Configuring the GUIs and some config files.."

# Step3: A2billing web interfaces installation
cp -rf /usr/src/a2billing/customer /var/www/html/a2customer
chmod 777 /var/www/html/a2customer/templates_c
cp -rf /usr/src/a2billing/agent /var/www/html
chmod 777 /var/www/html/agent/templates_c
cp -rf /usr/src/a2billing/admin /var/www/html/a2billing
chmod 777 /var/www/html/a2billing/templates_c
cp -Rf /usr/src/a2billing/common /var/www/html

cp /usr/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/
cp -rf /usr/src/a2billing/common/lib /var/lib/asterisk/agi-bin/
chmod +x /var/lib/asterisk/agi-bin/a2billing.php
chown -R asterisk:asterisk /var/lib/asterisk/agi-bin

# Step4: A2billing configuration files
cp /usr/src/a2billing/a2billing.conf /etc/asterisk
chown asterisk:asterisk /etc/asterisk/a2billing.conf
ln -sf /etc/asterisk/a2billing.conf /etc/a2billing.conf

echo "Building the new a2billing.conf.."

sed -i "s/\(port *= *\)\(.*\)/\13306/" /etc/asterisk/a2billing.conf
sed -i "s/\(user *= *\)\(.*\)/\1a2billinguser/" /etc/asterisk/a2billing.conf
sed -i "s/\(password *= *\)\(.*\)/\1a2billing/" /etc/asterisk/a2billing.conf
sed -i "s/\(dbname *= *\)\(.*\)/\1mya2billing/" /etc/asterisk/a2billing.conf

echo "Building some Music On Hold mp3 directories and setting privileges.."
mkdir -p /var/lib/asterisk/mohmp3/acc_1
mkdir -p /var/lib/asterisk/mohmp3/acc_2
mkdir -p /var/lib/asterisk/mohmp3/acc_3
mkdir -p /var/lib/asterisk/mohmp3/acc_4
mkdir -p /var/lib/asterisk/mohmp3/acc_5
mkdir -p /var/lib/asterisk/mohmp3/acc_6
mkdir -p /var/lib/asterisk/mohmp3/acc_7
mkdir -p /var/lib/asterisk/mohmp3/acc_8
mkdir -p /var/lib/asterisk/mohmp3/acc_9
mkdir -p /var/lib/asterisk/mohmp3/acc_10
chmod 777 /var/lib/asterisk/mohmp3/acc_*
chown -R asterisk:asterisk /var/lib/asterisk/mohmp3/

echo "Installing extra sounds..."
# A2billing Extra sounds
cd /usr/src/a2billing/addons/sounds
./install_a2b_sounds.sh

echo "Creating additionals_a2billing files.."
# Step6: Asterisk files
cd /etc/asterisk/
touch additional_a2billing_iax.conf
touch additional_a2billing_sip.conf
touch extensions_a2billing.conf

echo "#include additional_a2billing_sip.conf" >> /etc/asterisk/sip_custom.conf
echo "#include additional_a2billing_iax.conf" >> /etc/asterisk/iax_custom.conf
echo -e >> /etc/asterisk/extensions_custom.conf
echo "#include extensions_a2billing.conf" >> /etc/asterisk/extensions_custom.conf

echo "Settings the rights ..."
# Step7: A2billing file permissions
chmod 666 /etc/asterisk/additional_a2billing_iax.conf
chmod 666 /etc/asterisk/additional_a2billing_sip.conf
chmod 666 /etc/asterisk/extensions_a2billing.conf
chown -R asterisk:asterisk /etc/asterisk/
chown -R asterisk:asterisk /var/www/html/common
chown -R asterisk:asterisk /var/www/html/a2billing
chown -R asterisk:asterisk /var/www/html/a2customer
chown -R asterisk:asterisk /var/www/html/agent
chown -R asterisk:asterisk /var/lib/asterisk/

echo"Some changes in extensions_custom.conf..please check it out later.."
echo '
[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit

[custom-freepbx-a2billing]
exten => _X.,1,DeadAGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()
' >> /etc/asterisk/extensions_custom.conf


echo " The A2Billing needed new contexts .."
#Add the A2Billing context

echo "
[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php|1)
exten => _X.,n,Hangup

[a2billing-callback]
exten => _X.,1,deadAGI(a2billing.php|1|callback)
exten => _X.,n,Hangup

[a2billing-cid-callback]
exten => _X.,1,deadAGI(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|34) ;last #parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-did]
exten => _X.,1,deadAGI(a2billing.php|1|did)
exten => _X.,2,Hangup

[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php|1|voucher)
exten => _X.,n,Hangup

[custom-a2billing-did]
exten => _X.,1,deadAGI(a2billing.php|1|did)
exten => _X.,2,Hangup

[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php|1)
exten => _X.,n,Hangup

" >> /etc/asterisk/extensions_a2billing.conf


echo " Add some custom destinations to FreePBX. Check it out later too.."
#Agrega algunos custom destinations a FreePBX
RESULT=`/usr/bin/mysql -uroot -peLaStIx.2oo7 <<SQL

use asterisk
INSERT INTO custom_destinations
(custom_dest, description, notes)
VALUES ('custom-a2billing,${EXTEN},1', 'A2Billing', '');
INSERT INTO custom_destinations
(custom_dest, description, notes)
VALUES ('custom-a2billing-did,${EXTEN},1', 'A2Billing-DID', '');
quit
SQL`


echo "
[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
" >> /etc/asterisk/manager_custom.conf



echo" Creating the Cronjobs in /var/spool/cron/asterisk"
# Cronjobs

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


echo"Creating the log files in /var/log/a2billing.."
# Create Log Files
# Log files and Permissions

mkdir -p /var/log/a2billing

touch /var/log/asterisk/a2billing-daemon-callback.log
touch /var/log/a2billing/a2billing-daemon-callback.log
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_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/api_ecommerce_request.log
touch /var/log/a2billing/api_callback_request.log
touch /var/log/a2billing/a2billing_agi.log

chown asterisk:asterisk /var/log/asterisk/a2billing-daemon-callback.log
chown -R asterisk:asterisk /var/log/a2billing


# Set up Callback
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Now installing callback"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

echo "Press any key to continue (presione cualquier tecla para continuar)"
read any



LOAD_LOC=/usr/src/a2billing

echo " Installing python tools and sqlalchemy"
yum -y install python-setuptools.noarch
yum -y install MySQL-python
easy_install sqlalchemy


cd $LOAD_LOC/CallBack/callback-daemon-py
cp callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-callback-daemon
chmod +x /etc/init.d/a2b-callback-daemon


echo "Building the callback_daemon from sources.."
cp dist/callback_daemon-1.0.prod-r1528.tar.gz /tmp
cd /tmp
tar xvfz callback_daemon-1.0.prod-r1528.tar.gz
cd callback_daemon-1.0.prod-r1528

python setup.py build
python setup.py bdist_egg
easy_install dist/callback_daemon-1.0.prod_r1528-py2.4.egg

echo "Making a bootable callback-daemon "
chkconfig --add a2b-callback-daemon
service a2b-callback-daemon start
chkconfig a2b-callback-daemon on



echo ""
echo ""
echo ""
echo ""
echo ""
echo "*******************************************************************"
echo "A2Billing is installed successfully in your Elastix PBX"
echo "-------------------------------------------------"
echo ""
echo "Please Reboot as soon as you are able to."
echo ""
echo "*******************************************************************"
echo ""
echo "The default username is root"
echo "The default password is changepassword"
echo "Enjoy it! Happy a2billing hacking! ;-) I will do!"
echo "Modified by Ivanof M.G. (tylerd) for the elastix forums. Original credits to Saleh and Johnatan Roper."
echo "..Credits for me: only copy-paste and some common sense..and some pain in the back..."
echo "*******************************************************************"


LOAD_LOC=/usr/src/a2billing

echo " Installing python tools and sqlalchemy"
yum -y install python-setuptools.noarch
yum -y install MySQL-python
easy_install sqlalchemy


cd $LOAD_LOC/CallBack/callback-daemon-py
cp callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-callback-daemon
chmod +x /etc/init.d/a2b-callback-daemon


echo "Building the callback_daemon from sources.."
cp dist/callback_daemon-1.0.prod-r1528.tar.gz /tmp
cd /tmp
tar xvfz callback_daemon-1.0.prod-r1528.tar.gz
cd callback_daemon-1.0.prod-r1528

python setup.py build
python setup.py bdist_egg
easy_install dist/callback_daemon-1.0.prod_r1528-py2.4.egg

echo "Making a bootable callback-daemon "
chkconfig --add a2b-callback-daemon
service a2b-callback-daemon start
chkconfig a2b-callback-daemon on



amportal restart


USE-REALTINE= no
qualify=yes
use_dnid=Yes
say_balance_after_auth = no
say_balance_after_call = no
say_rateinitial = no
say_timetocall = no
auto_setcallerid = no

direct
sipuser ------- call
 

chimo

Joined
Apr 24, 2010
Messages
71
Likes
0
Points
0
#2
Thank you very much,

It's great, I have been a tremendous help.
:woohoo:
 

anthonyfr

Joined
Nov 9, 2010
Messages
21
Likes
0
Points
0

anthonyfr

Joined
Nov 9, 2010
Messages
21
Likes
0
Points
0
#4
2

USE-REALTINE= no
qualify=yes
use_dnid=Yes
say_balance_after_auth = no
say_balance_after_call = no
say_rateinitial = no
say_timetocall = no
auto_setcallerid = no
 

anthonyfr

Joined
Nov 9, 2010
Messages
21
Likes
0
Points
0
#5
extensions.conf16


[a2billing]
include => a2billing_callingcard
include => a2billing_monitoring
include => a2billing_voucher
include => a2billing_echotest

[a2billing_callingcard]
; CallingCard application
exten => _XXXX.,1,Answer
exten => _XXXX.,2,Wait(2)
exten => _XXXX.,3,DeadAgi(a2billing.php)
exten => _XXXX.,4,Wait(2)
exten => _XXXX.,5,Hangup

[a2billing_monitoring]
; Monitoring IVR application
exten => 100,1,Answer
exten => 100,2,Wait(2)
exten => 100,3,DeadAgi(a2billing_monitoring.php)
exten => 100,4,Wait(2)
exten => 100,5,Hangup

[a2billing_voucher]
exten => 101,1,Answer
exten => 101,2,Wait(2)
exten => 101,3,DeadAgi(a2billing.php,1,voucher)
exten => 101,4,Wait(2)
exten => 101,5,Hangup

[a2billing_did]
; CallingCard DID application
exten => _X.,1,DeadAgi(a2billing.php,1,did)

[a2billing_echotest]
; Create an extension, 1234, for evaluating echo latency.
exten => 1234,1,Playback(demo-echotest) ; Let them know what's going on
exten => 1234,n,Echo ; Do the echo test
exten => 1234,n,Playback(demo-echodone) ; Let them know it's over
 

anthonyfr

Joined
Nov 9, 2010
Messages
21
Likes
0
Points
0
#6
/etc/a2billing.conf

;
; config file for the A2Billing Callingcard platform
;


; Global Database Setup - select the database type and authentication as required.

[database]
hostname = localhost
;port = 5432
port = 3306
user = a2billinguser
;user = root
password = a2billing
;password =
;dbname = mya2billing
dbname = mya2billing
;dbtype = postgres
dbtype = mysql



; config for the daemon process
[daemon-info]
uid =
gid =
;pidfile = /var/run/a2b-callback-daemon.pid
pidfile = ./a2b-callback-daemon.pid


; config for the logger
; article on http://www.red-dove.com/python_logging.html
[loggers]
keys=root,callbackLogger


[handlers]
keys=consoleHandler,FileHandler,RotatingFileHandler


[formatters]
keys=callbackFormatter


[logger_root]
;level=DEBUG
level=INFO
handlers=consoleHandler,RotatingFileHandler


[logger_callbackLogger]
;level=DEBUG
level=INFO
handlers=consoleHandler,RotatingFileHandler
qualname=callbackLogger
propagate=0


[handler_consoleHandler]
class=StreamHandler
;level=DEBUG
level=INFO
formatter=callbackFormatter
args=(sys.stdout,)


[handler_FileHandler]
class=FileHandler
level=DEBUG
formatter=callbackFormatter
args=('/var/log/a2b-callback-daemon.log', 'a')
filename=/var/log/a2b-callback-daemon.log
mode=a


[handler_RotatingFileHandler]
;class=handlers.RotatingFileHandler
class=handlers.TimedRotatingFileHandler
level=DEBUG
formatter=callbackFormatter
; TimedRotatingFileHandler
args=('/var/log/a2b-callback-daemon.log', 'midnight', 1)


[formatter_callbackFormatter]
format="%(asctime)s - %(name)s - %(threadName)-10s - %(levelname)s - %(message)s"
datefmt=
 

anthonyfr

Joined
Nov 9, 2010
Messages
21
Likes
0
Points
0
#7
;
; Sample configuration for res_config_mysql.c
;
; The value of dbhost may be either a hostname or an IP address.
; If dbhost is commented out or the string "localhost", a connection
; to the local host is assumed and dbsock is used instead of TCP/IP
; to connect to the server.
;
; Multiple database contexts may be configured, with the caveat that
; all context names should be unique and must not contain the slash ('/')
; character. If you wish to separate reads from writes in your database
; configuration, you specify the database (NOT HERE, in other files)
; separated by a slash, read database first. If your database
; specification does not contain a slash, the implication is that reads
; and writes should be performed to the same database.
;
; For example, in extconfig.conf, you could specify a line like:
; sippeers => mysql,readhost.asterisk/writehost.asterisk,sipfriends
; and then define the contexts [readhost.asterisk] and [writehost.asterisk]
; below.
;
; The requirements parameter is available only in Asterisk 1.6.1 and
; later and must be present in all contexts. It specifies the behavior
; when a column name is required by the system. The default behavior is
; "warn" and simply sends a warning to the logger that the column does
; not exist (or is of the wrong type or precision). The other two
; possibilities are "createclose", which adds the column with the right
; type and length, and "createchar", which adds the column as a char
; type, with the appropriate length to accept the data. Note that with
; the MySQL driver, both "createclose" and "createchar" will, on occasion,
; widen a table column width to meet the requirements specified.
;
[general]
;dbhost = 127.0.0.1
;dbname = xxxxxxxxx
;dbuser = xxxxxxxxx
;dbpass = xxxxxxxxx
;dbport = 3306
;dbsock = /tmp/mysql.sock
;requirements=warn ; or createclose or createchar


[a2billing]
dbhost = 127.0.0.1
dbname = mya2billing
dbuser = a2billinguser
dbpass = a2billing
dbport = 3306
;dbsock = /tmp/mysql.sock
;requirements=warn ; or createclose or createchar
 

anthonyfr

Joined
Nov 9, 2010
Messages
21
Likes
0
Points
0
#8
si realtime

anthonyfr said:
;
; Sample configuration for res_config_mysql.c
;
; The value of dbhost may be either a hostname or an IP address.
; If dbhost is commented out or the string "localhost", a connection
; to the local host is assumed and dbsock is used instead of TCP/IP
; to connect to the server.
;
; Multiple database contexts may be configured, with the caveat that
; all context names should be unique and must not contain the slash ('/')
; character. If you wish to separate reads from writes in your database
; configuration, you specify the database (NOT HERE, in other files)
; separated by a slash, read database first. If your database
; specification does not contain a slash, the implication is that reads
; and writes should be performed to the same database.
;
; For example, in extconfig.conf, you could specify a line like:
; sippeers => mysql,readhost.asterisk/writehost.asterisk,sipfriends
; and then define the contexts [readhost.asterisk] and [writehost.asterisk]
; below.
;
; The requirements parameter is available only in Asterisk 1.6.1 and
; later and must be present in all contexts. It specifies the behavior
; when a column name is required by the system. The default behavior is
; "warn" and simply sends a warning to the logger that the column does
; not exist (or is of the wrong type or precision). The other two
; possibilities are "createclose", which adds the column with the right
; type and length, and "createchar", which adds the column as a char
; type, with the appropriate length to accept the data. Note that with
; the MySQL driver, both "createclose" and "createchar" will, on occasion,
; widen a table column width to meet the requirements specified.
;
[general]
;dbhost = 127.0.0.1
;dbname = xxxxxxxxx
;dbuser = xxxxxxxxx
;dbpass = xxxxxxxxx
;dbport = 3306
;dbsock = /tmp/mysql.sock
;requirements=warn ; or createclose or createchar


[a2billing]
dbhost = 127.0.0.1
dbname = mya2billing
dbuser = a2billinguser
dbpass = a2billing
dbport = 3306
;dbsock = /tmp/mysql.sock
;requirements=warn ; or createclose or createchar



_______________________________________________________________________________________


;
; Static and realtime external configuration
; engine configuration
;
; Please read doc/extconfig.txt for basic table
; formatting information.
;
[settings]
;
; Static configuration files:
;
; file.conf => driver,database[,table]
;
; maps a particular configuration file to the given
; database driver, database and table (or uses the
; name of the file as the table if not specified)
;
;uncomment to load queues.conf via the odbc engine.
;
;queues.conf => odbc,asterisk,ast_config
;extensions.conf => sqlite,asterisk,ast_config
;
; The following files CANNOT be loaded from Realtime storage:
; asterisk.conf
; extconfig.conf (this file)
; logger.conf
;
; Additionally, the following files cannot be loaded from
; Realtime storage unless the storage driver is loaded
; early using 'preload' statements in modules.conf:
; manager.conf
; cdr.conf
; rtp.conf
;
;
; Realtime configuration engine
;
; maps a particular family of realtime
; configuration to a given database driver,
; database and table (or uses the name of
; the family if the table is not specified
;
;example => odbc,asterisk,alttable
;example2 => ldap,"dc=oxymium,dc=net",example2
;
; "odbc" is shown in the examples below, but is not the only valid realtime
; engine. There is:
; odbc ... res_config_odbc
; sqlite ... res_config_sqlite
; pgsql ... res_config_pgsql
;
;iaxusers => odbc,asterisk
;iaxpeers => odbc,asterisk
;sipusers => odbc,asterisk
;sippeers => odbc,asterisk
;sipregs => odbc,asterisk
;voicemail => odbc,asterisk
;extensions => odbc,asterisk
;meetme => mysql,general
;queues => odbc,asterisk
;queue_members => odbc,asterisk
;musiconhold => mysql,general
;queue_log => mysql,general
;
;
; While most dynamic realtime engines are automatically used when defined in
; this file, 'extensions', distinctively, is not. To activate dynamic realtime
; extensions, you must turn them on in each respective context within
; extensions.conf with a switch statement. The syntax is:
; switch => Realtime/[[db_context@]tablename]/<opts>
; The only option available currently is the 'p' option, which disallows
; extension pattern queries to the database. If you have no patterns defined
; in a particular context, this will save quite a bit of CPU time. However,
; note that using dynamic realtime extensions is not recommended anymore as a
; best practice; instead, you should consider writing a static dialplan with
; proper data abstraction via a tool like func_odbc.


; include a2billing realtime
sipusers => mysql,a2billing,cc_sip_buddies
sippeers => mysql,a2billing,cc_sip_buddies
iaxusers => mysql,a2billing,cc_iax_buddies
iaxpeers => mysql,a2billing,cc_iax_buddies
 

pendientes

Joined
Mar 9, 2011
Messages
25
Likes
0
Points
0
#9
He seguido todos los pasos uno a uno. Tenía instalada la versión 1.3.3 y cuando intento entrar en la página ésta me sale totalmente en blanco. ¿Alguna idea?

Gracias por la respuesta de antemano.
 

chimo

Joined
Apr 24, 2010
Messages
71
Likes
0
Points
0
#10
Prueba con esto

chown -R asterisk:asterisk /var/www/html/a2billing
chown -R asterisk:asterisk /usr/local/src/a2billing/common
chown -R asterisk:asterisk /usr/local/src/a2billing/admin
chown -R asterisk:asterisk /usr/local/src/a2billing/customer
chown -R asterisk:asterisk /usr/local/src/a2billing/agent

service httpd restart
 

serorw

Joined
Mar 13, 2011
Messages
7
Likes
0
Points
0
#11
I used this script to install/upgrade to 1.9.4. The upgrade went well but I don't have all of the admin ui. When i log into a2billing i don't get the full interface. The top menu is stacked in the center of the page, and all the items on the left just point to javascript:;

I have just installed elastix 2.0 and tried to upgrade a2billing to 1.9.4.
 

tito

Joined
Dec 18, 2010
Messages
6
Likes
0
Points
0
#12
Hola,

Lograste resolver este problema. Tengo exactamente el mismo problem y no encuentro una solucion en ningun lugar. Si por alguna razon lograste resolverlo, podrias decirme la forma de resolver este problema.

Cualquier ayuda o guia es apreciada.
tito

pendientes said:
He seguido todos los pasos uno a uno. Tenía instalada la versión 1.3.3 y cuando intento entrar en la página ésta me sale totalmente en blanco. ¿Alguna idea?

Gracias por la respuesta de antemano.
 

chimo

Joined
Apr 24, 2010
Messages
71
Likes
0
Points
0
#13
Esto parece un problema de permisos,

chown -R asterisk:asterisk /var/www/html/a2billing
chown -R asterisk:asterisk /usr/local/src/a2billing/common
chown -R asterisk:asterisk /usr/local/src/a2billing/admin
chown -R asterisk:asterisk /usr/local/src/a2billing/customer
chmod 777 /var/lib/php/session

service httpd restart


Un Saludo
 

tito

Joined
Dec 18, 2010
Messages
6
Likes
0
Points
0
#14
Hola Chimo,
Probe lo que sugieres pero nada. El problema, de la format en que yo lo veo, es que files dentro de var/www/html/a2billing/Public/index.php tienen un mapping a files en /var/www/html/common/lib and /common/javascript. Para ser mas specifico:

1-El file var/www/html/a2billing/Public/index.php tiene en su codigo un include de la siguiente manera:
index.php --> include ../lib/admin.defines.php

Esto quiere decir que cuando PHP corre la pagina, va a navegar un directorio hacia arriba en busqueda del directorio lib y dentro de este va a buscar el fine admin.defines.php. Ahora, tal directorio (lib) no existe ahi; lo que existe ahi es un file que tiene dentro el siguiente codigo:

2-/var/www/html/a2billing/lib (esto es no es un directorio sino un file)
contenido de lib(file)--> ../common/lib

Esto quiere decir que cuando PHP lea el file, realmente va a subir un nivel hacia /var/www/html/ y va a navegar hacia /var/www/html/common/lib. el cual si es un directorio y si contiene el fichero /var/www/htmml/common/lib/admin.defines.php

3-No el problema es que aunque esa es mi estructura de arbol, el web server no puede seguir esa estructure. Entonces mi pregunta es:

??Es ese file /var/www/html/a2billing/lib{../common/lib} a real file o debemos substituirlo por a logical link??????

La cosa es que cuado sustituyo el file por un logical link, las cosas aparecen y todo sigue. El problema es que yo no se si esto me va a afectar en algo el resto del programa.

?que tipo de file es este lib{../common/lib} que puede sustituir un fragmento de arbol?
?PUede PHP entender esto???

Por favor ayuda que esto esta presente en varias versiones de este mismo software a2billing????
Gracias de antemano
tito
 

tito

Joined
Dec 18, 2010
Messages
6
Likes
0
Points
0
#15
Hola,

Lograste resolver este problema. Tengo exactamente el mismo problem y no encuentro una solucion en ningun lugar. Si por alguna razon lograste resolverlo, podrias decirme la forma de resolver este problema.

Cualquier ayuda o guia es apreciada.
tito
 

chimo

Joined
Apr 24, 2010
Messages
71
Likes
0
Points
0
#16

tito

Joined
Dec 18, 2010
Messages
6
Likes
0
Points
0
#17
Hi chimo,
Gracias por mantenerte en contacto sugieriendo suluciones, etc.

Probe addicionarle al file /var/www/html/a2billing/lib(el cual es un file) la palabra "link" delante "../common/lib" de forma que ahora el file lib tiene el siguiente contexto: "link ../common/lib"

De todas formas la pagina del administrador sigue en blanco.

Revise todas las versiones del file /a2billig/admin/lib(file) en los a2billing repositories y resulta que:
-De la version ... hasta 1.8.1 todos tienen /lib with "link ../common/lib"
-de las version 1.8.2 hasta la present ninguna itne link in the /lib file. En otras palabras que el contenido del file lib es "../common/lib"

Realmente estoy completamente perdido en esto. Mi pregunta es:

Q.1 A que te refieres cuando dices que..."lo que tienes que tener dentro de /admin /customer /agent es un redireccionamiento link ../common/lib" ?

Q.2 Que quieres decir con un redireccionamiento link ../common/lib? Es acaso un logical link creado with el commando: ln -s /var/www/html/a2billing/lib /var/www/html/common/lib/

Q.3 es el file /var/lib/html/a2biling or admin/lib{../common/lib/} un file requerido o solo un indicador/ de que tenemos que hacer un redireccionamiento a traves de un comando? En otras palabras, que si el file solo explica pero no tiene funcionalidad otra que informativa y que realmente lo que tenemos que hacer es construir el redireccionamiento.

Resolver este problema es muy importante para mi, puesto que se repite en otras partes del software. Lo que si se es que cuando hago un ln -s ..... a ese lugar, el software si funciona. Pero realmente no se si esta es la forma de proceder. No se si hay que hacer redireccion

Por favor responde a mis interrogantes.
Gracias nuevamente.
francisco
 

chimo

Joined
Apr 24, 2010
Messages
71
Likes
0
Points
0
#18
Todos son redireccionados al common/lib el lib es el mismo para todos.

ln -s /var/www/html/common/lib/ /var/www/html/a2billing/lib
ln -s /var/www/html/common/lib/ /var/www/html/customer/lib
ln -s /var/www/html/common/lib/ /var/www/html/agent/lib
 

cfcnightmare

Joined
Sep 4, 2010
Messages
2
Likes
0
Points
0
#19
anthonyfr said:
#!/bin/sh

DATETAG=`date +%Y%m%d%H%k%M%S`

echo "This is the Elastix A2Billing 1.9.3-0 setup/update script"
echo ""

# Step1: Removing A2billing Old files
rm -f -R /var/www/html/a2billing/
rm -f -R /var/www/html/a2customer/
rm -f -R /var/lib/asterisk/agi-bin/a2billing.php
rm -f -R /var/lib/asterisk/agi-bin/libs_a2billing/
rm -f -R /var/lib/asterisk/agi-bin/lib/
rm -f -R /etc/asterisk/additional_a2billing_iax.conf
rm -f -R /etc/asterisk/additional_a2billing_sip.conf
rm -f /etc/asterisk/a2billing.conf
rm -f /etc/a2billing.conf
rm -f -R /var/www/html/agent/
rm -f -R /var/www/html/common/
rm -f -R /usr/src/a2billing/

# Drop the old database (if it exists)
mysqladmin drop mya2billing -u root -peLaStIx.2oo7


# Step2: A2billing installation
echo " Creating work spaces.."

cd /usr/src
mkdir a2billing
cd a2billing
wget http://download.github.com/Star2Billing ... f0f.tar.gz
tar -xzf Star2Billing-a2billing-v1.9.3-0-g42cdf0f.tar.gz
chown -R root:root /usr/src/a2billing

echo " Building the new database and loading new schemas into it.."

mysql -u root -peLaStIx.2oo7 < /usr/src/a2billing/DataBase/mysql-5.x/a2billing-createdb-user.sql
mysql mya2billing -u root -peLaStIx.2oo7 < /usr/src/a2billing/DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql

mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.1-to-v1.4.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.2-to-v1.4.3.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.3-to-v1.4.4.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4-to-v1.4.4.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4.1-to-v1.4.5.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.5-to-v1.5.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.0-to-v1.5.1.sql
mysql mya2billing -u root -ppassw0rd </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.1-to-v1.6.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.1-to-v1.6.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.2-to-v1.7.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.0-to-v1.7.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.1-to-v1.7.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.2-to-v1.8.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.1-to-v1.8.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.2-to-v1.8.3.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.3-to-v1.8.4.sql
mysql mya2billing -u root -ppeLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.4-to-v1.8.5.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.5-to-v1.8.6.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.8.6-to-v1.9.0.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.9.0-to-v1.9.1.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.9.1-to-v1.9.2.sql
mysql mya2billing -u root -peLaStIx.2oo7 </usr/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.9.2-to-v1.9.3.sql






echo " Configuring the GUIs and some config files.."

# Step3: A2billing web interfaces installation
cp -rf /usr/src/a2billing/customer /var/www/html/a2customer
chmod 777 /var/www/html/a2customer/templates_c
cp -rf /usr/src/a2billing/agent /var/www/html
chmod 777 /var/www/html/agent/templates_c
cp -rf /usr/src/a2billing/admin /var/www/html/a2billing
chmod 777 /var/www/html/a2billing/templates_c
cp -Rf /usr/src/a2billing/common /var/www/html

chown -Rf asterisk:asterisk /usr/local/src/a2billing/admin/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/customer/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/agent/templates_c

chown -Rf asterisk:asterisk /var//www/html/a2billing/admin/templates_c
chown -Rf asterisk:asterisk /var//www/html/a2billing/agent/templates_c
chown -Rf asterisk:asterisk /var//www/html/a2billing/customer/templates_c


cp /usr/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/
cp -rf /usr/src/a2billing/common/lib /var/lib/asterisk/agi-bin/
chmod +x /var/lib/asterisk/agi-bin/a2billing.php
chown -R asterisk:asterisk /var/lib/asterisk/agi-bin

# Step4: A2billing configuration files
cp /usr/src/a2billing/a2billing.conf /etc/asterisk
chown asterisk:asterisk /etc/asterisk/a2billing.conf
ln -sf /etc/asterisk/a2billing.conf /etc/a2billing.conf

echo "Building the new a2billing.conf.."

sed -i "s/\(port *= *\)\(.*\)/\13306/" /etc/asterisk/a2billing.conf
sed -i "s/\(user *= *\)\(.*\)/\1a2billinguser/" /etc/asterisk/a2billing.conf
sed -i "s/\(password *= *\)\(.*\)/\1a2billing/" /etc/asterisk/a2billing.conf
sed -i "s/\(dbname *= *\)\(.*\)/\1mya2billing/" /etc/asterisk/a2billing.conf

echo "Building some Music On Hold mp3 directories and setting privileges.."
mkdir -p /var/lib/asterisk/mohmp3/acc_1
mkdir -p /var/lib/asterisk/mohmp3/acc_2
mkdir -p /var/lib/asterisk/mohmp3/acc_3
mkdir -p /var/lib/asterisk/mohmp3/acc_4
mkdir -p /var/lib/asterisk/mohmp3/acc_5
mkdir -p /var/lib/asterisk/mohmp3/acc_6
mkdir -p /var/lib/asterisk/mohmp3/acc_7
mkdir -p /var/lib/asterisk/mohmp3/acc_8
mkdir -p /var/lib/asterisk/mohmp3/acc_9
mkdir -p /var/lib/asterisk/mohmp3/acc_10
chmod 777 /var/lib/asterisk/mohmp3/acc_*
chown -R asterisk:asterisk /var/lib/asterisk/mohmp3/

echo "Installing extra sounds..."
# A2billing Extra sounds
cd /usr/src/a2billing/addons/sounds
./install_a2b_sounds.sh

echo "Creating additionals_a2billing files.."
# Step6: Asterisk files
cd /etc/asterisk/
touch additional_a2billing_iax.conf
touch additional_a2billing_sip.conf
touch extensions_a2billing.conf

echo "#include additional_a2billing_sip.conf" >> /etc/asterisk/sip_custom.conf
echo "#include additional_a2billing_iax.conf" >> /etc/asterisk/iax_custom.conf
echo -e >> /etc/asterisk/extensions_custom.conf
echo "#include extensions_a2billing.conf" >> /etc/asterisk/extensions_custom.conf

echo "Settings the rights ..."
# Step7: A2billing file permissions
chmod 666 /etc/asterisk/additional_a2billing_iax.conf
chmod 666 /etc/asterisk/additional_a2billing_sip.conf
chmod 666 /etc/asterisk/extensions_a2billing.conf
chown -R asterisk:asterisk /etc/asterisk/
chown -R asterisk:asterisk /var/www/html/common
chown -R asterisk:asterisk /var/www/html/a2billing
chown -R asterisk:asterisk /var/www/html/a2customer
chown -R asterisk:asterisk /var/www/html/agent
chown -R asterisk:asterisk /var/lib/asterisk/

echo"Some changes in extensions_custom.conf..please check it out later.."
echo '
[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit

[custom-freepbx-a2billing]
exten => _X.,1,DeadAGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()
' >> /etc/asterisk/extensions_custom.conf


echo " The A2Billing needed new contexts .."
#Add the A2Billing context

echo "
[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php|1)
exten => _X.,n,Hangup

[a2billing-callback]
exten => _X.,1,deadAGI(a2billing.php|1|callback)
exten => _X.,n,Hangup

[a2billing-cid-callback]
exten => _X.,1,deadAGI(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|34) ;last #parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-did]
exten => _X.,1,deadAGI(a2billing.php|1|did)
exten => _X.,2,Hangup

[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php|1|voucher)
exten => _X.,n,Hangup

[custom-a2billing-did]
exten => _X.,1,deadAGI(a2billing.php|1|did)
exten => _X.,2,Hangup

[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php|1)
exten => _X.,n,Hangup

" >> /etc/asterisk/extensions_a2billing.conf


echo " Add some custom destinations to FreePBX. Check it out later too.."
#Agrega algunos custom destinations a FreePBX
RESULT=`/usr/bin/mysql -uroot -peLaStIx.2oo7 <<SQL

use asterisk
INSERT INTO custom_destinations
(custom_dest, description, notes)
VALUES ('custom-a2billing,${EXTEN},1', 'A2Billing', '');
INSERT INTO custom_destinations
(custom_dest, description, notes)
VALUES ('custom-a2billing-did,${EXTEN},1', 'A2Billing-DID', '');
quit
SQL`


echo "
[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
" >> /etc/asterisk/manager_custom.conf



echo" Creating the Cronjobs in /var/spool/cron/asterisk"
# Cronjobs
touch /var/spool/cron/a2billing

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


echo"Creating the log files in /var/log/a2billing.."
# Create Log Files
# Log files and Permissions

mkdir -p /var/log/a2billing

touch /var/log/asterisk/a2billing-daemon-callback.log
touch /var/log/a2billing/a2billing-daemon-callback.log
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_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/api_ecommerce_request.log
touch /var/log/a2billing/api_callback_request.log
touch /var/log/a2billing/a2billing_agi.log

chown asterisk:asterisk /var/log/asterisk/a2billing-daemon-callback.log
chown -R asterisk:asterisk /var/log/a2billing


# Set up Callback
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Now installing callback"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

echo "Press any key to continue (presione cualquier tecla para continuar)"
read any



LOAD_LOC=/usr/src/a2billing

echo " Installing python tools and sqlalchemy"
yum -y install python-setuptools.noarch
yum -y install MySQL-python
easy_install sqlalchemy


cd $LOAD_LOC/CallBack/callback-daemon-py
cp callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-callback-daemon
chmod +x /etc/init.d/a2b-callback-daemon


echo "Building the callback_daemon from sources.."
cp dist/callback_daemon-1.0.prod-r1528.tar.gz /tmp
cd /tmp
tar xvfz callback_daemon-1.0.prod-r1528.tar.gz
cd callback_daemon-1.0.prod-r1528

python setup.py build
python setup.py bdist_egg
easy_install dist/callback_daemon-1.0.prod_r1528-py2.4.egg

echo "Making a bootable callback-daemon "
chkconfig --add a2b-callback-daemon
service a2b-callback-daemon start
chkconfig a2b-callback-daemon on



echo ""
echo ""
echo ""
echo ""
echo ""
echo "*******************************************************************"
echo "A2Billing is installed successfully in your Elastix PBX"
echo "-------------------------------------------------"
echo ""
echo "Please Reboot as soon as you are able to."
echo ""
echo "*******************************************************************"
echo ""
echo "The default username is root"
echo "The default password is changepassword"
echo "Enjoy it! Happy a2billing hacking! ;-) I will do!"
echo "Modified by Ivanof M.G. (tylerd) for the elastix forums. Original credits to Saleh and Johnatan Roper."
echo "..Credits for me: only copy-paste and some common sense..and some pain in the back..."
echo "*******************************************************************"


LOAD_LOC=/usr/src/a2billing

echo " Installing python tools and sqlalchemy"
yum -y install python-setuptools.noarch
yum -y install MySQL-python
easy_install sqlalchemy


cd $LOAD_LOC/CallBack/callback-daemon-py
cp callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-callback-daemon
chmod +x /etc/init.d/a2b-callback-daemon


echo "Building the callback_daemon from sources.."
cp dist/callback_daemon-1.0.prod-r1528.tar.gz /tmp
cd /tmp
tar xvfz callback_daemon-1.0.prod-r1528.tar.gz
cd callback_daemon-1.0.prod-r1528

python setup.py build
python setup.py bdist_egg
easy_install dist/callback_daemon-1.0.prod_r1528-py2.4.egg

echo "Making a bootable callback-daemon "
chkconfig --add a2b-callback-daemon
service a2b-callback-daemon start
chkconfig a2b-callback-daemon on



amportal restart


USE-REALTINE= no
qualify=yes
use_dnid=Yes
say_balance_after_auth = no
say_balance_after_call = no
say_rateinitial = no
say_timetocall = no
auto_setcallerid = no

direct
sipuser ------- call


I'm corrected some lines of that script (bold text)
 

pcz

Joined
Jul 20, 2011
Messages
1
Likes
0
Points
0
#20
Hi all.

Can anybody send me the 1.9.3 of a2billing? Or tell me, where can I find it, because, I couldn't find :(.
Otherwise, can I use this script to install 1.9.4 as well?

serorw, you wrote, you installed 1.9.4, with this, but you fount a few problem! Could you solve is?

Thanks for all, who's try to help me!
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,901
Messages
130,885
Members
17,562
Latest member
colak
Top