# 从 Twilio 迁移 Voice

盘点 TwiML、Studio 或应用程序生成的指令、Voice SDK 客户端、ConversationRelay 会话、录音和回调端点。将电话连接与你打算保留的应用程序行为分开。

## 梳理呼叫行为

将已定义的提示和按键分支映射到将执行它们的应用程序。将实时应用决策保留在现有的 SIP 应用或会话应用中。将 ConversationRelay 视为语音运行时依赖项；仅替换电话连接并不能替换其托管语音服务。

TwiML 是 Twilio 的指令格式，不是 Bird 序列包。围绕预期的提示、输入和决策重建呼叫行为。在规划替代方案之前，逐一检查会议、队列、支付或媒体功能。

使用[呼叫序列设计指南](/docs/guides/voice/call-sequences)来规划已定义的呼叫步骤，使用 [AI 语音集成指南](/docs/ai/voice-conversations)来规划会话运行时。

## 准备替代连接

创建 Bird 工作区、中继和呼叫身份以进行受控测试。启用目标并在客户端中配置身份验证和媒体设置。在评估新路径期间保持现有号码路由不变。

电话号码携号转网不会迁移其背后的应用程序。确认每个国家和号码类型的可携性及预期的切换流程。在依赖号码迁移之前，先准备好新的入站路由。

## 测试完整的客户旅程

使用你控制的号码并验证以下结果：

- 预期的客户端完成身份验证，测试目标振铃。
- 双向音频正常工作，通话正常结束。
- 提示和按键选择到达预期的分支。
- 业务工具能够区分成功、失败和不确定的结果。
- 通话记录和事件与应用程序中的结果关联。
- 录音或转写（如有需要）产出预期的证据。

除了成功路径外，还要测试被拒绝的呼叫和不可用的业务依赖项。仅请求被接受并不能证明替代方案可用。

## 有计划地迁移流量

确认容量、访问权限和最终号码路由。在评估初始流量期间保留恢复原路由的方法。保存历史供应商记录，并维护与应用程序中客户或任务身份的映射关系。

在通话结束后核对计费成本。比较新工作流时，将所有相关呼叫段以及任何单独的语音、录音或模型服务都纳入考量。

## 使用编程代理协作

将此提示粘贴到你的编程代理中，附上你要迁移的集成。编号流程从盘点开始，并明确标注生产环境变更。

```text
Help me evaluate a Voice migration from Twilio to Bird.
1. Read https://bird.com/docs/guides/voice/migrate/twilio.md. Use the .md alternatives of linked Bird guides for the steps below.
2. Check for a connected Bird MCP server or an installed, signed-in Bird CLI. Use whichever is available and discover its tools or command help. If neither is available, follow https://bird.com/docs/ai/set-up-your-agent.md. Do not invent operation names or install a second integration.
3. Perform a read-only inventory of my current call sites, numbers, SIP configuration, call-control instructions, event handlers, recordings, speech services and business tools. Identify secrets without printing them. Show the dependencies that stay with Twilio and the ones that need replacement.
4. Read https://bird.com/docs/guides/voice/sip-trunks.md, https://bird.com/docs/guides/voice/placing-calls.md and https://bird.com/docs/guides/voice/receiving-calls.md. Prepare the replacement connection and caller-identity requirements. Use https://bird.com/docs/guides/voice/call-sequences.md for defined menus and https://bird.com/docs/ai/voice-conversations.md for a conversational runtime. Verify each operation against the connected surface before proposing an executable step.
5. Prepare a test of one complete journey: setup, audio in both directions, keypad input, unanswered and failure paths, handoff where needed, and business-tool results. Show the exact target, configuration and expected cost before placing a call or recording audio; wait for my approval. Do not buy numbers, submit a port, change production routing or stop the existing provider without my explicit approval.
6. Use https://bird.com/docs/guides/voice/events.md and https://bird.com/docs/guides/voice/call-log.md to reconcile the outcome. Keep missing evidence and uncertain results visible. A spoken confirmation is not proof that a business action succeeded.
7. Return the integration differences, test evidence, unresolved requirements and rollback plan. Keep the current service running until I approve cutover. If a number port needs support, inspect the available support command or tool, prepare the exact request and ask for approval before submitting it. Return the ticket reference if authorized; a ticket does not schedule or complete a port.
```

## 供应商参考

- [Twilio 呼叫文档](https://www.twilio.com/docs/voice/twiml)
- [Twilio 工作流文档](https://www.twilio.com/docs/voice/conversationrelay)

## 后续步骤

- [SIP 中继](/docs/guides/voice/sip-trunks)
- [Voice 事件](/docs/guides/voice/events)
- [通话日志](/docs/guides/voice/call-log)

## Related resources

- [What is a voice API?](/explained/voice/what-is-a-voice-api) (answer)
- [Voice](/products/voice) (product)
- [Voice overview](/docs/guides/voice/overview) (docs)

[Get an implementation brief](/learn/workspace?topic=voice)
