Question

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

  • 21 February 2024
  • 1 reply
  • 104 views

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(/* ... */);

1 reply

Userlevel 1

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');
  }

Reply