When a user sets the phone to "Do not disturb" the Option for "Accept queue calls" disappears. Question: With which API call can I read out the value of this option ("Accept queue calls") - especially when the user is in the status "Do not disturb")?
Note: My app should be able to change the presence status of a user. To "restore" the previous values I need to change the presence status to the correct value ("TakeAllCalls" or "DoNotAcceptDepartmentCalls") as was before (before the status was changed to "Do not disturb"). I couldn't find a API call which can read this value.
To read members' status on a call queue, call the call queue presence API (check the Read Call Queue Members Status section).
Setting the DnD of a user extension to "DoNotAcceptDepartmentCalls" will change the member status of that user on all call queues it belongs to.
As you describe it this won't scale.
What I need is 1 API call to read out if the flag "Accept queue calls" was active or not. When you manually set the presence status to "DND" and then back to "Available" again the option "Accept queue calls" is restored (as it was before setting to DND).
If, like you suggested, I have to test alle the queues and read out the "call queue presence" this results in many API calls. And because of the rate limit this does not work and not scale.
What is needed is 1 API call to get the value of "Accept queue calls" and 1 API call to set that value.
Question: What exactly happens when you manually set the option "Accept queue calls" to "not active"? Especially what happens when you have manually logged out from one queue and are still logged in in another queue?
Q. What is needed is 1 API call to get the value of "Accept queue calls" and 1 API call to set that value.
A. That 1 API to read the "Accept queue calls" is the read user presence API and check the user's DnD status if it is "DoNotAcceptDepartmentCalls". And to set it, use the update user presence API.
Question: What exactly happens when you manually set the option "Accept queue calls" to "not active"? Especially what happens when you have manually logged out from one queue and are still logged in in another queue?
A. The "Accept queue calls" is the flag that follows the user DnD presence status, it is set via the user presence status API. So if you want to set it, you have to update user DnD presence status. The "Accept queue calls" applies to all call queues that user belongs to. There is another flag "acceptCurrentQueueCalls" which applies to a single call queue. But the "Accept queue calls" supersedes the "acceptCurrentQueueCalls" in other call queues.
About "read user presence status" und "updateuser presence status" I'm familiar with.
But I have the following use-case:
The user is manullay set to "Available" and the flag "Accept queue calls" is inactive. So when I read the presence status I get "DoNotAcceptDepartmentCalls".
No the user manually sets the status to "Do not disturb". Whe I read the preence status I get "DoNotAcceptAnyCalls".
In my application I now want to reset the presence status back to the same value as it was before (which I don't know because I don't know and I cannot read it - or which API call is there to read this).
I need 1 API call to determine to which value I have to set the presence status ("TakeAllCalls" or "DoNotAcceptDepartmentCalls") back to what it was before. When the user manually sets the presence status to "Available" the same value is restored - so this information must be available. I need 1 API call to determine this value.
In that case, you have to read a call queue which the user extension is a member of, and check the "acceptQueueCalls" flag to decide what the DnD status should be restored.
async function get_call_queues() { try { var resp = await platform.get('/restapi/v1.0/account/~/call-queues') var jsonObj = await resp.json() for (var record of jsonObj.records) { if (record.name == "Demo call queue") read_call_queue_member_status(record.id) } } catch (e) { console.log(e.message) } } async function read_call_queue_member_status(id){ try { var resp = await platform.get(`/restapi/v1.0/account/~/call-queues/${id}/presence`) var jsonObj = await resp.json() console.log(jsonObj) }catch(e){ console.log(e.message) } }
Check the response
{ "records" : [ { "member": { "id": '979428000', "name": 'James Smith', "extensionNumber": '12104', "site": { "id": '62366997000', "name": 'Main Site' } }, "acceptQueueCalls": true, "acceptCurrentQueueCalls": true },{ "member": {...}, "acceptQueueCalls": true, "acceptCurrentQueueCalls": false },{ "member": {...}, "acceptQueueCalls": true, "acceptCurrentQueueCalls": true } ] }
https://developers.ringcentral.com/guide/voice/call-routing/manual/call-queues-presence#javascript
I tried it out and it does not work (the call to "/restapi/v1.0/account/~/call-queues/${id}/presence")!
- DND: TakeAllCalls; AcceptQueueCalls: active
--> The API call returns: "acceptQueueCalls": true, - DND: TakeAllCalls; AcceptQueueCalls: inactive
--> The API call returns: "acceptQueueCalls": false, - DND: DoNotAcceptAnyCalls; AcceptQueueCalls: active
-->The API call returns: "acceptQueueCalls": false, - DND: DoNotAcceptAnyCalls; AcceptQueueCalls: inactive
-->The API call returns: "acceptQueueCalls": false,
The problem here is that point 3 return "false". So when I want to restore the status back to "Available" I would set it to "DoNotAcceptDepartmentCalls". This is wrong as the user was before "AcceptQueueCalls=active".
What I need is a function to read the value of the option "Accept Queue Calls" (independent of the DND status). This information must somehow be available as when turning the status back to "Available" in client the "Accept Queue Calls" option is correctly set back (as it was before setting "Do not disturb").
How do you set 3/DND: DoNotAcceptAnyCalls; AcceptQueueCalls: active
When you set a user DnD, the AcceptQueueCalls will be set to inactive by the system. The RingCentral app will hide the Accept queue calls option.
I also test set DnD with different value and get the AcceptQueueCalls status correctly set.
Your call queue may have several members, when reading the call queue presence, double check the right member which you change the DnD.
Here the scenario:
The user sets on the phone client the status to "Do not disturb". I have a RingCentral App which by an external event should set the presence status of the user to "Available". This is done by setting the telephonyStatus to "TakeAllCalls" or "DoNotAcceptDepartmentCalls".
The problem is: How can I determine which value to set ("TakeAllCalls" or "DoNotAcceptDepartmentCalls")? From which value can I determine which value to set (which value had the user before setting to "Do not disturb")?
Thnaks,
this is quite complicate to manage all the queues and users (and relationship) and involves multiple API calls.
I thought there would be 1 API call to reset the status back to where it was before (or maybe to retrieve the status as it was before and then set it). But there seems to be now such easy way to doit and I will try to find a workaround.
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder