Call Center Stats Lite Installation
Description
Asternic Call Center Stats Lite is on open source queue reporting solution for the Asterisk© PBX. In order to use the software you must have a working Asterisk PBX, and you should be using queues with it.
These install instructions apply to the Lite version. If you want to install the PRO version, please follow this guide instead.
Requirements
In order to correctly use the software, you must have a Linux server with MySQL, PHP and a web server with the corresponding PHP modules or hooks installed. Basically what is called a LAMP stack.
If you use the FreePBX distro or Issabel, those requirements are already met.
Security
This application will expose call activity data and does not have any kind of user authentication or authorization built in. You must protect the web access via means of HTTP Basic Auth (.htaccess) or similar if your web server is publicly accesible. For a hardened reporting solution please look at Asternic Call Center Stats PRO.
Installation
Download the software
cd /usr/src
wget http://download.asternic.net/asternic-stats-1.8.tgz
Extract files
tar zvxf asternic-stats-1.8.tgz
cd asternic-stats
Create a MySQL database
In order to create the MySQL database you must know the MySQL root password beforehand. If you do not know the password you will have to figure out, some common passwords on some distros could be just an empty string, the word ‘passw0rd’ or ‘eLaStIx.2oo7’.
mysqladmin -u root -p create qstatslite
Create database tables
mysql -u root -p qstatslite < sql/qstats.sql
Create MySQL user and GRANT permissions
mysql -u root -p -e "CREATE USER 'qstatsliteuser'@'localhost' IDENTIFIED by 'somepassword'"
mysql -u root -p -e "GRANT select,insert,update,delete ON qstatslite.* TO qstatsliteuser"
Copying Files
Once your Move the html directory to Apache DocumentRoot:
mv /usr/src/asternic-stats/html /var/www/html/queue-stats
Move the parselog directory to its new home:
mv /usr/src/asternic-stats/parselog /usr/local/parseloglite
Configuration
The software has two components, the web application itself, and the log parser. Both have a configuration file that needs to be populated with correct credentials for your particular server/installation.
Web Application
Open /var/www/html/queue-stats/config.php
with your favorite text editor to set authenticate information for the database:
$dbhost = 'localhost';
$dbname = 'qstatslite';
$dbuser = 'qstatsliteuser';
$dbpass = 'somepassword';
$manager_host = '127.0.0.1';
$manager_user = 'admin';
$manager_secret = 'admin';
$language = 'es';
You must set the correct MySQL user and password in the dbuser and dbpass variables, and you must set the correct Asterisk Manager user and secret in manager_user and manager_secret variables. You can find your manager password by looking at the /etc/asterisk/manager.conf
under the secret configuration header.
Log Parser
Open /usr/local/parseloglite/config.php
and set correct MySQL credentials ($dbuser and $dbpass):
$queue_log_dir = '/var/log/asterisk/';
$queue_log_file = 'queue_log';
$dbhost = 'localhost';
$dbname = 'qstatslite';
$dbuser = 'qstatsliteuser';
$dbpass = 'somepassword'
You will have to set the correct MySQL user and password again in this file.
Parsing Logs
Create a cron job to parse data from queue_log and populate the database:
crontab -e
And type this in your cronjob file:
0 * * * * php -q /usr/local/parseloglite/parselog.php convertlocal
You can save it by pressing “:x”
Finally, you can see the statistics and reports with your browser from http://ip.asterisk/queue-stats