Resolve caller ID data into CDR Reports destination field

(Lee) #1

Hi All,
I’m new to the whole Asterisk/FreePBX/VoIP world, but I’ve built a fully working prototype system (as a replacement for our soon to be retired Siemens box). I’ve got pretty much everything working now (including reflashing our existing Openstage phones :slight_smile: but have one tiny gripe left.
In the CDR reports, I’d really like to be able to see who was being called by name in the Destination field. So, basically a caller ID lookup on the destination number for an outbound call?
I’ve put most of numbers we regularly call into the phonebook, but can’t see any way to bring this together?
Any clues?

Many thanks,

(Dave Burgess) #2

The basic CDR report is open source.

It’s a PHP script stored in the /var/www/html/admin directory tree.

If you make it do that, be sure to submit it back to the team through the issues page so they can add it to the system. Failing that, you can use the asteriskcdrdb database table and cdr table and write your own report generator. The system (asterisk) maintains a local version of the CID data that you should be able to query.

(Lorne Gaetz) #3

If you are already using CID Superfecta for CallerID on inbound calls, then this module:

populates the ‘account code’ ‘userfield’ column with Caller ID Names for outbound calls

fwconsole ma download
fwconsole ma install outcnam

module is crude and needs a bit of polish.

(Dave Burgess) #4

How’s those? There’s nothing “out of the box” that’s going to help you, but there are a thousand ways to skin this particular cat.

(Lee) #5

Well, the winning answer comes from Lorne, in the super Outbound_CNAM module.
Didn’t even need to go to the console. Downloaded it, uploaded via the web gui, installed, picked some boxes in the settings, and made an outbound call. Ran the CDR report and there was my name in the Account column! Epic!

Just one more query if I may? I noticed this in the log while making the call -

[2017-03-30 12:02:28] WARNING[10764]: func_cdr.c:395 cdr_write_callback: Using the CDR function to set ‘accountcode’ is deprecated. Please use the CHANNEL function instead.

I guess I can ignore this for now, but wondered if anyone knew how to amend the code to fix it. I’ve looked at the module but it’s beyond me…

Many thanks,

(Lorne Gaetz) #6

Locate this line in

$ext->splice($context, $exten, 'customtrunk', new ext_setvar('CDR(accountcode,r)', '${lookupcid}'),"",$spice_position);

and change to this:

$ext->splice($context, $exten, 'customtrunk', new ext_setvar('CDR(userfield,r)', '${lookupcid}'),"",$spice_position);

It shouldn’t be using the accountcode column anyway.

(Lee) #7

Hi Lorne,

I’ve patched that file (/var/www/html/admin/modules/outcnam/, checked it twice, restarted Asterisk, but it’s still giving the warning and putting the CID into the accountcode.
What obvious thing am I missing here?


(Lorne Gaetz) #8

After editing, you have to reload:

fwconsole r

(Lee) #9

Ah! Riiiight! That works! Awesome!

Many thanks for your help!


I am using latest Freepbx and contact manager as CID Loookup.
I have exactly the same issue.
Unfortunately the provided solution is not valid for latest Freepbx.
Can not find
$ext->splice($context, $exten, ‘customtrunk’, new ext_setvar(‘CDR(accountcode,r)’, ‘${lookupcid}’),"",$spice_position);
Many Thanks

(Lorne Gaetz) #11

Just install the module, no need to edit any files.


What do you mean by ‘install the module’ ?
Cdr Module is installed but cdr destination field is not showing the CIDName.
Only showing the CIDnumber.
Also Double checked that the entry exists in Contact Manager.

(Lorne Gaetz) #13

The post above links to a third party module that works in conjunction with Superfecta to apply CNAME to outbound calls.


Ahh.Ok.I missed it.
Is there a way to show the CIDName in CdrDestination Field without the need of using third party module ?