Installation Guide (CCStats Lite)

 Requirements

  • PHP >= 5.1
  • MySQL >= 5.0
  • Asterisk >= 1.2
  • Adobe Flash Player on the web browser

How to Install

These install instructions only apply to the Lite version. If you are looking for the Pro version instructions, please log into the support system with your account to find the proper articles.


Download the software:

#>cd /usr/src
#> wget http://download.asternic.net/asternic-stats-1.5.tgz

Extract files

#> tar zvxf asternic-stats-1.5.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 qstats

Create tables for the database

#> mysql -u root -p qstats < sql/qstats.sql 

Configuration

Edit /usr/src/asternic-stats/html/config.php to set authenticate information for the database:

$dbhost = ‘localhost’;
$dbname = ‘qstats’;
$dbuser = ‘root’;
$dbpass = ”;
$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.Edit /usr/src/asternic-stats/parselog/config.php with auth information for the database:

$queue_log_dir = ‘/var/log/asterisk/’;
$queue_log_file = ‘queue_log’;
$dbhost = ‘localhost’;
$dbname = ‘qstats’;
$dbuser = ‘root’;
$dbpass = ”

You will have to set the correct MySQL user and password again in this file. 


Copying Files

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

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/parselog/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

 


Did you find this article useful?