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

Open
#893 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Domain
api

Research direction

The report names no twilio-python file, test, or entry point; it concerns Twilio Calls API behavior for SIP and OpenAI Realtime. Start by checking whether the client exposes an endpoint or response field relevant to the reported CallSid, then compare the behavior with the documented API. Done would require a maintainer-supported answer or a narrowly identified repository change.

Written by the indexing model from the issue text.

Description

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?

Dominant language
Python
Stars
2.1k
Forks
815
Avg merge
2d 13h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twilio/twilio-python

All issues in twilio/twilio-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.