Asterisk CDR Areski GUI
Asterisk-stat!
Pretty CDR Analyser, easy way to analyze your CDR records!
Asterisk-Stat is providing different reports & Graph to allow
the Asterisk-admin to analyse quickly and easily the traffic on their Asterisk server.
All the graphic & reports are based over the CDR database.
LAST RELEASE:
* V2.0 (03 March 2005)
FEATURES:
* - CDR REPORT (MONTHLY or DAILY)
* - MONTHLY TRAFFIC
* - DAILY LOAD
* - COMPARE CALL LOAD WITH PREVIOUS DAYS
* - MANY CRITERIAS TO DEFINE THE REPORT
* - EXPORT CDR REPORT TO PDF
* - EXPORT CDR REPORT TO CSV
* - SUPPORT MYSQL & POSTGRESQL
* - MANY OTHERS :)
REQUIREMENTS:
* - APACHE / HTTP SERVER
* - PHP
* - POSTGRESQL OR MYSQL
* - PHP-PGSQL OR PHP-MYSQL
* - NEED GD LIBRARY
* - JPGRAPH_LIB (included)
ADVICES:
* - IMPROVE SPEED RESULT WITH INDEX:
POSTGRESQL: CREATE INDEX calldate_ind ON cdr USING btree (calldate)
MYSQL: ALTER TABLE `cdr` ADD INDEX ( `calldate` )
* - OPTIONAL:
POSTGRESQL: CREATE INDEX dst_ind ON cdr USING btree (dst)
POSTGRESQL: CREATE INDEX accountcode_ind ON cdr USING btree (accountcode)
MYSQL: ALTER TABLE `cdr` ADD INDEX ( `dst` )
MYSQL: ALTER TABLE `cdr` ADD INDEX ( `accountcode` )
MORE INFO:
DOWNLOAD:
INSTALL:
Edit defines.php files
* WEBROOT: This is the root URL of the application.
Example: http://youdomain.com/asterisk-stat/
* FSROOT: This is the server path which contain the application.
Example: /home/users/asterisk-stat/
* HOST: This is the Database host name.
Example: localhost
* PORT: Database port.
Example: 5432
* USER: Username to access to the database.
Example: username
* PASS: Database password of the user.
Example: password
* DBNAME: Name of the Database.
Example: asteriskcdr
* DB_TYPE: Database type.
support: mysql and postgres
* DB_TABLENAME: Table of the database containing the CDR.
Example: cdrtable
* appli_list: PHP array used to associate extension to a name. This can be useful if you want to give more signification during the CDR browsing
$appli_list['4677']=array("Voicemail");
$appli_list['6544']=array("Conference-MeetMe");
Finally:
Go to http://yourdomain.com/asterisk-stat/cdr.php
or you can do a symlink from cdr.php to index.php (ln -sf cdr.php index.php) and the URL would be:
http://yourdomain.com/asterisk-stat/
Tested with:
PHP Version 4.3.1
- psql (PostgreSQL) 7.2.4
- mysql Ver 11.18 Distrib 3.23.58,
Install on Fedora
To install depedencies under Fedora Core 4 use :
yum install php-gd
yum install php-mysql
yum install jpgraph (gmalsack could not find this in the default fedora yum repo. I downloaded it from DAG Wieers)
Contact : areski ($alt) gmail ($d.ot) com
Tiny bug in export_pdf.php
If you are having problems exporting to PDF, you need to change line 5 of export_pdf.php from:
include_once(dirname(FILE) . "/lib/fpdf.php');
to:
include_once(dirname(FILE) . "/lib/fpdf.php");
See also
- Asterisk | Tips & Tricks | FAQ


Comments
333Another update - Incoming/Outgoing calls
http://pastebin.ca/1208529
333Updated call_log.php
http://pastebin.com/f442f7c4d
333Any requests?
333Filter by Answered/Not Answered calls
In the getpost_ifset() array, add 'disposition' at the end.
add the the following under getpost_ifset():
$filteranswer=''; //Global variable used to check if the user wants to filter some calls.
Add the following under the if/else block below $date_clause='';:
if ($disposition=='1') {
//Show only Answered calls.
$filteranswer = ' AND Disposition = "ANSWERED" ';
}
if ($disposition=='2') {
//Show only Not Answered calls.
$filteranswer = ' AND Disposition = "NO ANSWER" ';
}
Add the following under if ($posted==1){:
$FG_TABLE_CLAUSE .= $filteranswer; //Concatenate our disposition (Answered/Not answered) to the table clause.
add the following below the </tr> under the DURATION table:
<tr>
<td align="left" bgcolor="#000033">
<font face="verdana" size="1" color="#ffffff"><b> DISPOSITION</b></font>
</td>
<td align="left" bgcolor="#acbdee">
<table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td><INPUT TYPE="radio" NAME="disposition" value="3" <?if!isset($disposition||($disposition==3)){?>checked<?}?>><font size="2">All</font></td>
<td><INPUT TYPE="radio" NAME="disposition" value="2" <?if($disposition==2){?>checked<?}?>><font size="2">Not Answered</font></td>
<td><INPUT TYPE="radio" NAME="disposition" value="1" <?if($disposition==1){?>checked<?}?>><font size="2">Answered</font></td></tr></table>
</tr>
That should do it. Hope this looks ok.
333Re: Watch Call Graph Problem
333Call Monitor add-on
<p>
<a href="http://insightsys.com/freepbx/">http://insightsys.com/freepbx/</a>
333bug in call-log.php
I find this package a GREAT utility.
small bug: if the name of billing table is different than "cdr" then utility fails, while in one place "cdr" is hardcoded.
To fix it just change the line:
$QUERY = "SELECT substring(calldate,1,10) AS day, sum(duration) AS calltime, count(*) as nbcall FROM cdr WHERE ".$FG_TABLE_CLAUSE." GROUP BY substring(calldate,1,10)";
to
$QUERY = "SELECT substring(calldate,1,10) AS day, sum(duration) AS calltime, count(*) as nbcall FROM $FG_TABLE_NAME WHERE ".$FG_TABLE_CLAUSE." GROUP BY substring(calldate,1,10)";
333Watch Call Graph Problem
WP
333Incoming Calls Only?
333Bug in time counting
Answer
Wait(10)
Dial(somewhere)
And in Areski CDR you will see call length ~= actual call + 10s
Because this app counts not real call time between call parties, but the time between caller ant the system.
Fix:
In files:
call-comp.php
call-daily-load.php
call-last-month.php
call-log.php
In line:
$FG_COL_QUERY='calldate, channel, src, clid, lastapp, lastdata, dst, dst, disposition, duration, userfield, accountcode';
Change 'duration' to 'billsec'
Mindaugas