kind-postman-17041
11/24/2025, 1:43 AMtall-airline-16756
11/24/2025, 1:43 AMtall-airline-16756
11/24/2025, 1:43 AM100 Processing / 180 Ringing then a 408 without an agent being dispatched. I’ll focus on what can be changed to get dispatch to complete.
What I’m responding to: the SIP INVITE to your inbound trunk gets acknowledged (100/180) but no agent joins and the call times out with 408.
Quick checklist you can run now
• Confirm the agent_name in your agent code exactly matches agentName in the dispatch rule (case-sensitive).
• Verify the dispatch rule applies to the trunk receiving the INVITE (either includes that trunk’s ID in trunk_ids or leaves trunk_ids empty).
• Ensure the agent process is running, connected, and has available workers (lk agent status or agent logs).
• Increase the trunk’s ringing_timeout (try 30–45s) so LiveKit waits longer for the agent to join.
• Test with a minimal agent that logs on session.start to confirm the dispatch entrypoint is reached.
• Check LiveKit server logs around the INVITE for dispatch attempts or errors and for messages like “no room context” which indicate session setup delays.
What I need from you to diagnose further
• The exact dispatch rule JSON.
• The agent code snippet that includes @server.rtc_session(agent_name=...).
• LiveKit server and agent logs spanning the INVITE → repeated 180s → 408.
• Whether this is consistent or intermittent.
If you share those, I’ll look for mismatched names, trunk-rule mismatches, agent health/registration issues, or timing problems and give targeted next steps.
Sources: SIP dispatch rule | LiveKit docs | Agents telephony integration | LiveKit Docs | Using Wavix to accept and make calls | LiveKit docs | SIP Integration & Telephony | livekit/livekit_composite | DeepWiki | SIP APIs | LiveKit docskind-postman-17041
11/24/2025, 1:44 AMtall-airline-16756
11/24/2025, 1:44 AM@server.rtc_session(agent_name=...).
• LiveKit server logs and agent logs covering the INVITE → repeated 180s → 408 for a failing call (timestamps help).
• Whether these failures correlate with higher call concurrency or CPU/memory spikes on the agent or LiveKit servers.
• Your inbound trunk ringing_timeout value and whether 30s matches it.
• Whether this happens for specific calling numbers or trunks only, or truly random.
With those artifacts I’ll look for mismatched agent_name, trunk-rule mismatches, agent registration/worker availability, or timing/resource contention and give concrete next steps. Would you like instructions for pulling the exact logs if you need them?kind-postman-17041
11/24/2025, 1:49 AMtall-airline-16756
11/24/2025, 1:49 AMringing_timeout value.
• The exact dispatch rule JSON and the agent code snippet with @server.rtc_session(agent_name=...).
• Output of lk agent status taken near the failure (if available).
• Note: any recent network or firewall changes, NAT flaps, or restarts around that time.
If you prefer, share one call's SIP trace (INVITE/ responses) and I’ll correlate SIP timing with LiveKit/agent logs to identify whether the agent never received the dispatch, received it but failed to join, or joined too late. Which log file(s) would you like instructions for extracting?kind-postman-17041
11/24/2025, 1:52 AMtall-airline-16756
11/24/2025, 1:52 AMringing_timeout to 30–45s to give more headroom for slow joins.
• Add lightweight health checks and ensure agents stay continuously connected and have spare workers.
• Add logging on the agent entrypoint (e.g., log immediately on session.start) to confirm whether dispatch requests reached the agent.
• Correlate SIP traces with LiveKit and agent logs for failing calls to see whether dispatch was sent, received, or dropped.
• Consider redundancy: run multiple agent workers with the same agent_name so one can pick up dispatch if another is transiently unavailable.
• Monitor agent registration and WebSocket reconnects so transient disconnects are visible and alerted.
If you’d like, I can:
• Analyze one failing call if you share the SIP trace + LiveKit server logs + agent logs for that call.
• Suggest specific config values for ringing_timeout and health-check intervals based on your current settings.
Which would you prefer?