
twilio-voice-outbound-calls
Make outbound phone calls via Twilio's Programmable Voice REST API. Covers the full voice platform: calls.create(), answering machine detection (AMD), conference-based agent bridging, call recording, status tracking, and SIP Trunking. Use this skill for outbound calls, sales dialers, or when asking what voice APIs are available.
- Installs
- 194
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/twilio/ai --skill twilio-voice-outbound-calls- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads twilio-voice-outbound-calls automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Overview
Agent safety: Before placing an outbound call, always confirm the recipient number and intent with the user. Outbound calls are irreversible and may incur charges. For automated systems, implement TCPA compliance: obtain prior express consent, respect quiet hours (8 AM–9 PM recipient local time), and maintain a Do Not Call list.
Every outbound call requires a from Twilio number, a to recipient, and TwiML instructions that define what happens when the call is answered — either as a webhook URL or inline.
Voice Platform Capabilities
Outbound calls go beyond basic calls.create(). Here's what you can build:
| Capability | How | When to use |
|---|---|---|
| Basic outbound call | calls.create() with TwiML or webhook URL | Any outbound call — see Quickstart below |
| Answering Machine Detection (AMD) | machineDetection parameter on calls.create() | Sales dialers, call campaigns — filter voicemail from humans |
| Conference-based agent bridging | <Dial><Conference> in TwiML | Connect agents to live prospects with whisper, barge, hold |
| SIP Trunking | Elastic SIP Trunking | Bring your own carrier for outbound calls — cost reduction at scale |
| Call Recording | record=True on calls.create() or <Record> verb | Compliance, QA, training |
| Voice Insights | Automatic per-call metrics | Call quality monitoring — latency, jitter, packet loss, answer rates |
| AI Voice Agents | ConversationRelay + LLM | Real-time speech recognition → LLM → TTS for conversational AI |
For TwiML verbs (Say, Gather, Dial, Record, Conference, Pay), see twilio-voice-twiml.
For AI voice agents, see twilio-voice-conversation-relay.
Prerequisites
- Twilio account with a voice-capable phone number
— New to Twilio? See
twilio-account-setupfor signup, getting a number, and trial limitations — Trial accounts can only call verified numbers - Environment variables:
TWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKEN— Seetwilio-iam-auth-setupfor credential setup and best practices
- SDK:
pip install twilio/npm install twilio
Quickstart
Python
import os
from twilio.rest import Client
client = Client(os.environ["TWILIO_ACCOUNT_SID"], os.environ["TWILIO_AUTH_TOKEN"])
call = client.calls.create(
from_="+15017122661", # Your Twilio number (E.164)
to="+15558675310", # Recipient (E.164)
twiml="<Response><Say>Your order has shipped. Goodbye.</Say></Response>"
)
print(call.sid) # CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
print(call.status) # queued | ringing | in-progress | completed | failed
Node.js
const twilio = require("twilio");
const client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
const call = await client.calls.create({
from: "+15017122661",
to: "+15558675310",
twiml: "<Response><Say>Your order has shipped. Goodbye.</Say></Response>",
});
console.log(call.sid);
console.log(call.status);
Key Patterns
Use a Webhook URL for Dynamic Call Handling
Pass a url instead of inline twiml — Twilio POSTs to your server when the call connects and executes the TwiML you return.
Python
call = client.calls.create(
from_="+15017122661",
to="+15558675310",
url="https://yourapp.com/twiml/welcome"
)
Node.js
const call = await client.calls.create({
from: "+15017122661",
to: "+15558675310",
url: "https://yourapp.com/twiml/welcome",
});
Python (Flask) — TwiML webhook handler
from flask import Flask
from twilio.twiml.voice_response import VoiceResponse
app = Flask(__name__)
@app.route("/twiml/welcome", methods=["POST"])
def welcome():
response = VoiceResponse()
response.say("Hello! Press 1 to hear your account balance.")
response.gather(num_digits=1, action="/twiml/handle-input")
return str(response)
Node.js (Express) — TwiML webhook handler
const { VoiceResponse } = require("twilio").twiml;
app.post("/twiml/welcome", (req, res) => {
const response = new VoiceResponse();
response.say("Hello! Press 1 to hear your account balance.");
response.gather({ numDigits: 1, action: "/twiml/handle-input" });
res.type("text/xml").send(response.toString());
});
For all TwiML verbs (Say, Gather, Dial, Record, Conference), see twilio-voice-twiml.
Track Call Status
Python
call = client.calls.create(
from_="+15017122661",
to="+15558675310",
url="https://yourapp.com/twiml/welcome",
status_callback="https://yourapp.com/call-status",
status_callback_method="POST"
)
Node.js
const call = await client.calls.create({
from: "+15017122661",
to: "+15558675310",
url: "https://yourapp.com/twiml/welcome",
statusCallback: "https://yourapp.com/call-status",
statusCallbackMethod: "POST",
});
Status transitions: queued → ringing → in-progress → completed (or failed/busy/no-answer).
Record a Call
Python
call = client.calls.create(
from_="+15017122661",
to="+15558675310",
url="https://yourapp.com/twiml/welcome",
record=True,
recording_status_callback="https://yourapp.com/recording-ready"
)
Node.js
const call = await client.calls.create({
from: "+15017122661",
to: "+15558675310",
url: "https://yourapp.com/twiml/welcome",
record: true,
recordingStatusCallback: "https://yourapp.com/recording-ready",
});
Recordings accessible at https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Recordings.
Answering Machine Detection (AMD)
Detect whether a human or voicemail answers before connecting an agent or leaving a message. Two modes:
| Mode | Behavior | Best for |
|---|---|---|
Enable | Returns result immediately when human/machine first detected | Sales dialers — connect agent to humans ASAP |
DetectMessageEnd | Waits for voicemail greeting to finish (beep/silence) | Leaving voicemail — wait for beep, then play/record message |
Python — Sales dialer (connect agents to live answers only)
call = client.calls.create(
from_="+15017122661",
to="+15558675310",
url="https://yourapp.com/handle-answer",
machine_detection="Enable", # Immediate detection — use for live-agent connect
async_amd=True, # Non-blocking — call connects while AMD analyzes
async_amd_status_callback="https://yourapp.com/amd-result",
async_amd_status_callback_method="POST"
)
Node.js
const call = await client.calls.create({
from: "+15017122661",
to: "+15558675310",
url: "https://yourapp.com/handle-answer",
machineDetection: "Enable",
asyncAmd: true,
asyncAmdStatusCallback: "https://yourapp.com/amd-result",
asyncAmdStatusCallbackMethod: "POST",
});
AMD webhook delivers AnsweredBy parameter:
| Value | Meaning | Action |
|---|---|---|
human | Live person detected | Connect to agent |
machine_start | Machine detected, greeting still playing | Hang up or wait |
machine_end_beep | Voicemail beep heard | Leave message |
machine_end_silence | Silence after greeting | Leave message |
fax | Fax tone detected | Hang up |
unknown | Could not determine | Treat as human or retry |
Conference-based agent bridging (production pattern for sales dialers):
# In /handle-answer webhook — when AMD says "human":
response = VoiceResponse()
dial = response.dial()
dial.conference(
f"Sales-{call_sid}",
start_conference_on_enter=False, # Prospect waits for agent
end_conference_on_exit=True
)
# Separately, dial agent into same conference:
client.calls.create(
from_="+15017122661",
to=agent_number,
twiml=f'<Response><Dial><Conference startConferenceOnEnter="true">Sales-{call_sid}</Conference></Dial></Response>'
)
This pattern gives you call control (whisper to agent before connecting, supervisor barge-in, hold) that direct <Dial> does not.
Cost: AMD adds ~$0.0075 per call to standard voice pricing.
Response Fields
| Field | Description |
|---|---|
sid | Call identifier (CA...) |
status | queued, ringing, in-progress, completed, failed, busy, no-answer |
duration | Length in seconds (after completion) |
price | Cost (populated after completion) |
Common Errors
| Code | Meaning | Fix |
|---|---|---|
| 21211 | Invalid to number | Validate E.164 format |
| 13224 | Invalid TwiML at webhook URL | Validate TwiML response from your server |
| 13225 | TwiML URL returned non-200 status | Fix your webhook endpoint |
CANNOT
- Cannot use a private TwiML URL — Must be publicly accessible. Use ngrok for local development only; deploy to a cloud provider for production.
- Cannot exceed ~4,096 characters in inline
twimlparameter — Use a TwiML URL for longer responses - Cannot call unverified numbers on trial accounts — Upgrade to paid or verify recipient numbers first
- AMD accuracy is ~85-90% — Expect some false positives/negatives. Tune
machineDetectionSpeechThreshold(default 2400ms) based on your results. - AMD adds latency —
Enablemode returns results faster but may misclassify short greetings.DetectMessageEndis more accurate but adds seconds before your app can act. - Cannot use AMD with SIP Trunking — AMD is only available on calls made via the Calls API
Next Steps
- TwiML verb reference (Say, Gather, Dial, Record, Conference, Pay):
twilio-voice-twiml - AI voice agents with real-time speech/LLM:
twilio-voice-conversation-relay - Improve answer rates (Branded Calling, STIR/SHAKEN):
twilio-numbers-senders
FAQ
What does the twilio-voice-outbound-calls skill do?
Make outbound phone calls via Twilio's Programmable Voice REST API. Covers the full voice platform: calls.create(), answering machine detection (AMD), conference-based agent bridging, call recording, status tracking, and SIP Trunking. Use this skill for outbound calls, sales dialers, or when asking what voice APIs are available.
How do I install twilio-voice-outbound-calls?
Run npx skills add https://github.com/twilio/ai --skill twilio-voice-outbound-calls in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/twilio-voice-outbound-calls/ (personal) or .claude/skills/twilio-voice-outbound-calls/ (project).
Which AI agents can use twilio-voice-outbound-calls?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is twilio-voice-outbound-calls safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains twilio-voice-outbound-calls?
It is published by twilio/ai in twilio/ai. It has 194 recorded installs.
More from twilio/ai
twilio-sms-send-message
twilio/ai
SMS and MMS deep-dive reference. Covers SMS-specific error codes, message filtering troubleshooting ("Messages Being Filtered or Blocked?" diagnostic checklist), MMS media support (US/CA/AU only), and SMS pumping indicators. For sending SMS, use twilio-send-message instead. Use this skill only when debugging SMS delivery issues or needing SMS-specific details not in the consolidated send skill.
twilio-send-message
twilio/ai
Send messages via Twilio's Programmable Messaging API across all channels — SMS, MMS, RCS, and WhatsApp. Covers text messages, media, rich content (cards, carousels, buttons), template-based sends, Messaging Services, status callbacks, and WhatsApp's 24-hour service window. Use when the user wants to send a message — whether they say "send SMS", "text message", "branded message", "rich message", "WhatsApp message", "RCS message", "notification", or "alert". For picking the right channel for a use case, first consult twilio-messaging-channel-advisor.
twilio-sendgrid-email-send
twilio/ai
Send transactional and bulk email via the SendGrid v3 Mail Send API. Covers single sends, personalized batch sends with dynamic templates, scheduled sends with cancellation, attachments, and sandbox mode for testing. Use this skill when the caller has a SendGrid API key (SG.-prefix). Do NOT use this skill if the caller is using the Twilio Email API (comms.twilio.com) — that is a separate product with different credentials.
twilio-webhook-architecture
twilio/ai
Design, secure, and operate Twilio webhook endpoints. Covers inbound event handling, status callbacks, signature validation, connection overrides for retry and timeout tuning, local development tunneling, and production hardening. Use this skill whenever an agent needs to receive HTTP callbacks from Twilio for any product -- messaging, voice, verify, or event streams.
twilio-security-hardening
twilio/ai
Secure Twilio applications against common attacks. Covers credential management (API keys vs auth tokens), request validation (webhook signature verification), PCI DSS compliance, HIPAA account requirements, SMS pumping prevention, geo-permissions, and account isolation patterns. Use this skill when developers are building or deploying Twilio apps.
twilio-messaging-overview
twilio/ai
Twilio Messaging channel overview and onboarding guide. Covers all channels (SMS, WhatsApp, RCS, Facebook Messenger), the unified Messages API, channel selection guidance, and the recommended setup sequence from first message to production monitoring. Start here before choosing a specific messaging channel.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image
ai-avatar-video
101-skills/superpowers
Create AI avatar and talking head videos via inference.sh CLI. Recommended: P-Video-Avatar (fastest, cheapest, built-in TTS). Also: OmniHuman, Fabric, PixVerse. Audio: Inworld TTS-2 (100+ languages, emotion steering for characters), ElevenLabs, Kokoro. Capabilities: audio-driven avatars, text-to-avatar, lipsync videos, talking head generation, virtual presenters, UGC content. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos, UGC ads, gaming avatars, NPC dialogue. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human, ugc, ugc video, ugc ad, avatar ugc