CDR not resolve names of internal numbers in Destination on incoming and internal calls

Hello all, why CDR not show names of internal numbers? on incoming and internal calls

and in sip header none of user names

INVITE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK2888115155
From: “412-USER XXX” sip:[email protected]:5160;tag=2197917500
To: sip:[email protected]:5160

I guess you need to be a little more specific as you blacked out most of the CallerID section which would show the CallerID being used by the device internal and the the Outbound CallerID field shows what Outbound CallerID was used.

So you’ve redacted the exact information we need to see in the CDR screenshot to support your claim. That means we can’t validate anything.

I mean internal extensions nummern in column Destination. Column CallerID is fine.

The destination section doesn’t contain names, it contains the destination of the call. If that is extension 7251 then that is what will be displayed there. That is the CALLED destination, therefore it has no name.

Well, can I somehow make a name lookup in contact manager? or no chance? for example, a third-party module lookup called destination of external calls, but not internal.

Why do you need the name of the called internal destination? Here’s the thing about that, if I assign 7521 to Bob then when I look in the CDRs and see calls to 7521 I know they were to Bob. So why do you need it again?

The question was not whether I needed it or not, but why it wasn’t there and how to fix it. Statistics are also watched by people who do not need to know phone numbers and the names of their owners. Or do you propose to statistics still print a list of internal phone numbers?

It is not there because this data is not logged by default by Asterisk. As such, it’s not something that needs to be fixed, so much as a feature that you will need to add. You will need your own dialplan, probably a Hangup Handler that writes the required info to the CDR userfield.


Thank, Igaetz. Where should be added? in macro-dial-custom?

You want to use a dialplan hook for internal calls:

Here’s a recent example of setting CDR values:

We’d be happy to work with on you this if you have budget. Click the support link above.

1 Like

I solved it that way:

[macro-dialout-one-predial-hook] ; check to ensure this context doesn’t already exist before adding
exten => s,1,Set(CHANNEL(hangup_handler_push)=hangup-handler,s,1)

exten => s,1,NoOp(Lookup internal destination numbers)
exten => s,n,GotoIf($[${LEN(${DEXTEN})} = 3 ]?dnid_set) ;check length of destination number
exten => s,n,goto(end)
exten => s,n(dnid_set),Set(CIDSFSCHEME=QUxMfEFMTA==) ;name of superfecta in base64
exten => s,n,Set(temp1=${CALLERID(name)})
exten => s,n,Set(CALLERID(name)=)
exten => s,n,Set(temp2=${CALLERID(number)})
exten => s,n,Set(CALLERID(number)=${DEXTEN})
exten => s,n,AGI(/var/www/html/admin/modules/superfecta/agi/superfecta.agi)
exten => s,n,Set(CALLERID(name)=${temp1})
exten => s,n,Set(CALLERID(number)=${temp2})
exten => s,n,Set(CDR(userfield,r)=${lookupcid})
exten => s,n,Return() ;this line is required for all hangup handlers
exten => s,n(end),NoOp(!!! skipped !!!)
exten => s,n,NoOp(!!! END of internal call lookup !!!)
exten => s,n,Return() ;this line is required for all hangup handlers


Excellent effort @rpmed. It’s so gratifying to see people take a few pointers and then follow up with a working solution. You may want to fix the exten in the last line, it’s missing the s.

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