AI自动化电话与短信中枢
简介
基于Twilio官方API的AI电话自动化工具集,支持语音呼叫、IVR交互、短信通知及通话录音,适合企业客服与通知场景
原始描述
Enable AI agents to autonomously make, receive, transcribe, route, and record phone calls using Twilio with customizable voice messages and IVR support.
通过你的 Agent 添加
安装目录:agentic-calling/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Agentic Calling Skill 是一套完整的AI电话自动化解决方案,基于Twilio云服务实现。核心功能分为三大模块:
1. 外呼系统 (make-call.sh)
- 文字转语音自动拨号,支持Amazon Polly多语种语音(Joanna、Matthew等)
- 可选通话录音、状态回调、自定义超时
- 实验性支持ElevenLabs语音克隆
2. 呼入处理 (receive-call.sh)
- 部署Webhook服务器响应来电
- IVR语音菜单、电话转接、语音信箱
- TwiML动态生成交互式语音响应
3. 配套工具
sms-notify.sh: 短信/MMS发送,适合呼叫后跟进call-status.sh: 实时监控通话状态、下载录音、获取转录conference.sh: 多方会议管理
典型集成场景:预约提醒、紧急广播、销售线索资格筛选、语音双因素认证。
显著优点
- 零依赖安全:仅使用curl、jq、python3标准工具,无第三方包供应链风险
- 成本控制透明:外呼$0.013/分钟,短信$0.0079/条,号码月租$1.15,文档提供优化建议
- 企业级语音质量:Amazon Polly神经网络语音,支持英语、西语、法语、德语等
- 灵活部署:配置文件或环境变量双模式,适配CI/CD与本地开发
- 完整审计追踪:Twilio原生支持通话记录、录音存储、转录服务
潜在局限
- 区域限制:Twilio服务在部分国家/地区受限,需确认号码可用性
- 延迟敏感:语音交互依赖网络延迟,高延迟场景体验下降
- 成本累积:批量呼叫场景下费用随规模线性增长,无内置节流机制
- 合规复杂性:电话营销需遵守TCPA/GDPR,工具本身不提供同意管理
- 语音自然度:Polly语音虽优质,但与真人相比仍有差距;ElevenLabs集成标记为实验性
适合人群
- 中小企业:需要低成本自动化客服/通知系统,无预算自建呼叫中心
- DevOps/SRE团队:紧急告警广播、on-call电话通知
- 销售运营:批量预约提醒、线索跟进自动化
- 开发者:快速原型验证语音交互应用,Twilio生态已有集成经验者
常规风险
风险类别
具体描述
缓解措施
凭证泄露
Twilio Auth Token暴露可导致账户盗用
配置文件建议chmod 600,禁用git提交
费用失控
误配置循环呼叫或被盗用API Key
设置Twilio账户消费限额,启用用量告警
隐私合规
电话号码、通话录音属敏感个人信息
添加隐私政策,获取用户明示同意
滥用骚扰
自动化工具可能被用于垃圾呼叫
实施速率限制,维护拒接名单
服务依赖
Twilio服务中断影响业务连续性
设计降级方案(短信备份通道)
- 区域限制:Twilio服务在部分国家/地区受限,需确认号码可用性
- 延迟敏感:语音交互依赖网络延迟,高延迟场景体验下降
- 成本累积:批量呼叫场景下费用随规模线性增长,无内置节流机制
- 合规复杂性:电话营销需遵守TCPA/GDPR,工具本身不提供同意管理
- 语音自然度:Polly语音虽优质,但与真人相比仍有差距;ElevenLabs集成标记为实验性
适合人群
- 中小企业:需要低成本自动化客服/通知系统,无预算自建呼叫中心
- DevOps/SRE团队:紧急告警广播、on-call电话通知
- 销售运营:批量预约提醒、线索跟进自动化
- 开发者:快速原型验证语音交互应用,Twilio生态已有集成经验者
常规风险
风险类别
具体描述
缓解措施
凭证泄露
Twilio Auth Token暴露可导致账户盗用
配置文件建议chmod 600,禁用git提交
费用失控
误配置循环呼叫或被盗用API Key
设置Twilio账户消费限额,启用用量告警
隐私合规
电话号码、通话录音属敏感个人信息
添加隐私政策,获取用户明示同意
滥用骚扰
自动化工具可能被用于垃圾呼叫
实施速率限制,维护拒接名单
服务依赖
Twilio服务中断影响业务连续性
设计降级方案(短信备份通道)
| 风险类别 | 具体描述 | 缓解措施 |
|---|---|---|
| 凭证泄露 | Twilio Auth Token暴露可导致账户盗用 | 配置文件建议chmod 600,禁用git提交 |
| 费用失控 | 误配置循环呼叫或被盗用API Key | 设置Twilio账户消费限额,启用用量告警 |
| 隐私合规 | 电话号码、通话录音属敏感个人信息 | 添加隐私政策,获取用户明示同意 |
| 滥用骚扰 | 自动化工具可能被用于垃圾呼叫 | 实施速率限制,维护拒接名单 |
| 服务依赖 | Twilio服务中断影响业务连续性 | 设计降级方案(短信备份通道) |
技能正文
Agentic Calling Skill
Enable AI agents to make and receive phone calls autonomously using Twilio.
Overview
This skill provides a complete toolkit for AI agents to handle phone calls programmatically. Agents can:
- Make outbound calls with custom voice messages
- Receive inbound calls and respond dynamically
- Convert text to speech for natural conversations
- Transcribe caller speech to text
- Handle call routing and forwarding
- Manage voicemail and recordings
Prerequisites
- Twilio Account: Sign up at twilio.com
- Twilio Phone Number: Purchase a number with Voice capabilities
- Twilio Credentials: Account SID and Auth Token
Quick Start
1. Configure Credentials
1. Configure Credentials
Create a file at ~/.clawdbot/twilio-config.json:
{
"accountSid": "YOUR_ACCOUNT_SID",
"authToken": "YOUR_AUTH_TOKEN",
"phoneNumber": "+1XXXXXXXXXX"
}
Or set environment variables:
export TWILIO_ACCOUNT_SID="YOUR_ACCOUNT_SID"
export TWILIO_AUTH_TOKEN="YOUR_AUTH_TOKEN"
export TWILIO_PHONE_NUMBER="+1XXXXXXXXXX"
2. Make Your First Call
./scripts/make-call.sh --to "+15551234567" --message "Hello! This is your AI assistant calling."
3. Set Up Inbound Call Handling
./scripts/setup-webhook.sh --url "https://your-server.com/voice"
Core Scripts
make-call.sh - Make Outbound Calls
./scripts/make-call.sh --to "+15551234567" --message "Hello! This is your AI assistant calling."
./scripts/setup-webhook.sh --url "https://your-server.com/voice"
Core Scripts
make-call.sh - Make Outbound Calls
make-call.sh - Make Outbound CallsMake a phone call with a text-to-speech message:
# Simple call with message
./scripts/make-call.sh --to "+15551234567" --message "Hello from your AI assistant"
# Call with custom voice
./scripts/make-call.sh --to "+15551234567" --message "Important update" --voice "Polly.Matthew"
# Call with recording
./scripts/make-call.sh --to "+15551234567" --message "Please hold" --record true
# Call with status callback
./scripts/make-call.sh --to "+15551234567" --message "Hello" --callback "https://your-server.com/status"
Parameters:
--to(required): Destination phone number (E.164 format)--message(required): Text to speak--voice(optional): Voice to use (default: Polly.Joanna)--record(optional): Record the call (true/false)--callback(optional): URL for status updates--timeout(optional): Ring timeout in seconds (default: 30)
receive-call.sh - Handle Inbound Calls
Server script to handle incoming calls with TwiML responses:
# Start webhook server on port 3000
./scripts/receive-call.sh --port 3000
# Custom greeting
./scripts/receive-call.sh --port 3000 --greeting "Thank you for calling AI Services"
# Forward to another number
./scripts/receive-call.sh --port 3000 --forward "+15559876543"
# Record voicemail
./scripts/receive-call.sh --port 3000 --voicemail true
sms-notify.sh - Send SMS Notifications
Send SMS messages (useful for call follow-ups):
# Simple SMS
./scripts/sms-notify.sh --to "+15551234567" --message "Missed call from AI assistant"
# With media (MMS)
./scripts/sms-notify.sh --to "+15551234567" --message "Summary attached" --media "https://example.com/summary.pdf"
call-status.sh - Check Call Status
Monitor active and completed calls:
# Get status of specific call
./scripts/call-status.sh --sid "CA1234567890abcdef"
# List recent calls
./scripts/call-status.sh --list --limit 10
# Get call recording
./scripts/call-status.sh --sid "CA1234567890abcdef" --download-recording
Advanced Usage
Custom IVR (Interactive Voice Response)
Create dynamic phone menus:
./scripts/create-ivr.sh --menu "Press 1 for sales, 2 for support, 3 for emergencies"
Conference Calls
Set up multi-party conference calls:
# Create conference
./scripts/conference.sh --create --name "Team Standup"
# Add participant
./scripts/conference.sh --add-participant --conference "Team Standup" --number "+15551234567"
Call Recording & Transcription
# Record and transcribe
./scripts/make-call.sh --to "+15551234567" --message "How can I help?" --record true --transcribe true
# Download recording
./scripts/call-status.sh --sid "CA123..." --download-recording --output "call.mp3"
# Get transcription
./scripts/call-status.sh --sid "CA123..." --get-transcript
Voice Cloning (Experimental)
# Record and transcribe
./scripts/make-call.sh --to "+15551234567" --message "How can I help?" --record true --transcribe true
# Download recording
./scripts/call-status.sh --sid "CA123..." --download-recording --output "call.mp3"
# Get transcription
./scripts/call-status.sh --sid "CA123..." --get-transcript
Use ElevenLabs integration for custom voice:
# Requires ElevenLabs API key
./scripts/make-call-elevenlabs.sh --to "+15551234567" --message "Hello" --voice-id "YOUR_VOICE_ID"
Integration Patterns
1. Appointment Reminders
#!/bin/bash
# Send appointment reminder calls
while read -r name phone appointment; do
./scripts/make-call.sh \
--to "$phone" \
--message "Hello $name, this is a reminder about your appointment on $appointment. Press 1 to confirm, 2 to reschedule."
done < appointments.txt
2. Emergency Alerts
#!/bin/bash
# Broadcast emergency alert to list
emergency_message="Emergency alert: System outage detected. Team members are working on resolution."
cat on-call-list.txt | while read phone; do
./scripts/make-call.sh \
--to "$phone" \
--message "$emergency_message" \
--urgent true &
done
wait
3. Lead Qualification
#!/bin/bash
# Call leads and route based on IVR response
./scripts/make-call.sh \
--to "+15551234567" \
--message "Thank you for your interest. Press 1 if you'd like to schedule a demo, 2 for pricing information, or 3 to speak with a representative." \
--callback "https://your-crm.com/lead-response"
Voice Options
#!/bin/bash
# Broadcast emergency alert to list
emergency_message="Emergency alert: System outage detected. Team members are working on resolution."
cat on-call-list.txt | while read phone; do
./scripts/make-call.sh \
--to "$phone" \
--message "$emergency_message" \
--urgent true &
done
wait
#!/bin/bash
# Call leads and route based on IVR response
./scripts/make-call.sh \
--to "+15551234567" \
--message "Thank you for your interest. Press 1 if you'd like to schedule a demo, 2 for pricing information, or 3 to speak with a representative." \
--callback "https://your-crm.com/lead-response"
Voice Options
Supported voices (Amazon Polly):
English (US):
Polly.Joanna(Female, default)Polly.Matthew(Male)Polly.Ivy(Female, child)Polly.Joey(Male)Polly.Kendra(Female)Polly.Kimberly(Female)Polly.Salli(Female)
English (UK):
Polly.Amy(Female)Polly.Brian(Male)Polly.Emma(Female)
Other Languages:
- Spanish:
Polly.Miguel,Polly.Penelope - French:
Polly.Celine,Polly.Mathieu - German:
Polly.Hans,Polly.Marlene
Webhooks & TwiML
Setting Up Webhooks
Configure your Twilio number to POST to your webhook URL when calls arrive:
./scripts/configure-number.sh \
--voice-url "https://your-server.com/voice" \
--voice-method "POST" \
--status-callback "https://your-server.com/status"
Example TwiML Response
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="Polly.Joanna">Hello! Thank you for calling.</Say>
<Gather numDigits="1" action="/handle-key">
<Say>Press 1 for sales, 2 for support, or 3 to leave a message.</Say>
</Gather>
</Response>
Cost Optimization
- Outbound calls: ~$0.013/minute (US)
- Inbound calls: ~$0.0085/minute (US)
- SMS: ~$0.0079/message (US)
- Phone number: ~$1.15/month
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="Polly.Joanna">Hello! Thank you for calling.</Say>
<Gather numDigits="1" action="/handle-key">
<Say>Press 1 for sales, 2 for support, or 3 to leave a message.</Say>
</Gather>
</Response>
- Outbound calls: ~$0.013/minute (US)
- Inbound calls: ~$0.0085/minute (US)
- SMS: ~$0.0079/message (US)
- Phone number: ~$1.15/month
Tips:
- Use regional phone numbers to reduce costs
- Batch calls during off-peak hours
- Keep messages concise to minimize call duration
- Use SMS for simple notifications
Security Best Practices
- Protect Credentials: Never commit credentials to git
- Use HTTPS: Always use HTTPS for webhooks
- Validate Requests: Verify Twilio signatures on webhooks
- Rate Limiting: Implement rate limits on outbound calls
- Logging: Log all calls for audit trails
Troubleshooting
Call Not Connecting
# Check number formatting (must be E.164)
./scripts/validate-number.sh "+15551234567"
# Test connectivity
./scripts/make-call.sh --to "$TWILIO_PHONE_NUMBER" --message "Test call"
Webhook Not Receiving Calls
Call Not Connecting
# Check number formatting (must be E.164)
./scripts/validate-number.sh "+15551234567"
# Test connectivity
./scripts/make-call.sh --to "$TWILIO_PHONE_NUMBER" --message "Test call"
# Test webhook
curl -X POST https://your-server.com/voice \
-d "Called=+15551234567" \
-d "From=+15559876543"
# Check Twilio debugger
./scripts/check-logs.sh --recent 10
Audio Quality Issues
# Use different voice engine
./scripts/make-call.sh --to "+15551234567" --message "Test" --voice "Google.en-US-Neural2-A"
# Adjust speech rate
./scripts/make-call.sh --to "+15551234567" --message "Test" --rate "90%"
Examples
# Use different voice engine
./scripts/make-call.sh --to "+15551234567" --message "Test" --voice "Google.en-US-Neural2-A"
# Adjust speech rate
./scripts/make-call.sh --to "+15551234567" --message "Test" --rate "90%"
See examples/ directory for complete use cases:
examples/appointment-reminder.sh- Automated appointment remindersexamples/emergency-broadcast.sh- Broadcast emergency alertsexamples/ivr-menu.sh- Interactive voice menuexamples/voicemail-transcription.sh- Voicemail to emailexamples/two-factor-auth.sh- Voice-based 2FA
API Reference
Full Twilio API documentation: https://www.twilio.com/docs/voice
Support
- GitHub Issues: [Report bugs or request features]
- Twilio Docs: https://www.twilio.com/docs
- Community: https://discord.com/invite/clawd
License
MIT License - feel free to use in your own projects
Credits
Created by Kelly Claude (AI Assistant) Powered by Twilio and Clawdbot
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。