INSTALLATION
From AsterBilling, realtime billing solution for asterisk
\'\'\'1.Run the fast installation process by the scripts of installation: install.sh.\'\'\' Create the database in mysql (asterBilling should run on mysql 4.1 or later) Suppose the root directory of web as
/var/www/html/.
Create the database firstly:
mysqladmin -uyourmysqluser -pyourmysqlpasswd create astercc
\'\'\'setup “install.sh” as the executed rights(the script lies in the root directory of astercc by default):\'\'\'
cd astercc chmod +x ./install.sh
\'\'\'run the installation scripts:\'\'\'
./install.sh
\'\'\'Entering the installation wizard:\'\'\'
Please enter database information database host(default localhost): \'\'\'setup database host,localhost by default\'\'\' database port(default 3306): \'\'\'setup database port,3306 by default\'\'\' database name(default astercc): \'\'\'setup database name,astercc by default\'\'\' database user name(default root): \'\'\'setup database user name,root by default\'\'\' database user password(default null):passw0rd \'\'\'setup database user password\'\'\' database bin path(default /usr/bin): \'\'\'setup the directory of mysql,/usr/bin by default\'\'\' Please enter the Asterisk infomation: Asterisk Host(default 127.0.0.1): Setup Asterisk host, 127.0.0.1 by default Asterisk Manager API port(default 5038): \'\'\'Setup the AMI port of Asterisk,5038 by default\'\'\' AMI User name: AMI User password: Please enter main html directory for astercc Are you want to auto start astercc daemon when system startup? Must be redhat-release system \"Press \'y\' to auto start \'\'\'Setup whether loading astercc when the initial of system,input Y as Yes\'\'\' Are you want to start astercc daemon now? \"Press \'y\' to start:\" \'\'\'Setup whether the daemon will be started,input Y as YES\'\'\'
\'\'\'2.The manual installation wizard of asterBilling\'\'\'
\'\'\'1.Download the source package of asterCC from astercc.org, extract it and move to your directory of your web service\'\'\'
cd /usr/src wget http://astercc.org/download/astercc-0.1-beta.zip unzip astercc-0.1-beta.zip mv ./ astercc-0.1-beta /var/www/html/asterCC
\'\'\'It strongly recommend that the directory “scripts” should be moved to the higher-level security place,such as /opt ,and please don’t put it under the web directory(it will be shown in next steps).\'\'\'
\'\'\'2.Create a directory, and move scripts to the directory\'\'\'
In 0.1 beta version , there are serval of daemons for asterBilling in the directory “scripts”
- astercc will be applied to acquire the detail of calling message from asterisk and some information about extensions
- asterrc is a process for real-time billing in call according to the table of rate.
- astercclock will control the extensions’ right according to call charge credit limit.
In the directory “scripts”, there is some tools as follows:
- asterccd: Control some process related to asterCC to start, stop, status check(you can edit the script, and assign the process it controls)
- asterccdaemon: a “watchdog” process, which will make a real time check on all the process related to asterCC and which will restart those if it is suspended(if it will be started by asterccd, the checking process is the same as the process controlled by asterccd )
mkdir -p /opt/asterisk/scripts/astercc mv /var/www/html/asterCC/scripts/* /opt/asterisk/scripts/astercc chmod +x /opt/asterisk/scripts/astercc/*
\'\'\'3.create mysql database, and asterCC is required to run on mysql 4.1 or later\'\'\'
mysqladmin -uyourmysqluser -pyourmysqlpasswd create astercc mysql -uyourmysqluser -pyourmysqlpasswd astercrm </var/www/html/ asterCC/sql/astercc.sql
we create the database named “astercc” in this document, but you can name the database as any name you like
\'\'\'4.setup manager.conf in asterisk, with creating a user that can connect AMT for asterCRM\'\'\'
vi /etc/asterisk/manager.conf [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 ;displayconnects = yes ;According to your requirement, you can modify several rows as belows [asterccdaemon] secret = myasterccdaemon read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user deny=0.0.0.0/0.0.0.0 ;only allow local access, if you want to run asterCRM on another server ;use your asterCRM ip to replace 127.0.0.1 or add a new line permit=127.0.0.1/255.255.255.0
\'\'\'5.Setup the parameters on asrerbilling.conf.php according to your situation\'\'\'
The key point is setting a correct database connection string, and you can log into the system correctly by web pages after that.
\'\'\'6.Startup asterisk and the process you need\'\'\'
Setup the correct parameters for /opt/asterisk/scripts/astercc/astercc.conf Start test astercc Note:After “debug =1” will be set up in astercc.conf ,the screen will show the information as follows /opt/asterisk/scripts/astercc/astercc If the message shows as follows: Connecting to mysql database on 127.0.0.1: Database connection successful. Connecting to asterisk on 127.0.0.1 port 5038: Asterisk socket connection successful. Check asterisk username & secret: Success Monitor Start: …(some log message)…” Congratulations, your “astercc” has already run normally,press ctrl + c to escape the process running; If the screen shows errors, please check your configuration for database/AMT on astercc.conf. Startup daemon as follows: /opt/asterisk/scripts/astercc/astercc –d /opt/asterisk/scripts/astercc/astercctools –d or startup all the process by the command as follows: /opt/asterisk/scripts/astercc/asterccd start Configure your process of astercc with your system autostart: prompt: This action is only applied to redhat-release system. cp /opt/asterisk/scripts/astercc/asterccd /etc/rc.d/init.d chmod 755 /etc/rc.d/init.d/asterccd chkconfig --add asterccd advice: set your asrercc restart once a day,which is not necessary,But it is good to improve the performance of your astercc. crontab -e Add the row as follows: 0 0 * * * /etc/rc.d/init.d/asterccd restart to the end of the file The first “0” is applied to assign the minutes,and the second “0″ is applied to assign the hours.
\'\'\'7.Setup the correct access rights for files and directories:\'\'\'
\'\'\'After setting up the rights of the directory for file uploading (asterbilling/upload),you can import the file “csv/xls”.\'\'\'
chmod 777 /var/www/html/asterCC/asterbilling/upload
\'\'\'8.test\'\'\'
Open your browser, Input the URL as follows: http://localhost/asterCC/asterbilling Or http://YOUR-WEB-SERVER-ADDRESS/asterCC/asterbilling login system as admin/admin
