SIP REFER silently failing — fresh call_id with confirmed "current" payload format
Thanks for the diagnosis. You were right — the Missing required parameter: 'session.type' error came from our session.update calls over the WebSocket sideband. The SDK’s connection.session.update(session={...}) helper doesn’t automatically include "type": "realtime" inside the session object. We’ve patched that in all 3 call sites and verified sessions now run end-to-end without that error.
Fresh test call demonstrating the corrected flow but persistent /refer issue:
call_id : rtc_u0_Dh72Y82UgVr8Islheq03l
timestamp : 2026-05-19 05:12:20 UTC
What happened:
/acceptreturned 200 cleanly (using SDK’sclient.realtime.calls.accept())Sideband WebSocket connected (
connect_duration_ms=680)session.updatewith{"type": "realtime", "temperature": 0.8}accepted with no errorSession ran 50 seconds — agent greeted, transcribed caller turns, responded with audio
Caller asked at 05:12:48: “OK, got it. Can you please transfer me to a human?”
Agent spoke the transfer line at 05:12:50
We called
client.realtime.calls.refer(call_id="rtc_u0_Dh72Y82UgVr8Islheq03l", target_uri="tel:+61420351258")via the official Python SDK 2.36.0/referreturned HTTP 200 with empty body at 05:12:54.348 (616ms duration)Caller sat in silence for 16 seconds — no SIP REFER ever arrived on the Twilio leg
Twilio reports
DialCallStatus: completed, sip_response_code: 200at 05:13:10; caller hung up
Verification we’re on the current payload format:
/accept: via SDK’sclient.realtime.calls.accept(call_id, type="realtime", model=..., ...). Top-leveltype: "realtime"per SDK source.session.updateover WS: explicitly includes{"type": "realtime", ...}inside the session object./refer: via SDK’sclient.realtime.calls.refer(call_id, target_uri="tel:+...")— no custom headers, body is{"target_uri": "tel:+61420351258"}perCallReferParams.
The session is unambiguously healthy this time — 50 seconds of normal back-and-forth audio confirms it. /refer returns 200 in <700ms but the underlying SIP REFER message never reaches Twilio’s trunk. We can confirm via Twilio’s call event log: no REFER event present, only the original INVITE and an eventual BYE when the caller hangs up.
Could you check server-side handling for this specific call_id? Specifically:
Is the SIP REFER actually being generated and sent toward Twilio’s trunk?
Are there backend errors after our
/referPOST that aren’t reflected in the HTTP response?
Happy to provide additional call IDs if that helps.
Thanks, SP @OpenAI_Support
Discussion in the ATmosphere