How can I tell which trunk my call uses?

I obviously have failover trunks set up so I cant be certain that all calls are taking the cheapest route. Is there a way I can tell which trunk each call took?

I am quite happy to install a new module or other software.



You can customize the Reports page. I didn’t see documentation of it anywhere (didn’t look very hard) but found a place in the PHP code where there’s an opportunity for customization.

The Reports code looks to see if a file exists at /etc/asterisk/call-log-table.php. If so, it uses that as the reports format. Otherwise it uses a defined default.

I took that default and modified it to include the destination trunk. Put this code in /etc/asterisk/call-log-table.php and then refresh the Reports page! Now you’ll see the destination channel (trunk) as a column.

[size=8][code]<?php $FG_TABLE_COL[]=array (“Timestamp”, “calldate”, “11%”, “center”, “SORT”, “19”);
$FG_TABLE_COL[]=array (“Src Chan”, “channel”, “16%”, “center”, “”, “30”, “”, “”, “”, “”, “”, “display_acronym”);
$FG_TABLE_COL[]=array (“Source”, “src”, “10%”, “center”, “”, “30”);
$FG_TABLE_COL[]=array (“CLID”, “clid”, “22%”, “center”, “”, “80”,’’,’’,’’,’’,’’,‘filter_html’);
$FG_TABLE_COL[]=array (“Dest”, “dst”, “10%”, “center”, “SORT”, “30”);
$FG_TABLE_COL[]=array (“Dst Chan”, “dstchannel”, “16%”, “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";

    // 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

    // Number of column in the html table

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

    //This variable will store the total number of column

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

    //This variable define the width of the HTML table


The channel variable in the CDR has the trunk in it.

If you use the FOP flash operator panel it will show you real time. Go to to get the latest version Fop2. I paid $40 for it which allows unlimited extensions. I love it, it shows a real time view of all channels, all extensions, who’s on the phone etc. It even lets you silent monitor another persons call, start recording a call, transfer etc. Not good if you’re trying to look back at history, but I use it all the time to make sure my phone is dialing out on the right trunk.

The channel variable for an outbound call when viewed in ‘reports’ shows

Local/[email protected],2

My trunks are:

Would I have something set up wrong?



this is a good addition however what about if someone wants to “search” for results using a specific term from the destination channel. for example, a field in the search labeled Destination channel “SIP/outbound_primary”?
or maybe someone else has a solution for me to search all outbound calls ONLY within a certain date range.