for inbound calls, what is the threshold at which ...
# ask-ai
i
for inbound calls, what is the threshold at which the call is "picked up" by the agent? is it when AgentSession.start() is called?
✅ 1
t
Thanks for reaching out, Ed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — good question. You're asking which event marks an inbound call as "picked up" by the agent and whether that corresponds to calling
AgentSession.start()
. Yes — an inbound call is considered "picked up" when
AgentSession.start()
is called. Calling
start()
moves the session from initializing into the starting/running lifecycle: it connects the agent to the room, sets up I/O (audio/video) forwarding, and begins processing user input — in other words, the agent is actively listening and interacting with the caller once
AgentSession.start()
runs. If you need, I can: • Walk through the exact sequence of lifecycle states (
Initializing
→
Starting
→
Running
) and which actions happen in each. • Show a short code example of calling
AgentSession.start()
and handling the post-start events you can listen to. Which would be more helpful? Sources: Agent session | LiveKit Documentation, with interactive elements
i
so lets say i get an inbound call and i want to transfer it right away, i dont even really want an agent to join the call, i cant transfer the call while its in a ringing status though
t
Thanks — I hear you: you want to forward an inbound call immediately, without an agent ever actually joining, but you’re blocked because the call is still in ringing. Short answer: • You cannot transfer a call while it is still in the ringing state. The call must be answered/connected before LiveKit’s transfer APIs can be used. What you can do (two practical options): • Auto-answer and immediately transfer with a lightweight bot ◦ Deploy a minimal automated participant (a bot or lightweight agent) that calls
AgentSession.start()
or otherwise answers the SIP leg as soon as the inbound call arrives. ◦ As soon as the session becomes active, have that bot call the SIP transfer API (for example,
transfer_sip_participant
/ SIP REFER) to redirect the call. The bot can then drop or remain silent so no human agent ever interacts with the caller. ◦ This effectively simulates a pre-answer transfer by answering and immediately performing the transfer. • Handle the redirect at the SIP/provider level before LiveKit ◦ Configure your SIP provider (Twilio, Telnyx, etc.) to perform routing/forwarding rules so the call is redirected before it ever reaches LiveKit. This avoids answering in LiveKit entirely. ◦ Use your provider’s call-control features (e.g., Twilio’s call forwarding/redirect or SIP REFER prior to LiveKit) to achieve immediate transfers. If you’d like, I can help with either approach: • For the bot option I can outline the minimal sequence of calls/events and a small code snippet showing where to call
AgentSession.start()
and then
transfer_sip_participant
. • For the SIP/provider route I can list the provider features to look for and typical configuration patterns. Which approach would you prefer to explore first? Sources: SIP Lifecycle Management Agent | LiveKit Documentation | Company directory phone assistant | LiveKit Documentation | Agents telephony integration | LiveKit Documentation | Handling payments with PCI compliance | LiveKit | Preserve caller ID during SIP transfers with Twilio | LiveKit, with interactive elements
i
so theres no way to transfer the call and keep it ringing
t
You're right — there is no way to transfer a call while it stays in the ringing state. Why: LiveKit's transfer operations require the call to be connected/answered first. Transfer APIs (SIP REFER /
transfer_sip_participant
) operate on an active session, not on a ringing leg. Workarounds you can use: • Auto-answer with a lightweight bot ◦ Have a minimal automated participant answer the call (call
AgentSession.start()
or otherwise accept the SIP leg). ◦ Immediately call the transfer API to redirect the call, then drop or stay silent. This gives the effect of an immediate transfer without a human agent interacting. • Handle the redirect at the SIP provider ◦ Configure routing/forwarding rules in your SIP provider (Twilio, Telnyx, etc.) so the call is redirected before it ever reaches LiveKit. This avoids answering in LiveKit entirely. If you want, I can: • Provide a short code sketch for the bot approach showing where to start the session and invoke the transfer. • Outline the specific provider-side features and settings to look for (for common providers like Twilio or Telnyx). Which option would you like to explore? , with interactive elements
i
is it possible at all to transfer inbound calls without having an agent answer them? like in the request_fnc or anything like that?
t
Thanks — I understand you want to transfer inbound calls without ever answering them (for example, by using a hook like
request_fnc
) so the call keeps ringing. Short answer: you cannot. Why: transfer operations require an active/answered session. LiveKit’s transfer APIs (SIP REFER /
transfer_sip_participant
) operate on a connected call, not a ringing leg. Programmatic hooks that run while the call is still ringing (such as request handlers) cannot perform a transfer that keeps the call in ringing — the call must be answered first. Practical alternatives you can use: • Auto-answer with a lightweight bot ◦ Have a minimal automatic participant answer immediately (
AgentSession.start()
or equivalent), then invoke the transfer API right away. The bot can then drop or stay silent so no human interacts with the caller. ◦ This effectively simulates an immediate transfer while keeping the caller experience seamless. • Redirect at the SIP/provider level ◦ Configure your SIP provider (Twilio, Telnyx, etc.) to route or forward the call before it reaches LiveKit. Provider-side call-control can redirect calls prior to LiveKit receiving the ringing leg. I can help with next steps: • Provide a short code sketch showing the minimal bot flow (answer → call
transfer_sip_participant
→ exit). • Outline the provider-side features and typical setup for common providers (Twilio/Telnyx) that let you redirect before LiveKit. Which would be most helpful for you? , with interactive elements