question

Michelle Garber avatar image
Michelle Garber asked Lance D commented

Receiving 409 Error when initiating call monitoring

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

call recordingcall monitoring
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Lance D commented

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.

15 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Michelle Garber avatar image Michelle Garber commented ·

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


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

0 Likes 0 ·
Michelle Garber avatar image Michelle Garber Michelle Garber commented ·

Getting the same response (409) with:

{'mode': 'Listen', 'supervisorDeviceId': '80460166####', 'agentExtensionId': '293466####'}
0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Michelle Garber commented ·

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.

0 Likes 0 ·
Michelle Garber avatar image Michelle Garber Phong Vu ♦♦ commented ·

Thanks for the extra details. I will work through your suggestions.

0 Likes 0 ·
Show more comments
Lance D avatar image Lance D commented ·

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

Lance

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Lance D commented ·

Unfortunately, I am traveling this week. Will get back to you next week.

0 Likes 0 ·
Lance D avatar image Lance D Phong Vu ♦♦ commented ·

Please let me know when your available. Can you sync today/tomorrow?

0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys