Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
Dev.to AI · 2026/7/21 12:41:00
Eliminate Dead Air in AI Voice Assistants with Filler Messages — Telnyx AI Assistant Webhook Demo
AI 中文解读
AI语音助手打电话时遇到查询订单、查数据库这类操作,通常会有几秒的静默等待,这对用户来说像过了半分钟,容易挂断或投诉。Telnyx最新方案给AI配上了“填充话术”——在等待后台响应时,AI会主动说“我帮你查一下”、“稍等一下马上就好”这类自然过渡语,让通话保持流畅。整套方案只需124行Python代码就能搭建,还能实时显示话术触发的时间轴。这技术最直接的改变是:以后你给客服或智能助手打电话,再也不用忍受死寂般的等待,AI会像真人一样用“我来看看”这类话填满等待时间,通话体验瞬间提升。对企业来说,这意味着更少的挂断投诉和更高的客户满意度,同时不用改造后台系统就能实现。
<p>When an AI voice assistant calls a sync webhook tool — to look up an order, query a database, check inventory — the caller hears silence. Five seconds of dead air on a phone call feels like thirty. Hang up. Call again. Complaint filed.</p>
<p><strong>Filler messages</strong> solve this. Configured per-tool in Telnyx Mission Control, they let the AI Assistant speak scripted phrases while waiting for the webhook to respond: "Let me look that up for you." at 0 seconds, "Still working on this, one moment please." at 5 seconds, "Almost there, thanks for your patience." at 15 seconds. The caller stays engaged. The webhook takes the time it needs. No dead air.</p>
<p>This walkthrough builds a complete demo: a Flask webhook server with a live split-screen dashboard that shows the webhook call, the filler messages firing, and the countdown in real time. 124 lines of Python, one AI Assistant, one phone number, one dashboard — and zero silence.</p>
<h2>
What You'll Build
</h2>
<p>A webhook server that an AI Assistant calls when a caller asks about an order:</p>
<ul>
<li>
<strong>Caller dials the AI Assistant</strong> — a voice AI agent configured in Mission Control</li>
<li>
<strong>Caller asks a question</strong> — "What's the status of my order 12345?"</li>
<li>
<strong>AI Assistant calls the webhook</strong> — a sync tool call to <code>/webhook/order-status</code>
</li>
<li>
<strong>Webhook delays</strong> — intentionally sleeps for 12 seconds (configurable) to simulate a slow backend</li>
<li>
<strong>Filler messages fire</strong> — the AI Assistant speaks scripted phrases at 0s, 5s, and 15s while the webhook is processing</li>
<li>
<strong>Webhook responds</strong> — returns mock order status as JSON</li>
<li>
<strong>AI Assistant reads the result</strong> — "Your order 12345 has shipped via FedEx, tracking number FX-98765, estimated delivery July 20th."</li>
<li>
<strong>Dashboard shows everything</strong> — a split-screen browser UI with the call timeline on the left and server logs on the right, updated in real time via Server-Sent Events</li>
</ul>
<h2>
Why Filler Messages Matter
</h2>
<p>Every voice AI developer hits the same problem: sync webhook tool calls take time. A database query takes 2 seconds. A third-party API takes 5 seconds. A complex lookup takes 10 seconds. On a phone call, that's dead air — and dead air is the enemy of conversation.</p>
<p>Without filler messages, developers build workarounds:</p>
<ul>
<li>
<strong>Background music</strong> — doesn't tell the caller what's happening</li>
<li>
<strong>"Please hold" TTS</strong> — fires once, then silence resumes</li>
<li>
<strong>Async tools</strong> — more complex to build, don't work for all use cases</li>
<li>
<strong>Faster webhooks</strong> — not always possible when you depend on external systems</li>
</ul>
<p>Filler messages are the carrier-grade solution: the AI Assistant speaks configurable phrases at configurable intervals while the webhook processes. The caller knows the system is working. The developer doesn't have to build a workaround.</p>
<h2>
Prerequisites
</h2>
<ul>
<li>Python 3.8+</li>
<li>A <a href="https://portal.telnyx.com/" rel="noopener noreferrer">Telnyx account</a> with funded balance</li>
<li>A <a href="https://portal.telnyx.com/api-keys" rel="noopener noreferrer">Telnyx API key</a>
</li>
<li>A <a href="https://portal.telnyx.com/numbers/my-numbers" rel="noopener noreferrer">Telnyx phone number</a> assigned to an AI Assistant</li>
<li>An <a href="https://portal.telnyx.com" rel="noopener noreferrer">AI Assistant</a> with telephony enabled</li>
<li>
<a href="https://ngrok.com/" rel="noopener noreferrer">ngrok</a> for exposing your local server</li>
</ul>
<h2>
The Architecture
</h2>
<div class="highlight js-code-highlight">
<pre class="highlight plaintext"><code> Caller dials AI Assistant
│
▼
┌──────────────────────┐
│ Telnyx AI Assistant │
│ (Mission Control) │
分享
阅读原文 ↗