bitter-analyst-30633
05/07/2026, 11:04 AMtall-airline-16756
05/07/2026, 11:04 AMtall-airline-16756
05/07/2026, 11:04 AMbitter-analyst-30633
05/07/2026, 11:04 AMtall-airline-16756
05/07/2026, 11:04 AMmetrics_collected event during a session and check for RealtimeModelMetrics.
• Read TTFT for time-to-first-audio-token, and use duration/TTFB/TTFT plus tokens/sec to measure other latency components.
• Aggregate metrics per response to compute averages, percentiles, or alert thresholds.
Options for viewing and troubleshooting:
• Use the Agent Observability dashboard (LiveKit Cloud) for latency breakdowns and synchronized audio playback to inspect exact timings.
• Log and render metrics server-side (example patterns exist using formatted tables or dashboards) to analyze trends and correlate with traffic or model choice.
If you want, tell me:
• Which SDK/language you’re using (e.g., Python Agents SDK v1.3+), and
• Whether you’d like a code example to listen for metrics_collected and extract TTFT and duration. Sources: Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | How can I reduce latency in voice agents using STT, TTS and LLM?, with interactive elementsbitter-analyst-30633
05/07/2026, 11:29 AMtall-airline-16756
05/07/2026, 11:29 AMinput_speech_stopped event, which the Agents framework (e.g., RealtimeSession) uses for turn detection when realtime_llm is used.
Sources: How does end-of-utterance detection work in conversations?, with interactive elementsbitter-analyst-30633
05/11/2026, 11:33 AMtall-airline-16756
05/11/2026, 11:34 AMsip.callStatus can have. I don't have the enum documented here, so I need one quick detail to proceed:
• Where are you seeing sip.callStatus? (e.g., participant attributes in LiveKit Cloud, a webhook payload, SDK logs, or an API response)
If you can paste a redacted sample payload or tell me Cloud vs self-hosted and the server/SDK version, I can either interpret the value you're seeing or provide the full list of possible statuses.
, with interactive elementsbitter-analyst-30633
05/11/2026, 11:36 AMtall-airline-16756
05/11/2026, 11:36 AMsip.callStatus, how those states map to SIP signaling, and what happens when an external provider (like Plivo) fails to complete the call.
How LiveKit tracks sip.callStatus
• LiveKit observes SIP signaling and provider events for the outbound/inbound call and updates sip.callStatus based on those signals.
• Typical mappings:
◦ `dialing`: outbound INVITE sent / waiting for answer.
◦ `ringing`: 180/183 responses or remote endpoint ringing for inbound calls.
◦ `active`: call confirmed (e.g., 200 OK + ACK or the SIP participant subscribes to remote audio tracks).
◦ `automation`: used when DTMF dialing is in progress after the call connects; status moves to active when DTMF dialing completes and the call is fully established.
◦ `hangup`: call ended; LiveKit uses disconnect reasons to indicate why.
How LiveKit knows the call state with a provider like Plivo
• LiveKit relies on the SIP/provider signaling and events coming from the telephony provider to determine state transitions. When Plivo (or another provider) returns SIP responses or callbacks indicating ringing, answered, or failed outcomes, LiveKit updates the participant sip.callStatus accordingly.
• The Agents/framework detects the participant subscribing to remote audio tracks as part of determining active.
What happens if you create a SIP participant but the provider call fails (e.g., number not reachable)
• Creating a SIP participant can succeed locally in LiveKit while the outbound provider call still fails asynchronously.
• If the provider reports failures (no route, number unreachable, busy, timeout, etc.), LiveKit will update sip.callStatus to hangup and include the appropriate disconnect reason. The participant will reflect that the call ended even though creation initially succeeded.
If you want, tell me:
• A sample webhook or participant attribute payload you’re seeing (redact sensitive data), or
• Which provider and failure case you want to test (e.g., unreachable number, busy, no route),
and I’ll help map the exact SIP responses/Plivo callbacks to the sip.callStatus and disconnect reason you should expect.
, with interactive elementsbitter-analyst-30633
05/11/2026, 11:41 AMtall-airline-16756
05/11/2026, 11:41 AMsip.callStatus based on SIP signaling and provider events.
• LiveKit marks a participant as dialing when an outbound INVITE is sent and the call is awaiting answer (provisional/early session).
• Subsequent provider signals update the status:
◦ Provisional responses (180/183) or ringing → ringing (for inbound ringing semantics).
◦ 200 OK + ACK or the participant subscribing to remote audio → active.
◦ Provider errors (no route, unreachable, busy, timeout, etc.) → hangup with a disconnect reason.
• If you create the SIP participant successfully but the provider (Plivo) later fails to complete the call, LiveKit will transition from dialing to hangup when the failure is reported and include the appropriate disconnect reason.
If you want, I can show an example SIP/provider event flow (INVITE → 180/183 → 200/ACK → hangup) or map specific Plivo callbacks/errors to the sip.callStatus and disconnect reasons. Which specific failure case should I map?
, with interactive elements