Inserting DID no. in Source Tab on CDR

Hi I would like to have on Source Tab of the CDR output the DID no. (Sip Trunk) rather than the Caller ID on Inbound Route. How can I do it?

Also on Caller ID Tab I get the no. say 5556666 like this: 5556666<5556666>. I would like to have the caller ID only once mainly when I use the CID name prefix. I don’t want to get it like name5556666<5556666> but name<5556666> as it should be…

CDR Variables

If the channel has a cdr, that cdr record has it’s own set of variables which
can be accessed just like channel variables. The following builtin variables
are available and, unless specified, read-only.

${CDR(clid)} Caller ID
${CDR(src)} Source
${CDR(dst)} Destination
${CDR(dcontext)} Destination context
${CDR(channel)} Channel name
${CDR(dstchannel)} Destination channel
${CDR(lastapp)} Last app executed
${CDR(lastdata)} Last app’s arguments
${CDR(start)} Time the call started.
${CDR(answer)} Time the call was answered.
${CDR(end)} Time the call ended.
${CDR(duration)} Duration of the call.
${CDR(billsec)} Duration of the call once it was answered.
${CDR(accountcode)} The channel’s account code (read-write).
${CDR(uniqueid)} The channel’s unique id.
${CDR(userfield)} The channels uses specified field (read-write).

In addition, you can set your own extra variables with a traditional
Set(CDR(var)=val) to anything you want.

NOTE Some CDR values (eg: duration & billsec) can’t be accessed until the call has terminated. As of 91617, those values will be calculated on-demand if requested. Until that makes it into a stable release, you can set endbeforehexten=yes in cdr.conf, and then use the “hangup” context to wrap up your call.

Like a script or a syntax and a path to a specifc file in order to have a DID no. appears at the freepbx CDR under Source Tab.

I realy don’t understand why on earth the callerID shows in both the Source and CallerID tabs. Thx.

Asterisk has it’s quirks. That and the way the FreePBX dialplan is written causes the CDR’s to be a challenge to parse.

I listed the variables to show you the raw data that is available.

You really have to write a custom context that pre-parses the CDR data and places what you need in the user field of the CDR than passes control back to from-trunk.

I have an example script that places the DID in the user field. I will try and hunt it up and post it.

I would love to see that script if you have it handy!

Thank you!