Call Reporting Question - FreePBX V2.9

Is there a simple way to manipulate the call reporting data to display an extension name (descriptive name, ie: Joe’s Trucking) in the destination field, rather then display the destination field as a DID (as a 10 digit numerical value that is)?

I am using FreePBX V 2.9, and can’t seem to find information specific to this question - my apologies in advance if I have overlooked something.

Any suggestions / help would be greatly appreciated

You said you want to display an extension name in the destination field, but then say that it currently shows you a DID. If it’s an inbound call ringing to an extension, shouldn’t it show you the extension number as the destination of the call?

Just trying to understand what you’re after… getting the name of an extension (i.e. say extension 221 is “Reception”) and having that show up (“Reception”) instead of the extension number (221) is doable with some modifications of the CDR PHP script. If you’re going the other way, trying to show the CID Name of somebody that you’re calling out too, then that’s a whole different story…

Is this something NOT possible in FreePBX V2.9?

Any input would be VERY appreciated…

(ie: Please help :slight_smile:

Hi jolouis,

This would be for inbound calls being tracked on FreePBX.

Idea is this; having multiple IVR’s built, each having their own termination points entered to the system as extensions (all the pertinent information of course, DID, and descriptive name, etc) - and then being able to identify the various extensions as belonging to a specific IVR (ie: IVR1_Reception, IVR1_Sales, IVR1_Support; IVR2_Reception, IVR2_Sales, IVR2_support).

This would enable the ability to produce reporting for an entire IVR within a group of multiple IVR’s (does that make sense?)

On the reporting, it shows the phone number as the destination, and I was wondering how difficult it is to display the descriptive name instead of the DID - or in combination WITH the DID.

Like you said -
Ext 221 - Reception
Ext 225 - Sales
Ext 230 - Support

Can it be changed so that the name; ‘reception’, ‘sales’, ‘support’, etc can be displayed on the reporting rather then the DID?

In the example above you posted, this would be displaying the 221 number in the CDR & we’d rather it display “Reception” - although - we have the “extensions” created as termination points using 10-digit phone numbers of the end users…

We have yet to incorporate the internal short digit extensions into the system; so for the time being it is displaying the 10-digit DID on the CDR.

I guess - to simplify my question; I’m surprised that there isn’t simple option available to display the Extension Name, whatever is entered as the name when creating the extension (ie: “Reception”), rather then the Number (whether short number -221 - or full 10 digit number).

Overall the system works like a charm, it would just be nice to have the option of being able to select this functionality.

Just to clarify, is the CDR currently showing you the extension number that is connected when you dial from the IVR (i.e. if you have an IVR with options 1,2,3 that are 1 - Ext 221 - IVR1_Reception, 2 - Ext 222 - IVR1_Sales, etc do you see “221” show up as the destination in the CDR? Or is it showing you the actual inbound DID (i.e the full phone number that you dialed to reach the IVR).

On all of my setups it always shows the extension number (or “s” if you hit the IVR but don’t pick an option), never the DID. If, on your system it’s showing you the actual DID then you’re out of luck, as that DID could relate to anything and without completely hacking the heck out of it you’re not going to get anywhere. Youd have to try and figure out why it’s doing that and not showing the extension number…

If it’s showing you the extension numbers, then that’s a completely different story and much easier to do (easy being a relative term!)

Got it, yea that makes sense and I agree completely that it should be simple to do (or just work out of the box). I think the main reason it has not been done is that the FPBX devel team has basically given up on the existing CDR reports (as seen in 2.9, 2.10) in favour of a complete rebuild… but as far as I know the rebuild isn’t complete/finished yet. Maybe in 2.11…

In the meantime you can implement it yourself by hand, but you need to be comfortable editing the call-log.php file in order to do it. There are two or three sections where the code would have to be changed. Be aware that this would only change the presentation of the information in the CDR view; you can’t actually change the data, which means that if you do things like “search by destination”, you can’t use the names… still the extension #s.

If you want to attempt to make the changes I can post some example code, but no guarantees that it will work… it’s just what I use on our system.

I’ve passed this on to my techs who manage the system; and we are looking at another method to produce the results we are seeking - utilizing the export function to add a name column into the CSV file - but if you have any examples, sure we’d like to see them - maybe it will highlight something we haven’t thought of as of yet?

This is by no means complete, but may give your tech guys an idea of how to properly get the descriptions of extensions/feature codes/etc (basically the descriptions of anything that FPBX creates).

$active_modules = module_getinfo(false, MODULE_STATUS_ENABLED);

	foreach($active_modules as $key => $module) {
		//include module functions
		if ((!$restrict_mods || isset($restrict_mods[$key])) && is_file("modules/{$key}/")) {			


$allExts = framework_check_extension_usage(true);

//This is an associative array of all possible dsts->Labels
$extMap = array();

foreach ($allExts as $key => $value) {
	if ($active_modules[$key]['rawname'] == 'featurecodeadmin') {
	foreach ($value as $exten => $item) {
		$extMap[strval($exten)] = array(trim($item['description']));

You’ll need to make sure you’ve loaded $amp_conf the same way that the normal FPBX interface automatically does for you before executing that block of code. Once done, you will end up with $extMap, which is an associative array of all extensions to labels/names. You should then be able to update your CDR viewing/export code to simply find the name of each extension using the array.

Thank you very much for your input - I’ll consult with my techs & see if this might help point us in the right direction…

I REALLY appreciate the help…Cheers!

I have a similar issue/question with the CDR reports (ver. CSV export function. Client is using the device/user mode. When looking in the CDR on web it shows correct and actual extension number and name in the caller id field but when exporting to CSV in order to do some CDR drill down / pivot tables the field is not exported but only the sip channel (as clid and src fields).

Is there an “easy way” adding this field (extension, with display name) to the exported CSV.

Any help will be appreciated.