Skip to main content

I'm facing an issue with the RingCentral JavaScript SDK and could really use some help understanding what's going wrong.

I have a service running on a client’s side, and whenever it receives a call, it creates a new instance of the SDK to make a POST request to supervise the call (monitoring both sides of the audio). This setup works smoothly, and multiple calls happen throughout the day without any issues.

However, after about a week of continuous operation, without any changes to tokens or keys, all calls start returning a 403 Forbidden error when trying to make the request. This error occurs on the first call of the day, and the day before, there were no issues like this.

It seems like some kind of cache or something within the library might be building up over time. I've tried some troubleshooting, but I haven't been able to pinpoint the exact cause. Has anyone else experienced something similar or have any ideas on what might be causing this?

Thanks in advance for any help!

Can you explain how do you monitor the calls? your own software (using the the latest typescript SDK SDK) or using a desk phone?

Why do you have to create a new instance of the SDK every time you make a POST request to monitor? Can you share some code snippets around the part where you detect incoming calls and send a POST request to supervise the call?

If you are interested, check out this demo project


Can you explain how do you monitor the calls? your own software (using the the latest typescript SDK SDK) or using a desk phone?

Why do you have to create a new instance of the SDK every time you make a POST request to monitor? Can you share some code snippets around the part where you detect incoming calls and send a POST request to supervise the call?

If you are interested, check out this demo project

 

 To build our service, we followed this documentation: Supervision API Docs.

Our flow works as follows: once a user logs into our application, we send a */subscription* request to receive the user's incoming calls, which are received by our webhook. As soon as a call is received, we send a POST request to /telephony/sessions/${telephonySessionId}/parties/${partyId}/supervise for each party involved in the call (since we need to monitor both audio channels). The service is configured with a softphone for a "Manager" to supervise the calls. Below is an example of how the SDK is being set up in our code:

const { settings, afterLogin } = params; const ringCentralSDK = new RcSdk({ server: settings.server, clientId: settings.clientId, clientSecret: settings.clientSecret, }); const rcPlatform = ringCentralSDK.platform(); let result = false; await rcPlatform .login({ jwt: settings.jwtToken }) .then(async () => { result = await afterLogin(rcPlatform); }) .catch((e) => { throw new InternalServerErrorException(e); }); return result;

The strange part is that after running for about a week without any issues, we start seeing a 403 Forbidden Error on the first call of the day. The previous day, everything works fine, and the error only appears after the service has been up and running for several days. No changes to the token or environment have been made. The only error code we receive is 403 Forbidden.


Can you explain how do you monitor the calls? your own software (using the the latest typescript SDK SDK) or using a desk phone?

Why do you have to create a new instance of the SDK every time you make a POST request to monitor? Can you share some code snippets around the part where you detect incoming calls and send a POST request to supervise the call?

If you are interested, check out this demo project

 

 To build our service, we followed this documentation: Supervision API Docs.

Our flow works as follows: once a user logs into our application, we send a */subscription* request to receive the user's incoming calls, which are received by our webhook. As soon as a call is received, we send a POST request to /telephony/sessions/${telephonySessionId}/parties/${partyId}/supervise for each party involved in the call (since we need to monitor both audio channels). The service is configured with a softphone for a "Manager" to supervise the calls. Below is an example of how the SDK is being set up in our code:

const { settings, afterLogin } = params; const ringCentralSDK = new RcSdk({ server: settings.server, clientId: settings.clientId, clientSecret: settings.clientSecret, }); const rcPlatform = ringCentralSDK.platform(); let result = false; await rcPlatform .login({ jwt: settings.jwtToken }) .then(async () => { result = await afterLogin(rcPlatform); }) .catch((e) => { throw new InternalServerErrorException(e); }); return result;

The strange part is that after running for about a week without any issues, we start seeing a 403 Forbidden Error on the first call of the day. The previous day, everything works fine, and the error only appears after the service has been up and running for several days. No changes to the token or environment have been made. The only error code we receive is 403 Forbidden.

 

