I am using livekit via twilio . If the user says t...
# ask-ai
s
I am using livekit via twilio . If the user says they want to talk to another human the agent should transfer the call to another number but still be in the call in mute. How to do that?
t
Thanks for reaching out, Rahul. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To transfer a LiveKit call to another number via Twilio while keeping the original agent connected but muted, follow this approach: • Add the New Participant: Use the
create_sip_participant
API to conference in the new participant (phone number) into the existing LiveKit room. This dials out and brings the second human into the call alongside the agent. • Mute the Agent: Once the new participant joins, mute the agent’s audio track in the room (this can be done programmatically using LiveKit's track muting functionality). The agent remains in the call (can listen but not speak) and can be unmuted later if needed. This design keeps everyone in the same LiveKit room, allowing precise control over who can speak and making it possible for the agent to unmute or monitor as needed. If you need implementation details (APIs/code examples in Python or TypeScript), let me know which programming environment you’re working in and I can provide targeted code samples. Sources: livekit-agents/livekit/agents/job.py | Publishing tracks | LiveKit Docs | Inbound calls with Twilio Voice | LiveKit Docs | telephony/sip_lifecycle.py | SIP APIs | LiveKit Docs | examples/src/outbound.ts