Skip to content

Cisco SQL Query – Who can make long distance calls?

We restrict who gets access to make long distance calls to save money. As a result, when we designed our CUCM environment, we created separate Calling Search Spaces (CSS hereafter) for local, long distance, and international calling.

Occasionally I’ll be asked to produce a list of the people who currently have access to make long distance calls. Since we have conventionalized the LD CSS names by building (using XX_LD_CSS where XX is the building code) I was able to do this in one line:

run sql select name, dnorpattern, alertingname from numplan n, callingsearchspace c where n.fkcallingsearchspace_sharedlineappear = c.pkid and c.name like '___LD_CSS'

While underscores exist in the CSS names, the first two are used as wildcards in the query. This could also be done for a specific CSS with the following:

run sql select name,dnorpattern, alertingname from numplan n, callingsearchspace c where n.fkcallingsearchspace_sharedlineappear = c.pkid and c.name = 'XX_LD_CSS'