magnificent-monitor-48407
02/18/2026, 3:27 PMInbound calls via Twilio Programmable Voice + <Dial><Sip> not reaching LiveKit
We're trying to accept inbound calls using Twilio Programmable Voice (not Elastic SIP Trunking) following the guide at
<https://docs.livekit.io/telephony/accepting-calls/inbound-twilio/>
Setup:
- LiveKit inbound trunk with numbers: ["+14694617341"] and auth_username/auth_password set
- Dispatch rule tied to that trunk with dispatchRuleIndividual and agentName
- TwiML webhook returns:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Sip username="[redacted]" password="[redacted]">
sip:[redacted]@[redacted].sip.livekit.cloud;transport=tls
</Sip>
</Dial>
</Response>
What's happening:
- Customer calls our Twilio number → Twilio hits our webhook → TwiML is returned with 200 OK
- Twilio places the outbound SIP call to the LiveKit SIP endpoint
- The child SIP call immediately fails with 0 sec duration and no SIP response logged in Twilio
What we've tried:
- With and without username/password on the <Sip> element (and matching trunk auth)
- With and without ;transport=tls in the SIP URI
- Trunk with credential auth vs trunk with no auth at all
- Deleted and recreated trunk + dispatch rule from scratch
- All combinations result in "Failed" with no SIP response
One clue: The very first test (before we modified any trunks) DID receive a 404 Not Found SIP response from LiveKit — so connectivity worked at that point.
After deleting and recreating the inbound trunk (same number, same config), all subsequent tests show no SIP response at all.
Questions:
1. Is there a propagation delay after creating/deleting inbound trunks that could explain this?
2. Is there a way to see SIP-level logs on the LiveKit side to confirm whether INVITEs are arriving?
3. Are we missing anything in the setup?tall-airline-16756
02/18/2026, 3:27 PMtall-airline-16756
02/18/2026, 3:28 PMlk agent logs --log-type=deploy --id=<agent-id>) and Agent Observability to surface SIP participant events and call lifecycle logs. Raw packet dumps of SIP at the very edge are not exposed directly, but connection/INVITE attempts and any SIP responses that LiveKit generates should appear in those logs.
3) Are you missing anything in the setup?
• Your setup (TwiML Dial->Sip URI, trunk created, dispatch rule) aligns with the documented approach. The first-test 404 indicates an INVITE did reach LiveKit initially (and LiveKit responded Not Found). The later tests with “no SIP response” indicate the INVITE likely did not reach LiveKit’s SIP edge or is being dropped before LiveKit can respond (could be trunk inactive, TLS/network filtering, DNS/TLS mismatch, or routing to a different tenant/project after recreation). Recreating a trunk may require a short propagation time or re-validation of the number/trunk binding.
Recommended next steps (quick, in-priority order)
1. Wait 3–5 minutes after creating/recreating the trunk, then retest a call once. Note the timestamp.
2. Run CLI logs around test time:
◦ lk agent logs --log-type=deploy --id=<agent-id> --since "<timestamp>"
◦ Check for SIP participant join/INVITE or dispatch rule activity.
1. Collect Twilio-side traces:
◦ Export the Twilio SIP trace or Twilio Debugger events and the Twilio call SID(s) for failing attempts.
1. Confirm the exact TwiML and SIP URI used in the Dial→Sip element (include full host, port, and ;transport if present).
2. Do a quick network/TLS check from a machine you control:
◦ DNS resolution of the SIP host (e.g., `dig`/`nslookup`)
◦ TLS handshake check (e.g., openssl s_client -connect <host>:<port> -servername <host>) — if you used ;transport=tls.
1. If you can, test using LiveKit Phone Numbers (simpler path) to confirm behavior without SIP dialing.
What I need from you to continue troubleshooting Please provide the following so I can inspect logs and guide you precisely:
• LiveKit project ID or agent ID and region/cluster if known.
• Exact timestamps (with timezone) of:
◦ the initial test that returned 404, and
◦ one or two subsequent tests that returned “Failed” with no SIP response.
• Twilio call SID(s) and any Twilio SIP trace / Debugger output for those calls.
• The exact TwiML returned (the full, unredacted SIP URI as Twilio used it — host, port, and whether ;transport=tls was included).
• Trunk config details in LiveKit (auth type: credential/none, auth username used, and whether trunk shows active in console/CLI).
• Whether you tested with LiveKit Phone Numbers or Elastic SIP Trunks and if behavior differs.
• Results (or whether you ran) these CLI checks: lk agent logs --id=<agent-id> --since "<timestamp>".
If you share those items I’ll:
• Check whether INVITEs reached the SIP edge in the logs you provide and point to any SIP-level responses we see.
• Suggest exact config changes or further network/TLS checks if INVITEs aren’t reaching LiveKit.
• Walk through using LiveKit Phone Numbers as a quick test alternative if you want to avoid SIP auth complexity.
Thanks — once you post the timestamps, call SIDs, and TwiML/SIP URI I’ll dive into the logs with you and help isolate the cause.
Sources: Handling asynchronous metadata updates in LiveKit | LiveKit | Ensuring Unique Room IDs with Dynamic Room Names | LiveKit | Say hello to improved Cloud analytics | sip | livekit/livekit_composite | DeepWiki | SIP Lifecycle Management Agent | LiveKit Documentationmagnificent-monitor-48407
02/18/2026, 3:44 PMtall-airline-16756
02/18/2026, 3:45 PMlk sip inbound list and verify the number is present.
1. Confirm the dispatch rule is present and points to that trunk and a valid room prefix or agent:
◦ Run: lk sip dispatch list and inspect the rule that references the trunk’s sip_trunk_id.
1. Re-test after a short wait:
◦ If you recently recreated the trunk/rule, wait ~3–5 minutes before testing again to allow state propagation.
1. Verify TwiML and SIP URI exactly match LiveKit’s expected format:
◦ Your TwiML should reference the LiveKit SIP destination (full host, optional port, and ;transport=tls if using TLS). Example: <Sip>sip:token@<your-project>.sip.livekit.cloud;transport=tls</Sip>
1. If using IP/credential restrictions, ensure Twilio’s outbound IPs (e.g., 54.172.60.0) are allowed in the trunk config.
What I will check / what I need from you Please share the following so I can inspect logs and guide you precisely:
• LiveKit project ID or agent ID and region/cluster (if available).
• Exact timestamps (with timezone) for:
◦ The initial test that returned 404, and
◦ One or two subsequent tests that either returned “Failed” with no SIP response or another 404.
• Twilio call SID(s) for those tests and any Twilio Debugger or SIP trace output you can export.
• The full TwiML you returned (unredacted SIP URI host/port/transport).
• Trunk configuration details in LiveKit:
◦ Auth type (credential / none),
◦ Auth username (if used),
◦ Whether the trunk shows active in the console/CLI.
• The SIP Call ID shown in your screenshot: 15b537ac844fa27ca30f8b8b27eb4e15 (you already provided this — thanks).
What I’ll do once you provide those items
• Check LiveKit logs around the timestamps you give to confirm whether INVITEs reached the LiveKit SIP edge and what response LiveKit returned.
• If INVITEs reached LiveKit, I’ll point to the exact SIP response and the likely misconfiguration (missing dispatch rule, mismatched number, host, or room).
• If INVITEs did not reach LiveKit, I’ll recommend targeted network/TLS checks and Twilio-side settings to resolve the transit problem.
Helpful extra tests (optional)
• From any machine you control, test DNS/TLS to the SIP host used in your TwiML:
◦ `dig`/`nslookup` for the SIP host
◦ openssl s_client -connect <host>:<port> -servername <host> (if using TLS) to check certificate/TLS handshake
• Try a single test call using LiveKit Phone Numbers (if available to you) to rule out Twilio SIP dialing complexity.
Thanks — if you paste the timestamps, call SIDs, and the exact TwiML/SIP URI you used, I’ll start with the logs and get back with what LiveKit saw and the next concrete steps to restore inbound calls.
Sources: sip | livekit/livekit_composite | DeepWiki | Preserve caller ID during SIP transfers with Twilio | LiveKit | Agents telephony integration | LiveKit Documentation | Accepting calls overview | LiveKit Documentation | Say hello to improved Cloud analyticsmagnificent-monitor-48407
02/18/2026, 3:49 PMtall-airline-16756
02/18/2026, 3:50 PM<Sip username="..." password="..."> causes the outgoing INVITE to include credentials in the Authorization header. LiveKit’s SIP gateway can treat that as an unexpected/unauthorized authenticated request and respond with 404 (or otherwise reject it) before dispatch routing succeeds.
• Evidence in your data:
◦ The initial 404 shows the INVITE reached LiveKit and LiveKit could not find a valid destination for that authenticated request.
◦ Your Elastic SIP trunk works because it uses IP-based trust without inline TwiML credentials — same agent, different transport/auth model.
Why this happens (concise)
• Twilio’s TwiML `username`/`password` yields an Authorization header on the INVITE.
• If LiveKit is not configured to accept those credentials (no matching auth on the trunk), the SIP gateway may treat the request as unauthenticated/malformed and not match it to the trunk/dispatch rule, resulting in 404 Not Found.
• When the TwiML has no credentials, Twilio sends a “clean” INVITE (no Authorization header) and LiveKit matches by number/trunk/dispatch rule (the same model that works for your Elastic trunk).
Immediate action (what to change now)
1. Remove credentials from your TwiML and re-test:
◦ Replace your current TwiML with:
<?xml version="1.0" encoding="UTF-8"?> <Response> <Dial> <Sip>sip:+14694617341@feather-8jcqksm6.sip.livekit.cloud;transport=tls</Sip> </Dial> </Response>
• Wait ~3–5 minutes after changing TwiML or trunk settings, then place a test call.
Verification & diagnostics I can help with Please run these and share results/timestamps if the issue persists:
1) Confirm trunk & dispatch again (CLI)
• lk sip inbound list — confirm ST_3XvhUamhKgzN shows number +14694617341 and active.
• lk sip dispatch list — confirm SDR_pQsxiD8QhdEU references ST_3XvhUamhKgzN and the roomPrefix.
2) Capture logs around your test (send me these)
• Test time(s) in UTC (you already gave: 10:00 UTC and 10:03 UTC on Feb 18).
• Twilio child SIP leg Call SIDs you listed (I have them):
◦ CA0dc5133a...646285
◦ CAb3e97b464e...5d5
• SIP Call ID: 15b537ac844fa27ca30f8b8b27eb4e15 (you provided).
3) If the 404 persists after removing TwiML credentials:
• Share the new test timestamp + call SID and I’ll check LiveKit logs for INVITE receipt and the exact SIP response.
• If there is no SIP response (Twilio shows “Failed” with zero duration), we’ll run network/TLS checks next.
Optional hardening (if you want credentials instead of IP trust)
• If you need TwiML to include credentials, create a trunk with that credential set in LiveKit (auth enabled) that matches the username/password Twilio will send. Then Twilio’s Authorization header will match LiveKit’s expected credentials.
• Or, use allowed_addresses to only accept Twilio’s SIP IP ranges (IP-based trust) and keep TwiML without credentials.
Extra checks you can run (optional, helpful when no response)
• DNS/TLS test from any server:
◦ dig feather-8jcqksm6.sip.livekit.cloud
◦ openssl s_client -connect feather-8jcqksm6.sip.livekit.cloud:5061 -servername feather-8jcqksm6.sip.livekit.cloud
• Confirm Twilio is not inserting credentials even when you remove them from TwiML (it won’t, but worth confirming).
Summary / next step I recommend now
• Remove the username and password from your TwiML and test again after 3–5 minutes. If that fixes it, we’re done.
• If it still fails, send me the new test timestamp + Twilio call SID and I’ll pull the LiveKit logs for that exact moment and tell you whether the INVITE reached our SIP edge and what response LiveKit returned.
You already gave the useful identifiers (project: feather-8jcqksm6, trunk ST_3XvhUamhKgzN, dispatch SDR_pQsxiD8QhdEU, SIP Call ID). If you want, paste the new test timestamp and call SID after you re-test without credentials and I’ll dig into the logs right away.
Sources: Understanding TLS in SIP | LiveKit | sip | livekit/livekit_composite | DeepWikimagnificent-monitor-48407
02/18/2026, 5:01 PMtall-airline-16756
02/18/2026, 5:02 PMlk sip inbound show --sip_trunk_id ST_3XvhUamhKgzN (full JSON output)
• lk sip dispatch show --sip_dispatch_rule_id SDR_pQsxiD8QhdEU (full JSON)
• lk agent logs --log-type=deploy --id=<agent-id> --since "<timestamp>" for the test time (if you know the agent id). If you don’t know agent-id, lk agent list will show agents.
What I’ll check once you provide those
• Confirm the inbound trunk JSON includes the number exactly as E.164 +14694617341 and that there are no accidental characters or spaces.
• Confirm the dispatch rule JSON shows the trunk ID in trunkIds and the roomPrefix you expect.
• Search LiveKit logs for the SIP Call ID and timestamp to see the precise rejection reason. The logs will show whether LiveKit:
◦ matched the trunk but failed to route to a room/agent,
◦ rejected the request because the dialed number didn’t match any trunk,
◦ or rejected due to a mismatch in the SIP Request-URI / Host header.
A few targeted checks you can do immediately
• Confirm the inbound trunk number appears exactly as +14694617341 (no brackets, no hidden characters).
• Confirm the TwiML Dial->Sip uses the same full domain as in your trunk: sip:+14694617341@feather-8jcqksm6.sip.livekit.cloud;transport=tls
◦ If Twilio is truncating or altering the host header, that can prevent matching.
• Check if any other trunk claims that number (unlikely, but possible in multi-tenant misconfiguration).
If trunk and dispatch JSON look correct but 404 continues
• I will look for log lines like “no trunk matched for request” or “dispatch not found” for the SIP Call ID/time you provide. That will tell us whether LiveKit searched for that number and couldn’t find it, or whether it found the trunk but the dispatch step failed.
Optional quick test to isolate routing vs. identity:
• If you can temporarily add an additional trunk with a different trunk id that also lists the number and a very simple dispatch rule (roomPrefix "test-"), try a call. If that routes, it indicates the original dispatch rule or its roomPrefix is the problem. If it still 404s, the problem is the number/trunk mapping or domain.
If you want me to interpret the CLI JSON for you, paste those outputs and I’ll point out any mismatch (numbers, trunkIds, roomPrefix format, allowed_addresses, auth flags, etc.).
Next actions I’ll take for you
• Once you post one new test timestamp + call SID + SIP Call ID (and/or the CLI outputs), I’ll search logs for the exact INVITE handling and tell you:
◦ exactly why the 404 was returned (missing number, host mismatch, dispatch rule not applicable, or other),
◦ the minimal fix to apply (trunk update, dispatch update, domain correction, or adding allowed_addresses),
◦ and steps to re-test.
Thanks — if you can paste:
• One new test timestamp (UTC),
• The Twilio child SIP leg Call SID for that test,
• The outputs of the two lk show commands (or paste the JSON trunk/dispatch you already have),
I’ll dive into the LiveKit logs and give a precise root cause and the exact config change to fix it.
Sources: Accepting calls overview | LiveKit Documentation | sip | livekit/livekit_composite | DeepWiki