How can I get the Call Queue availability for queue members per queue which is shown in the Online Account Portal? I specifically want the Available
, Busy
and Unavailable
statuses shown in the UI under "Members Availability" per queue.
I've found a few Call Queue APIs that can list queues and queue members but they provide member availability like the UI.
Call Queue APIs:
The image below is from the article on Call Queue - User Availability and Call Handling
The above is on the right track. Once the list of queue members is available, you can query each user for his or her queue availability.
For both steps query the Get User Status API. An example is provided below.
Get User Status API:
An example request and response looks like the following:
Request:
Response:
Use the following to get the user's queue availability:
1) User Queue Setting
The user's Do Not Disturb
dndStatus
property is used for indicating whether the user is accepting or not accepting calls, including for call queues. The user can set theirdndStatus
to be one of the four following values where "Department" is another name for Call Queue:DoNotAcceptAnyCalls
DoNotAcceptDepartmentCalls
TakeAllCalls
TakeDepartmentCallsOnly
This can roughly be mapped to:
DoNotAcceptAnyCalls
orDoNotAcceptDepartmentCalls
TakeAllCalls
orTakeDepartmentCallsOnly
2) User Overall Availability
The next step is to check the
presenceStatus
property which is an enumerated string with the following values:Offline
,Busy
,Available
.Offline
maps toUnavailable
in the UI. This is an overall availability for both personal calls and queue calls.3) Queue Member Availability
To create the queue member availability, combine the two properties above like the following pseudocode.
I added an extra "Available" condition below which is strictly not needed, but useful for explanation:
This gives the user's availability for all queues they are on so this needs to be mapped to either a queue members list or the user's list of queues.
departments
propertyExample Code
Here's some Ruby wrapper code I wrote to make it easier to update the user's queue status here:
RingCentral Ruby SDK
extension_presence.rb