I am tasked with finding the right API to query current status of endpoints connected to CUCM. By status, I mean "in call, busy, available", etc. and not just "registered".
Based on my reading thus far, there are 2 options:
1. RisPort -> SelectCtiItem method.
2. Device State classes in JTAPI.
For the first method, I tried the following xml request but the answer came back with 0 items:
<soapenv:Header> <AstHeader xsi:type="soap:AstHeader"> <SessionId xsi:type="xsd:string">1234</SessionId> </AstHeader> </soapenv:Header> <soapenv:Body> <soap:SelectCtiItem soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <StateInfo xsi:type="xsd:string"></StateInfo> <CtiSelectionCriteria xsi:type="soap:CtiSelectionCriteria"> <MaxReturnedItems xsi:type="xsd:unsignedInt">200</MaxReturnedItems> <!-- Line/Device/Provider --> <CtiMgrClass xsi:type="soap:CtiMgrClass">Device</CtiMgrClass> <Status xsi:type="soap:CtiStatus">Any</Status> <NodeName xsi:type="xsd:string"></NodeName> <SelectAppBy xsi:type="soap:CtiSelectAppBy">AppId</SelectAppBy> </CtiSelectionCriteria> </soap:SelectCtiItem> </soapenv:Body> </soapenv:Envelope>
2. For the second method, I found this discussion thread:
This leads me to believe there is no straightforward way to find the status of endpoints from CUCM.
Can someone please point out if there is any other way to achieve this or if I am missing something in the 2 methods above.
The link provided in method 2 refers to CUCM 4.0.2 version which is more than 10 years old.
Device State API should work in any of the recent CUCM versions. You can use the jtapi test tool (Cisco JTAPI) to try it out. Let me know if you are not seeing the correct device state.
I was able to download the JTAPI test tool and launch it. However it fails to authenticate the user, even though that user has Admin rights and I am able to successfully login to the CUCM web portal with that user.
Any ideas on what permissions are needed for JTAPI to work?
You need to use the CTI enduser or application user credentials. You can use the same userid/ password that you use in your app. i highly recommend the videos on how to use the tool if you haven't yet watched them.
I needed to assigned "CTI Enabled" and "CTI Allow control of all devices" permissions and needed to move the devices from available to controlled list for the user.