Skip to main content

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.


I will test this. Note that the RinCentral API documentation clearly states Extension number for the agent:


{ "mode": "Listen", "extensionNumber": "108", "deviceId": "60727004"}


Hello @Phong Vu , I'm the engineer working on resolving this. Can you send a message request so we can sync? Thank you.

Lance


Reply