Skip to content

Inbound SIP calls do not expose CallSid/ParentCallSid via Twilio API when using OpenAI Realtime cannot obtain SID before transfer #893

@souvik666

Description

@souvik666

When receiving inbound SIP calls routed through Twilio Elastic SIP Trunking into OpenAI Realtime, the incoming webhook correctly includes call_id, but Twilio's own API (/Calls) does not return the Call SID at all until after a transfer or after the call fully completes.

This means:

You cannot fetch the inbound CallSid from Twilio using
/Calls?From=...&To=...

ParentCallSid is always missing

The call does not appear in Twilio’s Call Logs API in real-time

Only after a SIP REFER transfer or call completion does the CallSid appear

This makes it impossible to interact with Twilio Voice API call control before transfer, even though the call is active and controlled by OpenAI Realtime.


Expected Behavior

Twilio API (/Calls) should expose the inbound SIP CallSid immediately when the call arrives

ParentCallSid should be present if applicable

Searching by From or To should return the inbound call before any transfer occurs


Actual Behavior

/2010-04-01/Accounts/{sid}/Calls.json?From=xxx&To=xxx returns an empty list

ParentCallSid is always null for inbound SIP calls

Twilio only logs the call after a transfer (SIP REFER) or after the call ends

OpenAI Realtime webhook provides call_id, but Twilio API does not return this SID anywhere


Steps to Reproduce

  1. Receive inbound SIP call → Twilio SIP trunk → OpenAI Realtime webhook

  2. Extract event.data.call_id

  3. Query Twilio API:

GET /v1/Calls?From=&To=<trunk_number>

  1. API returns:

calls: []

  1. Attempt to obtain ParentCallSid → always null

  2. Perform a SIP REFER transfer → Twilio then creates a child call

  3. Only now the call appears in Call Logs


Why This Is a Problem

Cannot inspect or log the inbound call using Twilio APIs

Cannot correlate OpenAI’s call_id with Twilio’s CallSid in real-time

Cannot apply Twilio Voice features before transfer

Makes debugging SIP REFER + Realtime workflows more difficult


Environment

Twilio Elastic SIP Trunking

SIP REFER transfers enabled

OpenAI Realtime API used for call handling

Incoming call webhook configured correctly


Request

Please clarify:

  1. Is this missing CallSid exposure for inbound SIP → OpenAI Realtime intentional?

  2. Should inbound SIP calls be queryable in the Twilio Calls API before transfer?

  3. Is there any supported way to obtain the Twilio CallSid through Twilio API itself, not only via OpenAI’s webhook?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions