08-11-2022 04:52 AM
08-11-2022 09:01 AM
That data is available via the Serviceability Perfmon API: https://developer.cisco.com/docs/sxml/#!perfmon-api-reference
With the API you can either retrieve a one-time snapshot of the current stats, or setup a session with multiple counters to be retrieved periodically.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:perfmonCollectCounterData>
<soap:Host>sjds-cucm14</soap:Host>
<soap:Object>Cisco Hunt Lists</soap:Object>
</soap:perfmonCollectCounterData>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:perfmonCollectCounterDataResponse xmlns:ns1="http://schemas.cisco.com/ast/soap">
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\sjds-cucm14\Cisco Hunt Lists(testRouteList)\CallsAbandoned</ns1:Name>
<ns1:Value>0</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\sjds-cucm14\Cisco Hunt Lists(testRouteList)\CallsActive</ns1:Name>
<ns1:Value>0</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\sjds-cucm14\Cisco Hunt Lists(testRouteList)\CallsBusyAttempts</ns1:Name>
<ns1:Value>0</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\sjds-cucm14\Cisco Hunt Lists(testRouteList)\CallsInProgress</ns1:Name>
<ns1:Value>0</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\sjds-cucm14\Cisco Hunt Lists(testRouteList)\CallsRingNoAnswer</ns1:Name>
<ns1:Value>0</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\sjds-cucm14\Cisco Hunt Lists(testRouteList)\HuntListInService</ns1:Name>
<ns1:Value>1</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\sjds-cucm14\Cisco Hunt Lists(testRouteList)\MembersAvailable</ns1:Name>
<ns1:Value>0</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
</ns1:perfmonCollectCounterDataResponse>
</soapenv:Body>
</soapenv:Envelope>
To monitor a specific agent phone in real time, you will need to investigate the CTI APIs:
JTAPI: https://developer.cisco.com/site/jtapi/
TAPI: https://developer.cisco.com/site/tapi/
These are powerful, but a significantly larger development undertaking that simple HTTP/XML requests...
08-15-2022 05:03 AM - edited 08-15-2022 06:33 AM
Hi,
Thank you very much, this is very helpful.
I have few more questions:
is it possible to obtain phone current status with API request?
Also what settings actual effect the members available amount? seems like its always 0
08-15-2022 10:54 AM
For any kind of real-time call status you will need to use CTI.
Though using HTTP directly to the phone, there are some XML config/stats pages that can be retrieved. Via /StreamingStatisticsX?1 You can at least guess that the device is in/out of a call, though not any other info (like the caIler Ids.). Samples for idle/in-call attached. This is part of the IP Phone Services API and requires that A) Your app knows the IP of the phone, and B) Provides Basic Auth credentials of a CUCM user who is associated to the phone.
08-16-2022 02:51 AM - edited 08-16-2022 02:52 AM
Hi,
I tried to find the required StreamingStatistics request to send in order to get XML response back in the document you linked but I couldnt find it.. Atm the response im getting is the web itself using /StreamingStatistics?n, Do you mind sharing the request you send the get the response in XML?
Also, it looks like that the only indication will be for device being in/out of a call as you said, and if the user picked up the phone or put the phone on speaker (without dialing) - it will still show as stream not ready. (which makes sense because no rtp stream established). is there any way to get that kind of indication as well?
And one last thing about the hunt, I tried in multiple ways to track logged in users inside a hunt. I did manage to send the sql query:
run sql select lg.name as LineGroup,n.dnorpattern,dhd.hlog from linegroup as lg inner join linegroupnumplanmap as lgmap on lgmap.fklinegroup=lg.pkid inner join numplan as n on lgmap.fknumplan = n.pkid inner join devicenumplanmap as dmap on dmap.fknumplan = n.pkid inner join device as d on dmap.fkdevice=d.pkid inner join devicehlogdynamic as dhd on dhd.fkdevice=d.pkid order by lg.name
but, it will return only the number and true or false state which dont change if the phone is performing a reset for example..
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