question

Suresh Gothandaraman avatar image
Suresh Gothandaraman asked Patrick Foley commented

Unable to monitor call after JWT migration

We are unable to monitor a call using supervise api after JWT migration. Its working fine with password grand type authorization.
We could see subscription api's providing 200 response.

SubscriptionApi(Returning 200 response)

rc.restapi().subscription().list();


Team, Could you please let us know why call monitoring is not working in JWT flow?
Code(Java) :

rc = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER);

rc.authorize(RINGCENTRAL_JWT);

superviseRequestAgent.agentExtensionId(extensionid);

superviseRequestAgent.supervisorDeviceId(sipdeviceid);

superviseRequestAgent.mode("Listen");

resultAgent = rc.restapi().account().telephony().sessions(telephonysessionId).parties(callparty).supervise().post(superviseRequestAgent);


We are getting below error

{

"errors" : [

{

"errorCode" : "TAS-120",

"message" : "Can't find registered deviceId for current user"

}

]

}


HTTP Request

============

HTTP POST https://platform.ringcentral.com/restapi/v1.0/account/~/telephony/sessions/s-a0d7966184bb3z18df39ea87az13b97230000/parties/p-a0d7966184bb3z18df39ea87az13b97230000-1/supervise


Authorization: ?? <-- (Why its showing ? mark in authorization)

X-User-Agent: RC-JAVA-SDK Java 1.8.0_382 Linux


Created JWT Token for prod and gave access to the particular application.

call 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.

Phong Vu avatar image
Phong Vu answered

Make sure that you generate the JWT token for the right supervisor who owns the device. Simply login the RingCentral developer portal using the supervisor's username and password (the one you used before to authenticate the app) and generate the JWT token for that supervise.

1 |3000

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

Suresh Gothandaraman avatar image
Suresh Gothandaraman answered Patrick Foley commented

Thank you @Phong Vu .
But we have total 14 sip phones for supervise calls in production. I don't have admin rights and don't know the credentials to login to the developers portal using that phone username and password.

Under organization tab , i could see supervise phone email's are not showing in part of Developer list.

so I have tried to login developer portal with rc username ,extension and rc password which is for one of the supervise phone we are using, But its redirecting us to password reset page.

Could you please let us know how can we generate JWT for each supervise phones.

Do we need to create JWT for all 14 phones in developer portal?

4 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.

Phong Vu avatar image Phong Vu ♦♦ commented ·

Unfortunately I don't know your group monitoring setup. But here are the fundamentals

- A call monitoring group can have multiple supervisors and multiple monitored agents

- A call supervisor is a user extension and a user extension can have multiple devices (phones). And a user extension must have its own login credentials (username/password). And a user extension can login the RingCentral developers portal to generate JWT for itself.

If those 14 SIP phones belong to a supervisor, then you need to generate just ONE JWT token to authenticate your app.

If those 14 SIP phones belong to 14 different supervisors, then of course each of the supervisors needs to generate its own JWT tokens. Thus, you need 14 JWT tokens. Each JWT token can be used to authenticate your app and can supervise calls on the SIP device which belongs to that supervisor.

0 Likes 0 ·
Patrick Foley avatar image Patrick Foley Phong Vu ♦♦ commented ·

Hi Phong,

Does this principle hold true for sending sms from an extension as well? In other words, if extension 101 and 102 have the same supervisor, can I simply create a jwt for the supervisor and use that to login as extension 101 / 102 to send texts from those users? Or do I have to get an individual jwt for each user (the extension 101 user and extension 102 user)?

Thanks,
Patrick

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Patrick Foley commented ·

No, currently there is no way to send SMS messages on behalf of other extensions (even using an access token of a super admin user). In other words, only the owner of a phone number (a phone number that assigned to a user) can send/receive SMS messages from/to that phone number.

If a phone number is a company number, then only the extension that is assigned to handle Fax/SMS for company number(s) can send/receive SMS messages from/to that number. The setting can be found under the Auto-receptionist - General Settings - Call Handling section. E.g.

screen-shot-2024-03-05-at-82055-am.png


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