cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3206
Views
0
Helpful
3
Replies

Retrieve users and their devices

Anshu.Garg1
Level 1
Level 1

I am using AXL to retrieve the users and their devices from the call manager. I followed the following way:

I made a SOAP call to "listUser" API.

Then for each user in the list, I made a SOAP call to "getUser" API. This API gives me the list of associated devices for each user.

But according to some of our customers, this is not right way to get users and their devices. According to them the way is:

Make a SOAP call to "listPhone" SOAP API. The "ownerUserID" field will give the user name.

Now my question is the following?

What is the right way to retrieve the users and their associated devices. This is important for our customers as they have a "User" based licensing scheme.

3 Replies 3

dstaudt
Cisco Employee
Cisco Employee

I think the listPhone approach is good, but may only work if the administrative has configured the 'Owner User ID' field for the device in the phone's config:

Screenshot from 2016-02-05 09-41-39.png

Another option for bulk retrieval, if users/phones are associated but Owner User ID is not used, is a custom SQL query, via executeSqlQuery.  E.g.:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5">

   <soapenv:Header/>

   <soapenv:Body>

      <ns:executeSQLQuery>

         <sql>select enduser.userid, device.name from enduser,device,enduserdevicemap

         where enduserdevicemap.fkenduser=enduser.pkid and enduserdevicemap.fkdevice=device.pkid</sql>

      </ns:executeSQLQuery>

   </soapenv:Body>

</soapenv:Envelope>

I will re-phrase my question:

Cisco has more than 1 way to enforce licensing:

http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/admin/10_0_1/ccmfeat/CUCM_BK_F3AC1C0F_00_cucm-features-services-guide-100/CUCM_BK_F3AC1C0F_00_cucm-features-services-guide-100_chapter_0100101.html#CUCM_RF_U75FBF1E_00

If the customer has "Device Only" licensing model, it is easy to count the devices using the AXL API.

But my question is more for those customers, who have User or User and Device type of licensing model.

In that scenario, how do we get the users and their devices?

Anshu

lior look
Level 5
Level 5

the CUCM have four ways for device association.

1. with extension mobility

2. with the owner field under the device configuration.

3. under the enduser during the Device associate button in Cucm admin page.

4. you can associate device mobility too like remote destination profile.

so first you should to ask the right question

You can try the following queries:

push the queries into the CLI of Publisher by SSH access, use the "run sql" command.

Devices and Device profiles (During EM) that have associate with enduser by userid filter

select fkdevice from enduserdevicemap where fkenduser=(select eu.pkid from enduser as eu where eu.userid like '<Insert the UserID>')

Device Mobility that have associate with enduser by userid filter

select pkid from device where fkenduser_mobility=(select eu.pkid from enduser as eu where eu.userid like '<Insert the UserID>')

All Devices that configured with Owner User ID field and have associate with enduser by userid filter

select name from device where fkenduser=(select eu.pkid from enduser as eu where eu.userid like '<Insert the UserID>')

It will show you something like this:

name

===============

SEP189C5DB68537

SEPC067AF582A37

If you still want to use AXL function, use executeSQLqueryreq, see my simple program in C#

string sqlquery = "<Insert the SQL query>";

ExecuteSQLQueryReq sqlqueryreq = new ExecuteSQLQueryReq();

sqlqueryreq.sql = sqlquery;

ExecuteSQLQueryRes res = new ExecuteSQLQueryRes();

try

{

  res = <The_APIObject_reference>.executeSQLQuery(sqlqueryreq);

   foreach (XmlNode[] node in res.@return)

  {

  do something with the res object

  }

}

catch (NullReferenceException) {}