{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreidb6cfcgxcg65iu5ztlnkx4neycb2r2gcvj47thtqbjpcmyqu3jmy",
    "uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mjdv7c33v632"
  },
  "path": "/t/realtime-sip-call-ended-unexpectedly-while-caller-was-still-speaking-twilio-openai-sip-child-leg-completed-with-200/1378863#post_1",
  "publishedAt": "2026-04-13T01:50:19.000Z",
  "site": "https://community.openai.com",
  "textContent": "Hi team,\n\nWe observed an unexpected call termination in a Twilio → OpenAI SIP → Realtime setup, and I’d like to check whether anyone has seen similar behavior.\n\n## Summary\n\nA live call was transferred from Twilio to an OpenAI SIP endpoint for a Realtime voice agent.\nWhile the caller was still speaking, the child SIP leg ended as `completed` from Twilio’s perspective, and our parent call then hung up because our scenario treats child-call `completed` as end-of-call.\n\nAt the moment, we do **not** have evidence that our app explicitly ended the session.\n\n## What happened\n\n  * Parent inbound call started at `2026-04-13 00:17:52 UTC`\n  * Caller selected the AI transfer option via DTMF\n  * Child SIP leg connected to OpenAI and became `in-progress` at `2026-04-13 00:18:23 UTC`\n  * Twilio shows the child leg ended at `2026-04-13 00:18:52 UTC`\n  * Twilio status for the child leg was:\n    * `CallStatus=completed`\n    * `SipResponseCode=200`\n    * `CallDuration=29`\n  * Our parent call then ended because our TwiML flow maps child `completed` → end → `<Hangup/>`\n\n\n\n## Why this looks unexpected\n\nThe recording suggests the caller was still talking when the call ended.\nThe call does not sound like a natural hang-up by the caller.\n\nIn Japanese, the caller was cut off around:\n`...to iu renraku ga kite ita ndesu kedo mo...`\nwhich roughly means:\n`...we had received a message about that, but...`\n\nSo from the recording, it sounds like the call was interrupted mid-sentence.\n\n## What we confirmed on our side\n\n### 1. No explicit app-side session finish\n\nIn our application logs, we did **not** find:\n\n  * our normal `finish_session` tool execution\n  * our app-side forced hangup logic\n  * relevant application exceptions around the termination point\n\n\n\n### 2. Realtime transcript stopped earlier than the recording\n\nIn our Realtime-side logs, the last user transcript entries were approximately:\n\n  * `Green Eco Construction, this is Kishi speaking.`\n  * `Um...`\n\n\n\nHowever, the recording contains additional caller speech after that point.\nSo it appears the Realtime / SIP path may have stopped processing before the caller had actually finished speaking.\n\n### 3. Twilio sees this as a normal completion, not an error\n\nTwilio call events for the child leg were roughly:\n\n  * `initiated`\n  * `ringing`\n  * `in-progress`\n  * `completed`\n\n\n\nAnd the final SIP response code was `200`, not an obvious failure code.\n\n## Architecture\n\nOur flow is roughly:\n\n  1. inbound Twilio voice call\n  2. IVR / DTMF selection\n  3. Twilio `<Dial>` to OpenAI SIP endpoint\n  4. OpenAI Realtime voice agent handles the conversation\n  5. if child leg completes, our current scenario ends the parent call\n\n\n\nSo in this case, the parent call ending is a downstream effect.\nThe main question is why the child SIP / Realtime leg completed while the caller was apparently still speaking.\n\n## One related thing we noticed\n\nTwilio logged one warning on the child call:\n\n  * Warning code: `32113`\n  * Message: `Specifying this header is not allowed: SipHeader_X-Parent-CallSid`\n\n\n\nWe are not sure this is related to the unexpected completion, but mentioning it in case it matters.\n\n## Question\n\nHas anyone seen a case where:\n\n  * Twilio → OpenAI SIP call becomes `completed`\n  * SIP response code is still `200`\n  * there is no app-side `finish_session`\n  * and the caller appears to be cut off mid-sentence?\n\n\n\nAlso, is there any OpenAI-side logging or known Realtime/SIP behavior that could cause the SIP leg to close cleanly from Twilio’s perspective even though the conversation was not actually finished?\n\n## Redacted identifiers / metadata\n\n  * Date: `2026-04-13`\n  * Parent call duration: `60s`\n  * Child SIP leg duration: `29s`\n  * Region / carrier details omitted for privacy\n  * Full call SIDs omitted here, but available if needed in a private support channel\n\n\n\nAny guidance would be appreciated. Thanks.",
  "title": "Realtime SIP call ended unexpectedly while caller was still speaking (Twilio -> OpenAI SIP, child leg completed with 200)"
}