CDR to include DID dialed in CSV report

Is is possible to have the CSV export of a CDR report include the DID dialed? It’s showing up in the report, CDR Search, but not in the CSV.

ok, this is a bit of a hack, but if you’re comfortable doing this, i was able to accomplish this by doing the following ->

from the root console, using your favorite text editor and open the file /var/www/html/admin/modules/cdr/functions.inc.php

find the following lines :

function cdr_export_csv($csvdata) {
// Searching for more than 10,000 records take more than 30 seconds.
// php default timeout is 30 seconds, hard code it to 3000 seconds for now (which is WAY overkill).
// TODO: make this value a setting in Advanced Settings
set_time_limit(3000);
$fname = “cdr__” . (string) time() . $_SERVER[“SERVER_NAME”] . “.csv”;
$csv_header =“calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield”;

and change to :

function cdr_export_csv($csvdata) {
// Searching for more than 10,000 records take more than 30 seconds.
// php default timeout is 30 seconds, hard code it to 3000 seconds for now (which is WAY overkill).
// TODO: make this value a setting in Advanced Settings
set_time_limit(3000);
$fname = “cdr__” . (string) time() . $_SERVER[“SERVER_NAME”] . “.csv”;
$csv_header =“calldate,clid,src,dst,***did,***dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield”;

Note the bold italicized “did” in the last line, apparently that line controls the format of the csv file, save the file, exit, and try your query again, and you should have the did in the export now.

FreePBX team - might I suggest that you add an advanced settings field, perhaps name it “csv_format” where the end user could simply specify a string to pass to this module with the format and variables they want to export?

-Andy
Owner, Managed Datacomm
http://www.manageddatacomm.com
(817)719-8000

2 Likes