06-24-2008 06:03 AM - edited 03-15-2019 11:29 AM
hi,
callmanager version is 4.1
i want to find the SQL query to find the calling number, called party and the number to which the call is transfered.
06-24-2008 08:30 AM
You should be able to use this query on the CDR database to find the information. The finalCalledPartyNumber would be where the call was transferred to.
select
callingPartyNumber, originalCalledPartyNumber,
finalCalledPartyNumber
from CallDetailRecord
If you want information for a specific phone number, you would want to add a where statement that gives the phone number you are looking for.
Example:
select callingPartyNumber,
originalCalledPartyNumber,
finalCalledPartyNumber
from CallDetailRecord
where originalCalledPartyNumber = '5551234'
Please rate post if helpful
06-25-2008 03:45 AM
Hi Adam,
Thanks for your reply.
I have this query and it will return all the called numbers but here how i will find the calls which came and got transfered to the PSTN numbers.
06-25-2008 08:11 AM
If you want to find all calls that were transferred to the PSTN, you could do something like the following.
Say all of your sites extensions start with a location code 555, you could build your query like this:
select callingPartyNumber,
originalCalledPartyNumber,
finalCalledPartyNumber
from CallDetailRecord
where finalCalledPartyNumber not like '555%'
or, if you DID range for your site is 555-123-(6000-7000), you could use this:
select callingPartyNumber,
originalCalledPartyNumber,
finalCalledPartyNumber
from CallDetailRecord
where finalCalledPartyNumber not like '5551236%'
and finalCalledPartyNumber not like '5551237%'
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide