Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Help to build a SQL query in CDR

I need to do a sql query that shows me calls receveid for a dial number and were transfered from another dial number in a determinate date and time.

Can anybody help me?.

1 ACCEPTED SOLUTION

Accepted Solutions
New Member

Re: Help to build a SQL query in CDR

Here's my basic "everything to and from a given number" query. This is at least a starting point for you.

SELECT DATEADD([second], dateTimeOrigination - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Called_At, callingPartyNumber AS Extension,

originalCalledPartyNumber, finalCalledPartyNumber, DATEADD([second], dateTimeConnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102))

AS TimeConnect, DATEADD([second], dateTimeDisconnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Time_Disconnect, duration,

callingPartyNumberPartition, originalCalledPartyNumberPartition

FROM CallDetailRecord

WHERE (originalCalledPartyNumber = '12345678') OR

(callingPartyNumber = '12345678')

ORDER BY dateTimeOrigination DESC

3 REPLIES
Silver

Re: Help to build a SQL query in CDR

If this call is transfered from another number you can find it by filtering on lastRedirectDn field.

--

regards,

pk

New Member

Re: Help to build a SQL query in CDR

I think it is not a good answer for my knowledge building SQL queries.

Thanks.

New Member

Re: Help to build a SQL query in CDR

Here's my basic "everything to and from a given number" query. This is at least a starting point for you.

SELECT DATEADD([second], dateTimeOrigination - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Called_At, callingPartyNumber AS Extension,

originalCalledPartyNumber, finalCalledPartyNumber, DATEADD([second], dateTimeConnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102))

AS TimeConnect, DATEADD([second], dateTimeDisconnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Time_Disconnect, duration,

callingPartyNumberPartition, originalCalledPartyNumberPartition

FROM CallDetailRecord

WHERE (originalCalledPartyNumber = '12345678') OR

(callingPartyNumber = '12345678')

ORDER BY dateTimeOrigination DESC

175
Views
2
Helpful
3
Replies