define ("WEBROOT", "http://192.168.1.100/asterisk-stat/");
define ("FSROOT", "/var/www/html/asterisk-stat/");
define ("LIBDIR", FSROOT."lib/");
define ("HOST", "localhost");
define ("PORT", "5432");
define ("USER", "THE_DB_USER");
define ("PASS", "THE_DB_PASSWORD");
define ("DBNAME", "asteriskcdrdb");
define ("DB_TYPE", "mysql"); // mysql or postgres
define ("DB_TABLENAME", "cdr");
where "THE_DB_USER" and "THE_DB_PASSWORD" are whatever you used for your CDR database config (/etc/asterisk/cdr_mysql.conf).
Note: For high traffic sites, please note that there are hints on the Asterisk-STAT home page for speeding up the database searches.
Update (18 Apr 2010): Edit /etc/asterisk/cdr.conf, comment out the entries for csv, and add the following to the end:
[mysql] usegmtime=yes ; log date/time in GMT loguniqueid=yes ; log uniqueid loguserfield=yes ; log user field
On the asterisk console, run "reload" and then "cdr mysql status". The output should look something like:
desk*CLI> cdr mysql status Connected to asterisk@192.168.2.175, port 3306 using table cdr for 2 seconds. Wrote 0 records since last restart. desk*CLI>
If it looks like the following, check the log files and the changes made to cdr.conf:
desk*CLI> cdr mysql status Not currently connected to a MySQL server. desk*CLI>
(18 Apr 2010) If you need to determine if the MySQL modules are being loaded by asterisk, log into the asterisk console and run "module show like mysql". The resulting output should look something like:
desk*CLI> module show like mysql Module Description Use Count app_addon_sql_mysql.so Simple Mysql Interface 0 cdr_addon_mysql.so MySQL CDR Backend 0 res_config_mysql.so MySQL RealTime Configuration Driver 0 3 modules loaded desk*CLI>
(18 Apr 2010) There's a bug in Asterisk-Stat's Export PDF function. On the fifth line, the function call ends with a single-quote vice a double quote, even though it was opened with a double quote. To fix this, change
"/lib/fpdf.php'
so that it looks like
"/lib/fpdf.php"