DID numbers not recorded in CDR?

Hello,

I am trying to find where I can record the DID number that was dialed for specific calls however when I go into the CDR database, there is no DID field so I can not determine which phone number has been called. The only way I could do this is program separate extension numbers to each DID number. I am not sure if others agree but I think it is crucial to report the DID that was dialed for reports.

Is there any way we could have this feature added in the future?

Thanks.

It should do this BUT due to the lack of actual details about how your system is configured it’s hard to tell.

If you have a T1/E1/PRI card it should do this to the accuracy that your provider is configured to give you. For our T1 it is configured to provide the last 4 digits of the number dialed and we do get that.

Since we are using a SIP only access, we have no T1 cards for the server and therefore rely on remote gateway systems. Therefore, there is no SIP URL that is recorded in the CDR database which should have been there. Here is a sample output of my CDR.

calldate clid src dst dcontext channel dstchannel lastapp lastdata duration billsec disposition amaflags accountcode uniqueid userfield
2009-02-17 12:06:09 “S:905xxxxxxx” <905xxxxxxx> 905xxxxxxx *101 ext-local SIP/x.x.x.x-b7a18d30 VoiceMail [email protected]| 162 162 ANSWERED 3 1234890369.911

My call log should register at least the ANI or SIP URI that was called. No where in the above is showing our phone number (866xxxxxxx) that the line number was dialed. We have several lines coming in and therefore need to know what lines are being used for call statistics. I have incoming routes handling the call routing so that I can program additional features to make the lines work.

Ideally, there should be a SIP URI and/or ANI field so that this information can also be stored for accounting and tracking purposes.

SIP is a ugly beast and it’s different for almost every provider. It depends on how they connect to you, if it’s a real trunk then they do it right and asterisk and FreePBX will pick it up correctly, but if they have you setup more like an extension to their system then it’s wrong and the systems can’t detect it. But it is fixable.

Please search the forum for getting the DID and/or CID from SIP. It will show you how to get the info and once you have it you can place it into the correct variables for the call so that when asterisk writes out the CDR record it has it.

I don’t have a SIP trunk so can’t provide it here, but it’s been discussed several times in the forums.

It should be a post from wiseoldowl if I remember correctly.