cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5023
Views
15
Helpful
11
Replies

Call forwarding status in CUCM 6

esther.tan
Level 1
Level 1

Hi Guys

I would like to find out if there is any report or way to find out if a DN has activated call forwarding or, if a certain DN is being set as call forwarding destination by another DN.

Thanks

2 Accepted Solutions

Accepted Solutions

William Bell
VIP Alumni
VIP Alumni

There is no native report in CUCM that can retrieve this information but you can use a SQL query (ether from the command line or via SQL Query Tool).  Command line example of what you seek:

admin: run sql select d.name as device, n.dnorpattern, cfd.cfadestination from device as d inner join devicenumplanmap as dmap on dmap.fkdevice = d.pkid inner join numplan as n on n.pkid=dmap.fknumplan inner join callforwarddynamic as cfd on cfd.fknumplan=n.pkid where (cfd.cfadestination != '')

If you have an interest in seeing stations that are call forwarded to voicemail AND other destinations, then the following query can be used:

admin: run sql select d.name as device,  n.dnorpattern, cfd.cfadestination from device as d inner join  devicenumplanmap as dmap on dmap.fkdevice = d.pkid inner join numplan as n on n.pkid=dmap.fknumplan inner join callforwarddynamic as cfd on cfd.fknumplan=n.pkid where ((cfd.cfadestination  != '') or (cfd.cfaVoicemailEnabled='t'))

If you are looking for a particular number like 17035551212 as the call forward destination, then the following could be used:

admin: run sql select d.name as device,  n.dnorpattern, cfd.cfadestination from device as d inner join  devicenumplanmap as dmap on dmap.fkdevice = d.pkid inner join numplan as n on n.pkid=dmap.fknumplan inner join callforwarddynamic as cfd on cfd.fknumplan=n.pkid where (cfd.cfadestination = '917035551212')

(NOTE: The above assumes that the off net access code is "9")

