02-05-2016 06:33 AM
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.
02-05-2016 07:52 AM
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:
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>
02-10-2016 09:03 AM
I will re-phrase my question:
Cisco has more than 1 way to enforce licensing:
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
03-17-2016 03:34 PM
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) {}
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