How to CID lookup from Asterisk Phonebook into CDR Reports only?

I have the need to CID lookup and associate incoming numbers to saved names in Asterisk Phonebook (using CID Superfecta) but only to show up in CDR Reports under CallerID column. I don’t want (like it is now) that this CNAM ends up also on device displays attached to extensions, to which only CID should arrive, as coming from VSP.
I tried a custom context in /etc/asterisk/extensions_custom.conf :

[from-trunk-no-cidname]
exten => _X.,1,Set(CALLERID(name)="")
exten => _X.,n,Goto(from-trunk,${EXTEN},1)

Then, changed from-trunk to from-trunk-no-cidname in my trunk settings, but this doesn’t seem to work. Any help is very much appreciated.

Is the question not clear enough or there isn’t any solution to this configuration?

PBX Version: 16.0.19
PBX Distro: 12.7.8-2204-1.sng7
Asterisk Version: 16.25.3

I’m not sure I understand what you’re asking. It looks like you want the CID Name to show one way on the local extensions when they ring, and another way in the CDR reports. I can’t think of an easy way to do that, but a complicated way would be to add a hangup handler to the incoming channel that alters the CID Name after hangup.

The other possibility would be to config Superfecta to use the Trunk provided CID, and add some custom dialplan that records the associated ast phone book name in the CDR userfield column. Not quite what you’re asking, but simpler to accomplish.

You understood well. The need essentially arises from the request to hide the phonebook entries from the front desk operators. Those entries have the sole purpose of identifying the caller by name when analyzing data in CDR reports.

Currently, the Trunk provided CID is already displayed on the local extensions. What you proposed with the second possibility would be fine (custom dialplan that records the associated ast phone book name in the CDR userfield column) if you are kind enough to provide some operational help :slight_smile:

Not tested, but something like:

[from-trunk-no-cidname]
exten => _.,1,GotoIf(${DB_EXISTS(cidname/${CALLERID(num)})}?:noname)
exten => _.,n,Set(CDR(userfield)=${DB(cidname/${CALLERID(num)})})
exten => _.,n(noname),Goto(from-trunk,${EXTEN},1)
1 Like

If you don’t trust your ‘front desk operators’ consider replacing their phones with ones without displays, no ?

I’ll try to solve the “soft-way” first, testing Stewart1 custom dialplan. Then, considering phones replacement will be the last, but surely working, chance :slight_smile:

Nail varnish also cheap

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.