If you are curious about the SQL Query Toolkit I mentioned earlier, then you may find the following article interesting (part 1 of 3 part series:

http://www.netcraftsmen.net/resources/blogs/running-sql-queries-on-cucm-6x7x-using-axl-soap-toolkit-part-1.html

The SQL Query Toolkit takes a little effort to employ.  So, if messing with XML output parsing isn't your cup of tea, the queries I provided above (ran from the command line of the CUCM console) should do the trick.

HTH.

Regards,

Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

View solution in original post

Sorry for the delay in responding.  Local timezone is EST and you probably sent this follow up as my head hit the pillow.

1. When i tried to run this command on another server, it prompts "The  specified table (callforwarddynamic) is not in the database.".  Does it  mean it can't find any call forwarding?

No, this means that you have a different CUCM version on the other server.  With each version of CUCM, the database schema changes.  With 6.0, the way that call forwarding information was tracked in the databse changed and the "callforwarddynamic" table was added to the database.  Prior to 6.0, this data was tracked directly in the numplan database.  The following is a sample query that you should be able to use on databases prior to 6.x.  In this query we are looking at all patterns where the call forward destination is either long distance or international (assumes that "9" is the off net access code and the dial plan is NANP).

select n.dNorPattern as pattern,rp.name as routePartition, n.cFADestination as ForwardDestination

from NumPlan as n

where ((n.cFADestination like '91%') or (n.cFADestination like '9011%'))

5.x:  (NOTE, I haven't tested this query out on a 5.x system.  But the 5.x database schema (at least as it relates to this topic) suggests it should accept the above query. Most of my customers bypassed this version altogether so the window of time where I worked on this rev. is relatively short in comparison to 4x/6x/7x.)

2. Related to Qn 1, how do i search based on device profile? or even  just directory number?

Good question.  Which server are we talking about for these query variants?  I ask because on 6.x/7x, the query I provided in the original thread will pick up phones and device profiles.  Now, as you have noticed if a number is not assigned to a device then the query I provided won't catch it.  This is because I am doing an "inner join" to map devices to directory numbers and if there isn't a record in the foreign table then the query skips it.  To poll all directory numbers in the numplan, you can use the following query:

select n.dnorpattern, cfd.cfadestination

from Numplan as n inner join callforwarddynamic as cfd on cfd.fkNumplan=n.pkid

where (cfd.cfadestination != '')

Your "where" clause could also specify the target destination:  where (cfd.cfadestination = '917035551212')

Your "where" clause could also be used to show target destinations by class (e.g. long distance/international): where ((cfd.cfadestination like '91%') or (cfd.cfadestination like '9011%'))

Note, the examples assume that "9" is your off net access code and that the devices are using the NANP.

There are multiple variations on this theme and aside from the schema change that occurred with 6.0, the query structures are similar between pre- and post- 6.x systems.

On the system you are having trouble with try the query I provided in response to question #1.  If that doesn't work, then please let me know which versions of CUCM you are trying this on.

HTH.

Regards,
Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

View solution in original post

11 Replies 11

William Bell
VIP Alumni
VIP Alumni

There is no native report in CUCM that can retrieve this information but you can use a SQL query (ether from the command line or via SQL Query Tool).  Command line example of what you seek:

admin: run sql select d.name as device, n.dnorpattern, cfd.cfadestination from device as d inner join devicenumplanmap as dmap on dmap.fkdevice = d.pkid inner join numplan as n on n.pkid=dmap.fknumplan inner join callforwarddynamic as cfd on cfd.fknumplan=n.pkid where (cfd.cfadestination != '')

If you have an interest in seeing stations that are call forwarded to voicemail AND other destinations, then the following query can be used:

admin: run sql select d.name as device,  n.dnorpattern, cfd.cfadestination from device as d inner join  devicenumplanmap as dmap on dmap.fkdevice = d.pkid inner join numplan as n on n.pkid=dmap.fknumplan inner join callforwarddynamic as cfd on cfd.fknumplan=n.pkid where ((cfd.cfadestination  != '') or (cfd.cfaVoicemailEnabled='t'))

If you are looking for a particular number like 17035551212 as the call forward destination, then the following could be used:

admin: run sql select d.name as device,  n.dnorpattern, cfd.cfadestination from device as d inner join  devicenumplanmap as dmap on dmap.fkdevice = d.pkid inner join numplan as n on n.pkid=dmap.fknumplan inner join callforwarddynamic as cfd on cfd.fknumplan=n.pkid where (cfd.cfadestination = '917035551212')

(NOTE: The above assumes that the off net access code is "9")

If you are curious about the SQL Query Toolkit I mentioned earlier, then you may find the following article interesting (part 1 of 3 part series:

http://www.netcraftsmen.net/resources/blogs/running-sql-queries-on-cucm-6x7x-using-axl-soap-toolkit-part-1.html

The SQL Query Toolkit takes a little effort to employ.  So, if messing with XML output parsing isn't your cup of tea, the queries I provided above (ran from the command line of the CUCM console) should do the trick.

HTH.

Regards,

Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Thanks Bill! It works like a miracle!

Just one more question, if i were to activate a call forwarding now, how long it will takes to show up at the database?  Is it spontaneous?

Found out the answer.. it is spontaneous.

Thanks Bill!~

Excellent.  Glad I could help.


Regards,
Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Hi Bill

I have a few questions:

1. When i tried to run this command on another server, it prompts "The specified table (callforwarddynamic) is not in the database.".  Does it mean it can't find any call forwarding?

I activated call forwarding on my device profile's DN which is signed in to a physical phone.

2. Related to Qn 1, how do i search based on device profile? or even just directory number?


This is because i have some unassigned DN in callmanager but just want to make sure it is not used at any call-forward destination.  I think the command given in the above search based on device, so if the DN is not configured as a fixed number on any device, it can't be "found".

Thanks

-

Sorry for the delay in responding.  Local timezone is EST and you probably sent this follow up as my head hit the pillow.

1. When i tried to run this command on another server, it prompts "The  specified table (callforwarddynamic) is not in the database.".  Does it  mean it can't find any call forwarding?

No, this means that you have a different CUCM version on the other server.  With each version of CUCM, the database schema changes.  With 6.0, the way that call forwarding information was tracked in the databse changed and the "callforwarddynamic" table was added to the database.  Prior to 6.0, this data was tracked directly in the numplan database.  The following is a sample query that you should be able to use on databases prior to 6.x.  In this query we are looking at all patterns where the call forward destination is either long distance or international (assumes that "9" is the off net access code and the dial plan is NANP).

select n.dNorPattern as pattern,rp.name as routePartition, n.cFADestination as ForwardDestination

from NumPlan as n

where ((n.cFADestination like '91%') or (n.cFADestination like '9011%'))

5.x:  (NOTE, I haven't tested this query out on a 5.x system.  But the 5.x database schema (at least as it relates to this topic) suggests it should accept the above query. Most of my customers bypassed this version altogether so the window of time where I worked on this rev. is relatively short in comparison to 4x/6x/7x.)

2. Related to Qn 1, how do i search based on device profile? or even  just directory number?

Good question.  Which server are we talking about for these query variants?  I ask because on 6.x/7x, the query I provided in the original thread will pick up phones and device profiles.  Now, as you have noticed if a number is not assigned to a device then the query I provided won't catch it.  This is because I am doing an "inner join" to map devices to directory numbers and if there isn't a record in the foreign table then the query skips it.  To poll all directory numbers in the numplan, you can use the following query:

select n.dnorpattern, cfd.cfadestination

from Numplan as n inner join callforwarddynamic as cfd on cfd.fkNumplan=n.pkid

where (cfd.cfadestination != '')

Your "where" clause could also specify the target destination:  where (cfd.cfadestination = '917035551212')

Your "where" clause could also be used to show target destinations by class (e.g. long distance/international): where ((cfd.cfadestination like '91%') or (cfd.cfadestination like '9011%'))

Note, the examples assume that "9" is your off net access code and that the devices are using the NANP.

There are multiple variations on this theme and aside from the schema change that occurred with 6.0, the query structures are similar between pre- and post- 6.x systems.

On the system you are having trouble with try the query I provided in response to question #1.  If that doesn't work, then please let me know which versions of CUCM you are trying this on.

HTH.

Regards,
Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Hey, thanks for the clarification.  You are right. The version that I am trying on was 5.1.3 which explains the error returned.

However the actual system that I need to pull the information from is 6.1.3.

I have tried the string, on CUCM 7.0.1, that you gave which query based on directory number, and it works!

admin:run sql select n.dnorpattern, cfd.cfadestination from Numplan as n inner join callforwarddynamic as cfd on cfd.fkNumplan=n.pkid where (cfd.cfadestination != '')

So can I safely say this query string will work on 6.1.3?

Yes, it will work on 6.1.3.

HTH.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Thanks for your great help!

=)

Hi Bill
Fantastic post
How can I find the DNs with CFWD destinations, those are active and not associated with any device. or find all the DNs that has a CallForwardAll configured as voicemail or number (assigned or unassigned)
Many Thanks
Shameer
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: