Skip to main content
There are three ways to let AI talk with people during calls, ordered from least to most development effort:

Built-in AI voice agent

The media gateway has a built-in voice agent: a visitor clicks “Start conversation” on a web page, the AI greets them, and from then on they can chat as on a phone call; they can interrupt the AI at any time while it’s speaking. Recognition, LLM, and synthesis all use the services configured in the AI profile, and all of them can be self-hosted.

What you can configure

All of these are changed only in the admin console and take effect from the next conversation; with multiple media gateways they stay consistent automatically. The trial page is for visitors only and has no settings.

Trial page

After deployment, open the trial page through the gateway’s address, choose a profile, language (中文 / English), and microphone, and click “Start conversation”. The page shows both sides’ text in real time and the AI’s state (listening / thinking / speaking). “AI noise suppression” on the page is on by default and removes steady noise such as fans, keyboards, and air conditioning; if it fails to load, the page falls back to the browser’s built-in noise suppression without affecting the call.
  • HTTPS is required: browsers only allow web pages to use the microphone over HTTPS, so the trial page must be opened over HTTPS through the reverse proxy at the platform entry point; we configure this at deployment
  • We recommend setting an access passcode: without one, anyone who can open the page can start conversations (consuming LLM quota). With one, visitors enter the passcode the first time they open the page
  • We recommend wearing headphones: a computer’s built-in microphone picks up people nearby, who may interrupt the AI or be taken as the visitor’s speech

How it decides “started speaking” and “finished speaking”

  • Started speaking: when the recognition service returns an interim result that still has at least 2 characters after removing filler words such as “um” and “uh”, the visitor is considered to have started speaking; if the AI is talking, it stops immediately (interruption). A single “mm” or “OK” does not interrupt the AI
  • Finished speaking: once the recognition service decides a sentence has ended (about 0.8 seconds of pause), the sentence is sent to the LLM for an answer
  • Volume gate: the threshold adapts to each visitor’s background noise level, blocking speech from people farther away and background noise to avoid false interruptions
  • Greeting protection: the first 1.5 seconds of the greeting cannot be interrupted, so noise right after a visitor joins doesn’t cut it off
This avoids deploying a separate voice activity detection model and keeps the offline package smaller. AI noise suppression does little against people talking nearby, so headphones are still recommended in noisy open offices. The trade-offs: interruption is about 0.3 seconds slower than with a dedicated detection model; since “finished” is judged by pauses alone, a slightly longer pause mid-sentence is taken as the end; English conversations have no interim results, so the AI can only be interrupted after the visitor finishes a whole sentence.

Limits and duration

  • Each conversation uses 2 user concurrency slots (visitor + AI)
  • When the visitor says goodbye, the AI says goodbye and hangs up automatically
  • Timeouts catch a stalled LLM or speech synthesis, so the AI never stays “thinking” forever; for voice scenarios, we recommend turning off thinking mode in the LLM service, otherwise the first sentence is noticeably slower

Troubleshooting

Per-turn latency breakdown: when the AI is slow to respond after the visitor finishes speaking, the media gateway’s logs and metrics break down each turn’s time into stages—recognition wrap-up, LLM first token, first-sentence buffering, first-sentence synthesis, and waiting for playback—so you can see at a glance whether recognition, the LLM, or synthesis is slow. Session recording: to reproduce problems such as “misheard” or “interrupted by mistake”, you can temporarily turn on session recording. Each conversation is saved in its own directory: Both recordings are 16 kHz mono and aligned to the start of the conversation, so you can load them into an audio editor and listen side by side. Turn it on under modules.agent.record in the media gateway configuration:
Session recording saves the visitor’s original audio and the conversation content, which involves privacy. Turn it on only temporarily while troubleshooting, then turn it off and delete the recordings.

Known limitations

  • Each AI sentence is played only after the whole sentence is synthesized; first-response time ≈ recognition finalization + LLM generating the first sentence + synthesizing one sentence
  • One conversation serves one visitor; multiple people can’t talk to the AI in the same conversation
  • The web trial page is currently the only entry point; it doesn’t answer phone calls directly—for phone calls, see below
  • Tool calling (such as querying business systems) isn’t supported; if you need it, go with “Build your own agent”

Build your own agent

When you need to connect business systems, look up data, call tools, or use real-time voice LLMs, use the Python SDK to have your program join the channel as a user, receive audio itself, connect any recognition / LLM / synthesis service, and send the AI’s voice back into the channel: The agent appears in the channel like any other user, and people on web, apps, and in meetings can all talk with it.

Connect phone calls to AI

Once a carrier SIP trunk or the customer’s existing IP-PBX is connected to the device gateway, each incoming call is a regular user in a channel. Your backend creates a channel for each call and brings an agent you built into the same channel, enabling AI phone customer service and AI outbound calls. See Connect phone lines.