little-king-41579
05/23/2026, 9:56 AMwait_until_answered = false, the call is initiated successfully and the phone continues ringing normally.
However, when I set wait_until_answered = true, the call disconnects immediately after the first ring and retries 3 times with the same behavior each time.
So the issue only occurs when wait_until_answered is enabledtall-airline-16756
05/23/2026, 9:56 AMtall-airline-16756
05/23/2026, 9:56 AMwait_until_answered = true.
This behavior means LiveKit is waiting for SIP call progress/answer signals (1xx/2xx) but isn’t seeing them, so it treats the call as failed and closes the leg (then retries). That’s why wait_until_answered = false works — LiveKit doesn’t require those confirmations.
To diagnose and fix, please check the following and share logs/configs where noted:
1. SIP signaling between Twilio and your SIP server
◦ Confirm Twilio is sending provisional (1xx) and final (2xx/4xx/5xx) responses to your SIP server.
◦ Verify your SIP server forwards those responses unchanged to LiveKit.
1. Twilio trunk settings
◦ Ensure the SIP URI and auth are correct and that Twilio’s outbound SIP options (e.g., SIP response handling, SIPREC if used) aren’t suppressed.
◦ Check any Twilio logs for the exact SIP response codes during the attempted calls.
1. Self-hosted SIP server behavior
◦ Confirm the SIP server accepts and relays 1xx provisional responses (like 180 Ringing, 183 Session Progress) to the caller side.
◦ If your SIP server generates its own early media handling or sends immediate failure responses, that could trigger LiveKit’s disconnect.
1. LiveKit logs and timing
◦ Share LiveKit server logs around the call attempt (timestamps) showing the SIP participant creation and the disconnect reason.
◦ Note whether LiveKit logs show a SIP response code or a timeout/failure when wait_until_answered is enabled.
1. Network / proxy interference
◦ If there’s a proxy or SBC between Twilio and your SIP server, confirm it isn’t stripping or transforming provisional responses.
If you can, please provide:
• One example call trace: Twilio SIP debug + SIP server logs + LiveKit logs for the same timestamp.
• The SIP response codes you see in those traces (copy of INVITE/100/180/183/200/4xx messages if possible).
• Your SIP server type/version and any SBC/proxy in the path.
I’ll review those traces and point to the specific mismatch or configuration change needed.
, with interactive elementslittle-king-41579
05/23/2026, 10:05 AMtall-airline-16756
05/23/2026, 10:05 AMinvite-failed when wait_until_answered = true.
The logs show Twilio sending a 200 Canceling and multiple 487 Request Terminated responses, and LiveKit logs an unhandled SIP response handler then ends the call with reason invite-failed. That matches the earlier symptom: LiveKit is not receiving (or not handling) the expected provisional/final response flow and is treating the call as failed.
Please confirm/provide the following so I can pinpoint the fix:
1. SIP server type/version (e.g., Asterisk 18, FreeSWITCH X, Kamailio Y) and whether there’s an SBC/proxy between Twilio and your SIP server.
2. LiveKit server version.
3. A short SIP trace (INVITE + downstream responses) showing the full response sequence from Twilio to your SIP server and from your SIP server to LiveKit for one failed attempt. Include timestamps.
4. Whether your SIP server forwards provisional responses like 180 Ringing / 183 Session Progress to LiveKit, or whether it converts/consumes them.
5. Any SIP-related config you’re using in LiveKit (participant creation fields) and in your SIP server for this trunk (early media, timer settings, forking, cancel handling).
Immediate checks you can run now:
• Verify Twilio is returning 1xx (180/183) and 2xx answers toward your SIP server in the call attempt. If Twilio returns Cancel/487 toward your SIP server (as logs hint), find why Twilio cancelled (Twilio debug logs will show this).
• Confirm your SIP server does not swallow or transform provisional responses into 487/200 cancel events before forwarding to LiveKit. If it does, enable forwarding of provisional responses or adjust early-media handling.
• Inspect any SBC/proxy for automatic CANCEL or request-termination timers (could be closing the server transaction).
• On the LiveKit side, the unhandled-response messages indicate LiveKit didn’t have a transaction handler for those responses. Ensure your SIP server preserves Call-ID/branch/tags so LiveKit’s transaction layer can match responses to the original INVITE.
If you share the SIP trace and the items above, I’ll analyze the exact response sequence and tell you the specific config change (Twilio, SIP server, or LiveKit) to stop the immediate disconnects when wait_until_answered = true.
, with interactive elements