[英]How can I get a user's status as shown in the RingCentral softphone?
The RingCentral softphone application will show user status as the following. RingCentral软电话应用程序将显示以下用户状态。 How can I get this via the API? 如何通过API获取此信息?
I'm looking at the "Get User Status API" which has a presenceStatus
property with the following values Offline
, Busy
, Available
, but how do I get the full status list shown on the softphone? 我看其中有一个“获取用户状态API” presenceStatus
使用下面的值属性Offline
, Busy
, Available
,但是我如何才能在软电话显示完整的状态列表?
https://developer.ringcentral.com/api-reference#Presence-getPresenceStatus https://developer.ringcentral.com/api-reference#Presence-getPresenceStatus
Here's an example screenshot: 这是一个示例屏幕截图:
User presence is the right place to find this information and this can be done statically via the REST API and via real-time updates using the Subscription API's Push Notifications. 用户状态是找到此信息的正确位置,可以通过REST API和使用Subscription API的Push Notifications进行实时更新来静态完成此操作。
The status shown in the softphone is an combination of several different values in user presence and can be as shown below. 网络电话中显示的状态是用户在场时几个不同值的组合,可以如下所示。
The following KB article indicates how the status is determined: 以下知识库文章指示如何确定状态:
Presence - View Presence via Favorites | 在线状态-通过收藏夹查看在线状态| RingCentral Phone RingCentral电话
The status of their phone will be displayed as Available, Do Not Disturb, and Busy. 他们的电话状态将显示为“可用”,“请勿打扰”和“忙碌”。 Contacts on Invisible or Offline will be seen as Invisible. 不可见或离线上的联系人将被视为不可见。
The " Get User Status API " (aka Presence API) will return an object like the following: “ 获取用户状态API ”(又名Presence API)将返回如下对象:
{
"uri": "https://platform.ringcentral.com/restapi/v1.0/account/403228676008/extension/403228676008/presence",
"extension": {
"uri": "https://platform.ringcentral.com/restapi/v1.0/account/403228676008/extension/403228676008",
"id": 403228676008,
"extensionNumber": "101"
},
"presenceStatus": "Available",
"telephonyStatus": "NoCall",
"userStatus": "Available",
"dndStatus": "TakeAllCalls",
"allowSeeMyPresence": true,
"ringOnMonitoredCall": false,
"pickUpCallsOnHold": true
}
From this, user status can be built using this pseudocode: 由此,可以使用以下伪代码建立用户状态:
user_status =
!user.allowSeeMyPresence ? "Invisible" :
user.presenceStatus == "Offline" ? "Invisible" :
user.dndStatus == "DoNotAcceptAnyCalls" ? "Do Not Disturb" :
user.telephonyStatus == "CallConnected" ? "On a Call" :
user.telephonyStatus == "OnHold" ? "On Hold" :
user.presenceStatus == "Busy" ? "Busy" : "Available"
Once a page you display this info, you can also update it in real time by creating a subscription to the presence endpoints for the users you wish to receive updates for. 页面显示此信息后,您还可以通过为要接收其更新的用户创建状态端点的订阅来实时更新它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.