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