CDR Analyser: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
= Asterisk-Stat =
[http://www.areski.net/asterisk-stat-v2/about.php Asterisk-Stat] : CDR Analyser is a PHP WEB application allowing you to view CDR details and do custom searches.
[http://www.areski.net/asterisk-stat-v2/about.php Asterisk-Stat] : CDR Analyser is a PHP WEB application allowing you to view CDR details and do custom searches.


Let's start by installing all the prerequiste programs and tools.
Let's start by installing all the prerequiste programs and tools.


== Create SQL Indexes ==
Add indexing to some fields for the Asterisk Databse.<br>
Add indexing to some fields for the Asterisk Databse.<br>
Replace asterisk-cdr with your databse name and replace cdr with your table name.
Replace asterisk with your databse name and replace cdr with your table name.
<pre>
<pre>
mysql
mysql
Line 14: Line 16:
</pre>
</pre>


== Install httpd and php requirements ==
Install WEB services and PHP.
Install WEB services and PHP.
<pre>
<pre>
Line 22: Line 25:
</pre>
</pre>


 
== Download Asterisk-Stat ==
Download and extract Asterisk-Stat
Download and extract Asterisk-Stat
<pre>
<pre>
Line 31: Line 34:
</pre>
</pre>


== Edit the config file ==
Edit the configuration file.
Edit the configuration file.
<pre>
<pre>
Line 36: Line 40:
</pre>
</pre>


Change the first to define statements to suite
Change the define statements to suite
<pre>
<pre>
define ("WEBROOT", "http://asterisk.klaverstyn.com/stat/");
define ("WEBROOT", "http://asterisk.klaverstyn.com/stat/");
Line 56: Line 60:
define ("DB_TABLENAME", "cdr");
define ("DB_TABLENAME", "cdr");
</pre>
</pre>
== Bug Fix ==
If your table is called cdr then you do not have a problem.  If you have created a table called something different then you need to edit call-log.php on line 232 column 103 and change cdr to the name of your table.
[[Category : Asterisk]]
[[Category : Asterisk]]

Revision as of 03:19, 10 October 2008

Asterisk-Stat

Asterisk-Stat : CDR Analyser is a PHP WEB application allowing you to view CDR details and do custom searches.

Let's start by installing all the prerequiste programs and tools.

Create SQL Indexes

Add indexing to some fields for the Asterisk Databse.
Replace asterisk with your databse name and replace cdr with your table name.

mysql
use asteirsk
ALTER TABLE `cdr` ADD INDEX ( `calldate` );
ALTER TABLE `cdr` ADD INDEX ( `dst` );
ALTER TABLE `cdr` ADD INDEX ( `accountcode` );
exit

Install httpd and php requirements

Install WEB services and PHP.

yum install httpd
service httpd start
chkconfig httpd on
yum install php php-gd php-mysql

Download Asterisk-Stat

Download and extract Asterisk-Stat

cd /var/www/html
wget http://www.areski.net/asterisk-stat-v2/asterisk-stat-v2_0_1.tar.gz
tar xvzf asterisk-stat-v2_0_1.tar.gz
mv asterisk-stat-v2/ cdr/

Edit the config file

Edit the configuration file.

vi /var/www/html/cdr/lib/defines.php

Change the define statements to suite

define ("WEBROOT", "http://asterisk.klaverstyn.com/stat/");
define ("FSROOT", "/var/www/html/cdr/");

Change the databse connection details

define ("HOST", "localhost");
define ("PORT", "5432");
define ("USER", "username");
define ("PASS", "password");
define ("DBNAME", "asteirsk");
define ("DB_TYPE", "mysql"); // mysql or postgres

Change the table name if required

define ("DB_TABLENAME", "cdr");

Bug Fix

If your table is called cdr then you do not have a problem. If you have created a table called something different then you need to edit call-log.php on line 232 column 103 and change cdr to the name of your table.