This is an old revision of the document!
CUCM Inventory
Requirement
Obtain details of all the Physical phones and ATA devices registered to the CUCM Cluster
References
- Cisco References
- This Sites references
Solution Steps
- Gather a list of the SEP and ATA devices configured on the cluster using the AXL API
- Using the Device name gathered via the AXL API, in batches of 1000 request via the RIS Port API details of the registered devices
- A maximum of 15 RIS requests per minute is allowed (max of 1 request every 4 seconds) - if higher a SOAP error can occur.
- The RIS Port API returns a lot of information. The typical information we would need is:
Specific Information
The Specific Information information we want to gather from the RIS API is detailed below:
| Required Field | RIS Field | Note | |
|---|---|---|---|
| Serial number | Name | This is not the actually serial number of the phone - but it is a unique ID for the Phone | |
| Model | Model ID | Note - you need a further lookup table to determine the actual model Name - this table can be found here | |
| Registered | Status | Where Status value is 'Registered' | |
| IP address | IP | This is the IP address of the phone. Note if the device is remote, this can be the IP address of the expressways - and should be ignored. |
Authentication
- Access to the AXL API (Standard TabSync User)
- The RIS port API needs Standard CCM Service Monitoring
Here are the steps to create a Access Group for a API user
- Create an Application User and assign the following Access Groups
- Standard TabSync User
- Standard CCM Service Monitoring
AXL Query
- AXL Query URL: https://my-cucm-hostname:8443/axl/
AXL Query for Hardware Devices (SEP and ATA devices)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5"> <soapenv:Header/> <soapenv:Body> <ns:executeSQLQuery sequence="?"> <sql> SELECT device.name, device.description, device.specialloadinformation, typemodel.name as model, typedeviceprotocol.name as protocol FROM device, typemodel, typeclass, typedeviceprotocol WHERE device.tkmodel = typemodel.enum AND device.tkclass = typeclass.enum AND typeclass.name = 'Phone' AND device.tkdeviceprotocol = typedeviceprotocol.enum AND (device.name like 'SEP%' OR device.name like 'ATA%') </sql> </ns:executeSQLQuery> </soapenv:Body> </soapenv:Envelope>
AXL Query for Jabber Softphones
- This query could be combined into the above query.
- Note how the SQL query WHERE filter uses 'lower' to remove case sensitivity. This is critical as the Device Name could be csfUsername or CSFusername
- Another approach would be to filter by phone type - but this approach would be easier to add to a single query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5"> <soapenv:Header/> <soapenv:Body> <ns:executeSQLQuery sequence="?"> <sql> SELECT device.name, device.description, device.specialloadinformation, typemodel.name as model, typedeviceprotocol.name as protocol FROM device, typemodel, typeclass, typedeviceprotocol WHERE device.tkmodel = typemodel.enum AND device.tkclass = typeclass.enum AND typeclass.name = 'Phone' AND device.tkdeviceprotocol = typedeviceprotocol.enum AND (lower(device.name) like 'csf%' OR lower(device.name) like 'tct%' OR lower(device.name) like 'tab%' OR lower(device.name) like 'bot%' ) </sql> </ns:executeSQLQuery> </soapenv:Body> </soapenv:Envelope>
AXL Query for Hardware and Software Phones
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5"> <soapenv:Header/> <soapenv:Body> <ns:executeSQLQuery sequence="?"> <sql> SELECT device.name, device.description, device.specialloadinformation, typemodel.name as model, typedeviceprotocol.name as protocol FROM device, typemodel, typeclass, typedeviceprotocol WHERE device.tkmodel = typemodel.enum AND device.tkclass = typeclass.enum AND typeclass.name = 'Phone' AND device.tkdeviceprotocol = typedeviceprotocol.enum AND (device.name like 'SEP%' OR device.name like 'ATA%' OR lower(device.name) like 'csf%' OR lower(device.name) like 'tct%' OR lower(device.name) like 'tab%' OR lower(device.name) like 'bot%') </sql> </ns:executeSQLQuery> </soapenv:Body> </soapenv:Envelope>
RIS Query
RIS Query URL: https://my-cucm-hostname:8443/realtimeservice2/services/RISService70
- The below examples only have two devices in the select items filter, but this in practice should be a list of up to 1000 records.
- With a 1000 records in your select filter, the response is likely to be less than 1000 devices, as some of the devices will likely NOT be registered.
Example RIS Query for SEP Devices
- Note the Max Returned Devices should be set to 1000 (the max allowed)
- The Class should be set for Phone or Any. Note if querying for ATA devices, this needs to be set to Gateway or Any
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap"> <soapenv:Header/> <soapenv:Body> <soap:selectCmDeviceExt> <soap:StateInfo></soap:StateInfo> <soap:CmSelectionCriteria> <soap:MaxReturnedDevices>1000</soap:MaxReturnedDevices> <soap:DeviceClass>Phone</soap:DeviceClass> <soap:Model>255</soap:Model> <soap:Status>Registered</soap:Status> <soap:NodeName></soap:NodeName> <soap:SelectBy>Name</soap:SelectBy> <soap:SelectItems> <soap:item><soap:Item>SEP0004F2E5BC8C</soap:Item></soap:item> <soap:item><soap:Item>SEP00059A3B7772</soap:Item></soap:item> </soap:SelectItems> <soap:Protocol>Any</soap:Protocol> <soap:DownloadStatus>Any</soap:DownloadStatus> </soap:CmSelectionCriteria> </soap:selectCmDeviceExt> </soapenv:Body> </soapenv:Envelope>
ATA Example
- The Device Class needs to be set to Gateway to return ATA devices.
- Or set the DeviceClass to Any and just rely on the Select Items filter to return the correct results
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap"> <soapenv:Header/> <soapenv:Body> <soap:selectCmDeviceExt> <soap:StateInfo></soap:StateInfo> <soap:CmSelectionCriteria> <soap:MaxReturnedDevices>1000</soap:MaxReturnedDevices> <soap:DeviceClass>Gateway</soap:DeviceClass> <soap:Model>255</soap:Model> <soap:Status>Registered</soap:Status> <soap:NodeName></soap:NodeName> <soap:SelectBy>Name</soap:SelectBy> <soap:SelectItems> <soap:item><soap:Item>ATA0C2724313A88</soap:Item></soap:item> <soap:item><soap:Item>ATA0C2724313B63</soap:Item></soap:item> </soap:SelectItems> <soap:Protocol>Any</soap:Protocol> <soap:DownloadStatus>Any</soap:DownloadStatus> </soap:CmSelectionCriteria> </soap:selectCmDeviceExt> </soapenv:Body> </soapenv:Envelope>
SQL Express Custom Inventory
AXL Query
Include Location and Device Pool
SELECT device.name, device.description, device.specialloadinformation, typemodel.name AS model, typedeviceprotocol.name AS protocol, devicepool.name AS devicepoolname, location.name AS locationname FROM device, typemodel, typeclass, typedeviceprotocol, devicepool, location WHERE device.tkmodel = typemodel.enum AND device.tkclass = typeclass.enum AND typeclass.name = 'Phone' AND device.tkdeviceprotocol = typedeviceprotocol.enum --AND (device.name like 'SEP%' OR device.name like 'ATA%') AND (device.name LIKE 'SEP64A0E7F68366') AND devicepool.pkid = device.fkdevicepool AND location.pkid = device.fklocation
