Skip to main content
The First Step
June 16, 2026
Solved

How to obtain the telephonySessionId for an inbound call answered by the softphone in case of multi-softphones in a single-queue case?

## Setup

We use `ringcentral-softphone` to answer inbound calls that are routed through a single RingCentral **call queue** to one of several **agent softphones**.
- **4 softphones** sit behind one queue, each a distinct RC user/extension with its own SIP credentials.

## What we're trying to do

For every call we need to capture two kinds of data and store them under **one phone call record**, then display them together for a single call in our own UI:

1. **Internal logs** (from the Node softphone process): a small set of details we write to our database when the call starts, against a unique identifier.
2. **Telephony lifecycle**: the full call history — transfer → answered/rejected → transferred again → ended — which we obtain from an **account-level `telephony/sessions` webhook subscription** (or any better approach you'd recommend).

**The core question: how can we tie these two records together with the same identifier?**

## The problem

From the SIP connection in `ringcentral-softphone(-ts)`, the only identifier we get is the SIP **`Call-ID`** — we cannot obtain the **`telephonySessionId`**, which is the key the telephony webhook (and the Call Log API) use.

We tried your suggestion of subscribing to extension/account `telephony/sessions` events via webhook, and we *can* see a matching session id inside **`sipData`** — but with a catch:

- `sipData` is only present for the softphone whose **own credentials** were used
  to create the subscription.
- To get `sipData` for every call in the queue, we'd have to create a separate
  subscription **per softphone**, each using that softphone's own client
  ID/secret/credentials.

That approach is hard to maintain and debug (one subscription and credential set per softphone), and every softphone's subscription also receives **all** account events, which adds a lot of duplicate noise.

## Questions

What is the recommended, maintainable way to obtain or correlate the `telephonySessionId` for a call answered by one of several softphones in a single queue — ideally without creating and managing a separate subscription per softphone?

Specifically:
- Is the `telephonySessionId` (or `partyId`) available to the softphone in any SIP header on the INVITE that we could read? If so, could `ringcentral-softphone` expose it on the `CallSession` (e.g. `callSession.telephonySessionId`)?
- If not, is there a better correlation strategy than one subscription per softphone?

Thanks for the library — any guidance on this multi-softphone / single-queue case
would be a big help.

PhongVu
PhongVuAnswer
Community Manager
June 18, 2026

​@PhongVu 

The user active calls API provides response like:
 

{
"uri":"https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/active-calls?view=Simple&page=1&perPage=100"
"records":[
0:{
"uri":"https://platform.ringcentral.com/restapi/v1.0/account/123318033/extension/1234352/call-log/GSbrwP..."
"id":"GSbwerwPldcwIOswP"
"sessionId":"31243523123"
"startTime":"2026-06-18T15:32:07.000Z"
"duration":185
"durationMs":185000
"type":"Voice"
"internalType":"LocalNumber"
"direction":"Inbound"
"action":"Phone Call"
"result":"Accepted"
"to":{
"name":"Bibek chaulagain"
"phoneNumber":"+44123456782"
}
"from":{
"name":"AI Receptionist"
"phoneNumber":"+4412322345"
}
"recording":{
"uri":""
"id":"100033003404"
"type":"Automatic"
"contentUri":""
}
"extension":{
"uri":""
"id":132456784
}
"reason":"Accepted"
"reasonDescription":"The call was connected to and was accepted by this number."
"telephonySessionId":"s-w120msa235023231203213123"
"partyId":"p-w120msa235023231203213123-1"
}

The sample response you provided was from the subscribing to the presence event.
Could you please look into this?

My bad, call this API to get the call Id of an active call. Remember to set the “detailedTelephonyState=true”

17 replies

PhongVu
Community Manager
PhongVuAnswer
Community Manager
June 18, 2026

​@PhongVu 

The user active calls API provides response like:
 

{
"uri":"https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/active-calls?view=Simple&page=1&perPage=100"
"records":[
0:{
"uri":"https://platform.ringcentral.com/restapi/v1.0/account/123318033/extension/1234352/call-log/GSbrwP..."
"id":"GSbwerwPldcwIOswP"
"sessionId":"31243523123"
"startTime":"2026-06-18T15:32:07.000Z"
"duration":185
"durationMs":185000
"type":"Voice"
"internalType":"LocalNumber"
"direction":"Inbound"
"action":"Phone Call"
"result":"Accepted"
"to":{
"name":"Bibek chaulagain"
"phoneNumber":"+44123456782"
}
"from":{
"name":"AI Receptionist"
"phoneNumber":"+4412322345"
}
"recording":{
"uri":""
"id":"100033003404"
"type":"Automatic"
"contentUri":""
}
"extension":{
"uri":""
"id":132456784
}
"reason":"Accepted"
"reasonDescription":"The call was connected to and was accepted by this number."
"telephonySessionId":"s-w120msa235023231203213123"
"partyId":"p-w120msa235023231203213123-1"
}

The sample response you provided was from the subscribing to the presence event.
Could you please look into this?

My bad, call this API to get the call Id of an active call. Remember to set the “detailedTelephonyState=true”

The First Step
June 18, 2026

​@PhongVu Thank you very much. You are a genius.

One final question:

If we receive a 429 Too Many Requests error because more than threshold of any RingCentral API calls are made within a minute, can we work around this by rotating between different RingCentral Client ID/Client Secret pairs that are connected to the same user account?

Or is the rate limit enforced at the user account level, meaning that rotating Client IDs and Secrets for the same user would not bypass the throttle limit?

Do you have any recommendations or best practices for handling this scenario and avoiding rate-limit issues?

PhongVu
Community Manager
Community Manager
June 18, 2026

​@PhongVu Thank you very much. You are a genius.

One final question:

If we receive a 429 Too Many Requests error because more than threshold of any RingCentral API calls are made within a minute, can we work around this by rotating between different RingCentral Client ID/Client Secret pairs that are connected to the same user account?

Or is the rate limit enforced at the user account level, meaning that rotating Client IDs and Secrets for the same user would not bypass the throttle limit?

Do you have any recommendations or best practices for handling this scenario and avoiding rate-limit issues?

This endpoint is in the Light usage group. E.g. 50 API calls per minute. If that is not enough, then the best approach is to use the /presence event notification.

Rate limit is per API, per user, per app (app client Id).

The First Step
June 18, 2026

​@PhongVu Got it, I will check this once. And Thanks again.

The First Step
June 23, 2026

​@PhongVu 

We are using the List Company Call Records API to retrieve call logs and store the logs in our own database. But we are not able to determine whether a call has fully ended or not, so we can store only those logs which has full call legs.

Is there a specific field in the call log response that reliably indicates that a call has been ended completely or is there any recommended approach to find this out?

PhongVu
Community Manager
Community Manager
June 23, 2026

​@PhongVu 

We are using the List Company Call Records API to retrieve call logs and store the logs in our own database. But we are not able to determine whether a call has fully ended or not, so we can store only those logs which has full call legs.

Is there a specific field in the call log response that reliably indicates that a call has been ended completely or is there any recommended approach to find this out?

The call log API returns only completed call records. If you call the API too close to the current time (set by the dateFrom and dateTo params), you may miss those active calls which is in progress (if any), unless you call the API again with overlap dateFrom and dateTo time range.

You can use the extract sync API instead, the API also returns only completed call records, but it keep track of the active calls and will return those in the next sync.

The First Step
June 24, 2026

​@PhongVu Thank you for the reply.

For now we've stuck with the List Company Call Records API and handle completeness like this:

  • We poll once a minute with overlapping dateFrom(3 hours before dateTo)/dateTo(current datetime while logging) windows, and keep each call "pending" until its record shows up, so we don't miss in-progress calls. And the API seems to return In progress calls as well.
  • Before storing, we confirm the call has actually ended by cross-checking List Company Active Calls — if the telephonySessionId is still there with result: "In Progress", we skip it.
  • Once it's no longer active, we wait for a short cooling period until the record's lastModifiedTime stops changing, since RingCentral appends the final legs/duration/recording shortly after the call ends. Only then do we save it.

- Does this approach looks feasible to log ended call logs?

- Also, we are currently assuming that result: "In Progress" from the Active Calls API indicates that a call has not yet ended. Are there any other possible result values, besides "In Progress", that also represent a call that is still active and has not been completed?