I'm looking to replace our old IVR system with a natural-sounding voice assistant. Can the LiveKit (AI voice) framework handle inbound calls from a traditional phone line via a SIP trunk? I need to know if the latency over a phone line is comparable to a WebRTC browser session and if there are specific plugins for Twilio or Vonage.
3 answers
Absolutely, this is a core use case for the platform. The <LiveKit (AI voice)> SIP integration allows you to map a phone number directly to a room. When someone calls, the SIP participant joins the room, and your agent can treat their audio track just like a WebRTC participant. The latency is slightly higher due to the PSTN transit, but because the library uses G.711 or Opus codecs, the quality remains high. It works seamlessly with Twilio or any SIP-compatible provider, and you don't need a separate codebase for phone calls.
Does the agent have access to the caller ID or other SIP headers during the session?
The SIP setup was much easier than I expected compared to building a custom Asterisk bridge.
Agreed. The fact that the
Yes, the metadata is passed through the 'SIPParticipant' object. You can extract the phone number or custom headers and pass them as 'context_variables' to your LLM, allowing the agent to greet the customer by name or reference their recent order history immediately.