question

Karla Rosario avatar image
Karla Rosario asked Phong Vu answered

How to obtain the sessionId and/or telephonySessionId using the webrtc library?

Is there a way to obtain the sessionId or telephonySessionId of a session object in the webrtc library without making a request to the /restapi/v1.0/account/accountId/extension/extensionId/active-calls and finding the current session data by phone number? I'm referring to the session returned by this function

var session = webPhone.userAgent.invite(/* ... */);
phonesdk
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

You can get the session id nor the telephony session id from the WebPhone object. You have to call the platform to get the user's active call to grab the ids.

async function getPresenceActiveCalls() {
    return await platform.get('/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true');
  }
1 |3000

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

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