“The service is configured with a softphone for a "Manager" to supervise the calls”, what soft-phone is that? RingCentral soft-phone or your own SIP phone?

Also, when you received that error, did you check how many active calls were supervised at that moment?

Make sure also that you subscribe for the telephony session events only for those agents who the supervisor can supervised to avoid trying to supervise the call of other agents who is not defined in the monitoring group. When that error happens, can you double check if the call is a direct call or a warm transfer call.


Can you explain how do you monitor the calls? your own software (using the the latest typescript SDK SDK) or using a desk phone?

Why do you have to create a new instance of the SDK every time you make a POST request to monitor? Can you share some code snippets around the part where you detect incoming calls and send a POST request to supervise the call?

If you are interested, check out this demo project

 

 To build our service, we followed this documentation: Supervision API Docs.

Our flow works as follows: once a user logs into our application, we send a */subscription* request to receive the user's incoming calls, which are received by our webhook. As soon as a call is received, we send a POST request to /telephony/sessions/${telephonySessionId}/parties/${partyId}/supervise for each party involved in the call (since we need to monitor both audio channels). The service is configured with a softphone for a "Manager" to supervise the calls. Below is an example of how the SDK is being set up in our code:

const { settings, afterLogin } = params; const ringCentralSDK = new RcSdk({ server: settings.server, clientId: settings.clientId, clientSecret: settings.clientSecret, }); const rcPlatform = ringCentralSDK.platform(); let result = false; await rcPlatform .login({ jwt: settings.jwtToken }) .then(async () => { result = await afterLogin(rcPlatform); }) .catch((e) => { throw new InternalServerErrorException(e); }); return result;

The strange part is that after running for about a week without any issues, we start seeing a 403 Forbidden Error on the first call of the day. The previous day, everything works fine, and the error only appears after the service has been up and running for several days. No changes to the token or environment have been made. The only error code we receive is 403 Forbidden.

 

“The service is configured with a softphone for a "Manager" to supervise the calls”, what soft-phone is that? RingCentral soft-phone or your own SIP phone?

Also, when you received that error, did you check how many active calls were supervised at that moment?

Make sure also that you subscribe for the telephony session events only for those agents who the supervisor can supervised to avoid trying to supervise the call of other agents who is not defined in the monitoring group. When that error happens, can you double check if the call is a direct call or a warm transfer call.

  • The softphone we are using is the RingCentral softphone, which is configured for a Manager to supervise the calls.

  • Regarding the 403 Forbidden error, at the time it occurs, there are usually no other active supervised calls. The error happens on the first call of the day, so supervision hasn't been applied to any calls before that point.

  • We are subscribing to the telephony session events only for agents that the Manager is allowed to supervise. It’s important to note that these are the same users for whom the POST request worked perfectly the previous day. Each agent's session is carefully handled to avoid supervising calls outside of the Manager's group.

  • As for the type of call, we have mostly encountered this error with direct calls. I can double-check whether any warm transfer calls are involved, but so far, it seems to primarily affect direct calls

    Is there anything else we should look into to better identify the cause of this issue?.


 

 

 

  • The softphone we are using is the RingCentral softphone, which is configured for a Manager to supervise the calls.

  • Regarding the 403 Forbidden error, at the time it occurs, there are usually no other active supervised calls. The error happens on the first call of the day, so supervision hasn't been applied to any calls before that point.

  • We are subscribing to the telephony session events only for agents that the Manager is allowed to supervise. It’s important to note that these are the same users for whom the POST request worked perfectly the previous day. Each agent's session is carefully handled to avoid supervising calls outside of the Manager's group.

  • As for the type of call, we have mostly encountered this error with direct calls. I can double-check whether any warm transfer calls are involved, but so far, it seems to primarily affect direct calls

    Is there anything else we should look into to better identify the cause of this issue?.

When you hit the 403 error, can you print out and share the rcrequestid header?

...
}catch (e) {
var obj = e.response.headers
console.log(`RC Request id: ${obj.get('rcrequestid')}`)
}

Also can you call this API to check the status of the RingCentral soft-phone when that error happens


Reply