I'm setting up call monitoring using Python and the RingCentral API.
As specified in the API documentation, I need the supervisors device ID, agents extension, and the telephony session ID to do this.
The supervisors device ID looked up using the following endpoint:
f'/restapi/v1.0/account/~/extension/{ supervisor_extension_id}/device'
The supervisor is using a softphone and is registered as "Can Monitor" in the call monitoring group. I can successfully pull this ID.
The extensionNumber is the three digit extension number of the person I'm looking to monitor. They are added as "Can be monitored" to the same call monitoring group as the supervisor above. The extension number lookup is done by using the extensionId. I can successfully look up the extension ID.
f'/restapi/v1.0/account/~/extension/{ ext_id}/phone-number')
Websockets are operating correctly. I can subscribe and act on telephony events in real-time. I'm pulling the telephony sessionId using websockets. The URL to initiate the supervise call is:
url = (f'/restapi/v1.0/account/~/telephony/sessions/{ telephony_session_id}/supervise')
The final API call to start call monitoring is:
data = {'mode': 'Listen', 'deviceId': '############', 'extensionNumber': '###'} url = (f'/restapi/v1.0/account/~/telephony/sessions/{telephony_session_id}/supervise') response = platform_monitoring.post(url, data)
Where,
deviceId = 12-digit device ID of the softphone of the supervisor.
extensionNumber = 3-digit extension number of person to monitor
telephony_session_id = ID of the phone call (s-a0e7a....)
The response back is: ringcentral.http.api_exception.ApiException: HTTP409
You body params are incorrect. It is not the agent extension number. It is the agent extension id. And the 'supervisorDeviceId' not just the 'deviceId'
Try this
var data = { 'mode': 'Listen', 'supervisorDeviceId': '############', 'agentExtensionId': '#############' }
And remember that you can only call the API to supervise a call after the call is connected/answered.
Hello @Phong Vu , I'm the engineer working on resolving this. Can you send a message request so we can sync? Thank you.
Lance
Unfortunately, I am traveling this week. Will get back to you next week.
Please let me know when your available. Can you sync today/tomorrow?
How about today 12:30PM or after 2:00PM PST?
Could you do 2:30 PST?
Yes. And your email? You use the RC app, right?
That's correct. My email is ---. I will edit this email reference once you see it.
I will test this. Note that the RinCentral API documentation clearly states Extension number for the agent:
{ "mode": "Listen", "extensionNumber": "108", "deviceId": "60727004"}
Sorry for the confusion in our documentation. I believed that the dev guide doc was too old (alpha phase) and it was not updated since. I will alert the documentation team later.
But for now, please use the API reference instead
https://developers.ringcentral.com/api-reference/Call-Control/superviseCallParty
Back to the 409 error, can you check the following
- Is the device online? Can you make a normal call to the supervisor device?
- Can you confirm that the call is connected? Can you cause a little delay after the call is connected before calling the /supervise API.
Hello Phong, I did confirm I can call the supervisors numbers. I also added a slight delay. Same results. Most of the time it's a 409 error. Sometimes a 403. Is there a way to setup a quick call between us?
I invite you the a RC Team Messaging chat. Check your email and join the chat and we can have a look at the issue.
Thank you! We have not received the email. Can you please confirm?
Is your RingCentral extension's email the one you use in this community? If so, just login the RC app and you should see the direct chat.
Thanks for the extra details. I will work through your suggestions.
Getting the same response (409) with:
{'mode': 'Listen', 'supervisorDeviceId': '80460166####', 'agentExtensionId': '293466####'}
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