login | register
Sat 04 of Jul, 2009 [14:00 UTC]

voip-info.org

Discuss [15] History

Asterisk CDR Areski GUI

Created by: jht2,Last modification on Wed 22 of Aug, 2007 [16:46 UTC] by gmalsack

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


Image

Image

Image

Image

Comments

Comments Filter
222

333Another update - Incoming/Outgoing calls

by zystemsk, Monday 22 of September, 2008 [19:02:43 UTC]
I added an option to show only incoming or outgoing calls. This is done by looking at the src (incoming caller ID) and checking to see if the length is less than or greater than 6. All 6 digit numbers, or less, can be used internally. All 7 digit numbers, and higher, can be outside calls. It's a silly way to do it, but it works for me. Alternatively, you could check to see if the src was higher than the highest extension you have in your extensions.conf/situation. In which case LENGTH() would not be used, but rather src > 300 (if all of your extensions are under 300).

http://pastebin.ca/1208529
222

333Updated call_log.php

by zystemsk, Thursday 18 of September, 2008 [16:23:43 UTC]
Here's my updated PHP file. I added coloring to the rows based on $FG_MIN_BILLING_SEC. Right now it's set to 3, so anything less than that will be colored a pinkish red to show that it's a short call. Also includes the changes below.

http://pastebin.com/f442f7c4d
222

333Any requests?

by zystemsk, Wednesday 17 of September, 2008 [14:31:03 UTC]
I have a few things I want to add to this, such as make the background color of a line red/different if the call time is 0 or under 2 seconds, etc.
222

333Filter by Answered/Not Answered calls

by zystemsk, Wednesday 17 of September, 2008 [14:28:07 UTC]
Add the following to call_log.php:
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>&nbsp;&nbsp;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.
222

333Re: Watch Call Graph Problem

by agundy, Monday 23 of July, 2007 [22:05:26 UTC]
you can make the graphs work with PHP5 by downloading the latest version of jpgraph and dropping the source files in the jpgraph_lib directory. alternatively, downgrade to PHP4...


222

333Call Monitor add-on

by splante, Tuesday 06 of March, 2007 [05:26:41 UTC]
Thanks for a great utility. We use it bundled with FreePBX and TrixBox. We needed to be able to listen to the recording of the call, if it was available. We created a patch that allows this, in conjunction with the ARI package by Little John Consulting (also included with TrixBox). If you have a need for this, you can download it from our website. Perhaps it could get added into the main code base at some time.
<p>
<a href="http://insightsys.com/freepbx/">http://insightsys.com/freepbx/</a>
222

333bug in call-log.php

by bkseniak, Friday 02 of March, 2007 [21:17:49 UTC]
Hi
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)";
222

333Watch Call Graph Problem

by wperris, Wednesday 21 of June, 2006 [15:38:09 UTC]
There seems to be a problem with watch call graph with PHP5/Postgres SQL.

WP
222

333Incoming Calls Only?

by bmct4444, Thursday 04 of May, 2006 [13:26:11 UTC]
Is there a way to get the stat package to show graphs, etc of incoming calls only? I've tried every way, can't seem to figure it out.....
222

333Bug in time counting

by mindaugas_kezys, Thursday 23 of February, 2006 [07:50:43 UTC]
This great app counts call time in the wrong way. Try to call to this context:

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