Showing results for 
Search instead for 
Did you mean: 

Find a CUCM End User details using CLID Telephone Number presented into UCCX

Lee Marson

Hi All,

Does anyone know a way or point me in the right direction to achieve the following please:

Internal Call comes into UCCX IVR for a helpdesk and the Caller CLI is presented in E164 format

I would like to do a lookup in CUCM (or AD) using an API call from UCCX to extract the userid associated with the phone number.

Then populate end user info into fields that can be used within the script

Sounds possible to me but I am new to Developer stuff.



4 Replies 4

Cisco Employee
Cisco Employee

You would certainly want to explore the CUCM AXL API for querying/retrieving CUCM data:, if needed.

However, the initial consideration would be how is the incoming caller ID associated to the user, precisely, and in which system (CUCM/AD) is that relationship stored?  For example, it could simply be an E164 string in AD, it could be a CUCM DN associated to a phone device associated to a user, it could be a DN associated directly to a user via 'primary line' in CUCM, etc.

If the 'source of truth' is AD, I would suggest using AD APIs to query/retrieve the data.  If it's in CUCM via some line/user/field then we can further help recommend the AXL query to use...

Thanks for the swift response!

The source of truth is AD which populates the telephone Number field in CUCM via the ipPhone field in AD. I want to cross reference the telephone number and retrieve the associated userid (SAMAccountName), Firstname, Lastname and MailID.

So do you think that querying AD would be the best option via a UCCX Script?

I found some info on running an SQL Query via AXL on CUCM which might work.


Do you have any AXL Experience?
Do you have any SQL Experience?

Well it would be easy to query your CUCM and "ask" which user has the following DN.

In the CUCM User Information is the Phone Number like in the format the calling Number is presented?
If yes you could just do the following:

select userid from enduser where telephonenumber = incoming_dn

You can try this and see the result if you login to CUCM CLI and run

run sql select userid from enduser where telephonenumber = incoming_dn

The "Problem" is who and how you add the AXL part to your Scipt

Cisco Employee
Cisco Employee

Good info, though keep in mind that this query likely involves a full, unindexed table scan of the user table in the CUCM DB, and may have a bigger performance impact than you might expect - would be worth some testing.

If using Python, some samples here can help with executing a SQL query via AXL:

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:

Recognize Your Peers