QUESTION CDR Call Destination MOD

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Special thanks to Jess Smith for pointing out this article...

Modify FreePBX Call Detail Reports (CDR) to show destination channel

"FreePBX's Reports module does not show the destination channel--for example, the outbound trunk, or the device that received an incoming call--by default. But you can customize the call log display without editing the module itself. The Reports module looks for a file at /etc/asterisk/call-log-table.php, and if it finds the file, uses the declarations within to redefine the column layout. I took the default and modified it to include the Destination Channel column.

Just create a new file at /etc/asterisk/call-log-table.php with the following contents:"


<?php
$FG_TABLE_COL[]=array ("Timestamp", "calldate", "12%", "center", "SORT", "19");
$FG_TABLE_COL[]=array ("Src Chan", "channel", "14%", "center", "", "30", "", "", "", "", "", "display_acronym");
$FG_TABLE_COL[]=array ("Source", "src", "10%", "center", "", "30");
$FG_TABLE_COL[]=array ("CLID", "clid", "25%", "center", "", "80",'','','','','','filter_html');
$FG_TABLE_COL[]=array ("Dest", "dst", "10%", "center", "SORT", "30");
$FG_TABLE_COL[]=array ("Dst Chan", "dstchannel", "14%", "center", "", "30", "", "", "", "", "", "display_acronym");
$FG_TABLE_COL[]=array ("Disposition", "disposition", "9%", "center", "", "30");
if ((!isset($resulttype)) || ($resulttype=="min"))
$minute_function= "display_minute";
$FG_TABLE_COL[]=array ("Duration", "duration", "6%", "center", "SORT", "30", "", "", "", "", "", "$minute_function");
$FG_TABLE_DEFAULT_ORDER = "calldate";
$FG_TABLE_DEFAULT_SENS = "DESC";

// This Variable stores the argument for the SQL query
$FG_COL_QUERY='calldate, channel, src, clid, dst, dstchannel, disposition, duration';
$FG_COL_QUERY_GRAPH='calldate, duration';

// The variable LIMITE_DISPLAY define the limit of record to display by page
$FG_LIMITE_DISPLAY=25;

// Number of column in the html table
$FG_NB_TABLE_COL=count($FG_TABLE_COL);

// The variable $FG_EDITION define if you want process to the edition of the
// database record
$FG_EDITION=true;

//This variable will store the total number of columns
$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL;
if ((isset($FG_DELETION) && $FG_DELETION) || $FG_EDITION)
$FG_TOTAL_TABLE_COL++;

//This variable define the Title of the HTML table
$FG_HTML_TABLE_TITLE=" - Call Logs - ";

//This variable define the width of the HTML table
$FG_HTML_TABLE_WIDTH="100%";
?>
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
404
Reaction score
185
Ward, does this work with older PIAF systems?

I'm running Asterisk 1.4.21.2 with FreePBX 2.5.2.3 (if its not broke...) and it doesn't seem to change the CDR screen at all. :banghead:

I even tried an amportal restart with no apparent effect.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Doesn't seem to work with FreePBX 2.5. We've got an oldie, too. :rolleyes:
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
404
Reaction score
185
Bummer. Well, I have an opportunity to upgrade over the long holiday weekend (new server arrived yesterday).

I was just going to clone the install over to the new computer, but maybe I should look at setting up a newer version.

Any suggestions? :D

EDIT: Is it possible to upgrade my current system to FreePBX 2.6 without losing whats left of my hair?
 

rxcomm

Guru
Joined
Sep 13, 2010
Messages
77
Reaction score
2
This is great - thanks! Some further info on formatting the fields is available at the link to the original article. Now I can actually figure out what those source and destination channels are!

Dave
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
404
Reaction score
185
2.5 to 2.6 is an easy upgrade using the FreePBX upgrade tool.

Eh. It was easy enough to upgrade to 1.7.5.5 Gold as a fresh install, my setup isn't that large or complicated. :biggrin5:

Imagine my pleasant surprise when I found this already integrated into the system.

You are fast. :cool:

EDIT: BTW - Is there some reason NVFax isn't included by default with Gold? Seems like you put everything else in...
 

jeffmac

Guru
Joined
Jan 16, 2008
Messages
230
Reaction score
9
Marvelous! This a a great change and so darned easy, too!

Thanks (again), Ward!!
 
Joined
Jun 29, 2009
Messages
258
Reaction score
0
Just wanted to point out that you can replace the first six lines to make this even a bit more useful:

Code:
<?php  $FG_TABLE_COL[]=array ("Timestamp", "calldate", "12%", "center", "SORT", "19");
        $FG_TABLE_COL[]=array ("Source Channel", "channel", "14%", "center", "", "32");
        $FG_TABLE_COL[]=array ("Source", "src", "10%", "center", "SORT", "30");
        $FG_TABLE_COL[]=array ("CLID", "clid", "25%", "center", "", "80",'','','','','','filter_html');
        $FG_TABLE_COL[]=array ("Dest.", "dst", "10%", "center", "SORT", "30");
        $FG_TABLE_COL[]=array ("Dest. Channel", "dstchannel", "14%", "center", "", "32");

What this changes:

  • The "display_acronym" is removed and channels are now truncated to 32 characters (changed from 30, because just a couple more characters sometimes makes a real difference in being able to distinguish between trunks, etc). To partially compensate for the increased width, the useless trailing "…" on channels is removed. This lets you actually see enough information on the source and destination channels to be genuinely useful.
  • It appears you can make any column sortable just by adding the word "SORT" in the correct place (right after the field containing "center"). So now the Source field is sortable.
This works best for people with widescreen displays.

EDIT: Also, if you want to go all out and show the Source DID for each call, a method for doing that is described here:

How to show the source DID in FreePBX call detail reports
 

Sharifah

New Member
Joined
Nov 11, 2016
Messages
1
Reaction score
0
I know this is an old post, but I created a file - call-log-table.php and put the code above but I don't see any changes in the column layout for my CDR. ANy help whatsoever will be appreciated.
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top