CDR Analyser: Difference between revisions
New page: [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... |
No edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<font color=red size="6">This document is deprecated.</font> | |||
Please reference [[Asterisk_CDR_Viewer]]<br><br> | |||
= 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 | Let's start by installing all the prerequisite programs and tools. | ||
Add indexing to some fields for the Asterisk | == Create SQL Indexes == | ||
Replace asterisk | Add indexing to some fields for the Asterisk Database.<br> | ||
Replace asterisk with your database name and replace cdr with your table name. | |||
<pre> | <pre> | ||
mysql | mysql | ||
use | use asteriskcdr | ||
ALTER TABLE `cdr` ADD INDEX ( `calldate` ); | |||
ALTER TABLE `cdr` ADD INDEX ( `dst` ); | ALTER TABLE `cdr` ADD INDEX ( `dst` ); | ||
ALTER TABLE `cdr` ADD INDEX ( `accountcode` ); | ALTER TABLE `cdr` ADD INDEX ( `accountcode` ); | ||
Line 13: | Line 20: | ||
</pre> | </pre> | ||
== Install httpd and php requirements == | |||
Install WEB services and PHP. | Install WEB services and PHP. | ||
<pre> | <pre> | ||
Line 18: | Line 26: | ||
service httpd start | service httpd start | ||
chkconfig httpd on | chkconfig httpd on | ||
yum install php php-mysql | yum install php php-gd php-mysql | ||
service httpd restart | |||
</pre> | </pre> | ||
== Download Asterisk-Stat == | |||
Download and extract Asterisk-Stat | Download and extract Asterisk-Stat | ||
<pre> | <pre> | ||
Line 30: | Line 39: | ||
</pre> | </pre> | ||
== Edit the config file == | |||
Edit the configuration file. | Edit the configuration file. | ||
<pre> | <pre> | ||
Line 35: | Line 45: | ||
</pre> | </pre> | ||
Change the | === WEB Location === | ||
Change the define statements to suite | |||
<pre> | <pre> | ||
define ("WEBROOT", "http://asterisk.klaverstyn.com/ | define ("WEBROOT", "http://asterisk.klaverstyn.com/cdr/"); | ||
define ("FSROOT", "/var/www/html/cdr/"); | define ("FSROOT", "/var/www/html/cdr/"); | ||
</pre> | </pre> | ||
Change the | === Databse Details === | ||
Change the database connection details | |||
<pre> | <pre> | ||
define ("HOST", "localhost"); | define ("HOST", "localhost"); | ||
Line 47: | Line 59: | ||
define ("USER", "username"); | define ("USER", "username"); | ||
define ("PASS", "password"); | define ("PASS", "password"); | ||
define ("DBNAME", "asteirsk | define ("DBNAME", "asteirsk"); | ||
define ("DB_TYPE", "mysql"); // mysql or postgres | define ("DB_TYPE", "mysql"); // mysql or postgres | ||
</pre> | </pre> | ||
=== Table Details === | |||
Change the table name if required | Change the table name if required | ||
<pre> | <pre> | ||
define ("DB_TABLENAME", "cdr"); | define ("DB_TABLENAME", "cdr"); | ||
</pre> | </pre> | ||
== Bugs == | |||
=== Table not CDR === | |||
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]] | ||
=== Output to PDF === | |||
To be able to export to PDF you need to edit the file '''/var/www/html/cdr/export_pdf.php'''<br> | |||
Change the Line 5 from: | |||
<pre> | |||
include_once(dirname(FILE) . "/lib/fpdf.php'); | |||
</pre> | |||
to: | |||
<pre> | |||
include_once(dirname(FILE) . "/lib/fpdf.php"); | |||
</pre> |
Latest revision as of 00:36, 21 April 2020
This document is deprecated.
Please reference Asterisk_CDR_Viewer
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 prerequisite programs and tools.
Create SQL Indexes
Add indexing to some fields for the Asterisk Database.
Replace asterisk with your database name and replace cdr with your table name.
mysql use asteriskcdr 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 service httpd restart
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
WEB Location
Change the define statements to suite
define ("WEBROOT", "http://asterisk.klaverstyn.com/cdr/"); define ("FSROOT", "/var/www/html/cdr/");
Databse Details
Change the database connection details
define ("HOST", "localhost"); define ("PORT", "5432"); define ("USER", "username"); define ("PASS", "password"); define ("DBNAME", "asteirsk"); define ("DB_TYPE", "mysql"); // mysql or postgres
Table Details
Change the table name if required
define ("DB_TABLENAME", "cdr");
Bugs
Table not CDR
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.
Output to PDF
To be able to export to PDF you need to edit the file /var/www/html/cdr/export_pdf.php
Change the Line 5 from:
include_once(dirname(FILE) . "/lib/fpdf.php');
to:
include_once(dirname(FILE) . "/lib/fpdf.php");