twilio-conference-calls
Build multi-party calls using Twilio Conference. Covers warm transfer, cold transfer, coaching (whisper), hold vs mute, participant modes, and supervisor barge. Use this skill for any contact center, support line, or scenario requiring transfers, holds, or multi-party calls.
What this skill does
## Overview
Conference is the foundation of contact center call handling. The key insight: **every call that might need a transfer should start as a Conference**, not a direct `<Dial>`. A Conference supports hold, transfer, coaching, and recording — a direct Dial does not.
```
Caller ──→ Conference Room ←── Agent
↑
Supervisor (coach mode: speaks to agent only)
```
**Contact center best practice:** Every multi-agent call should use Conference, not direct Dial.
---
## Prerequisites
- Twilio account with a voice-capable phone number — see `twilio-account-setup`
- `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` — see `twilio-iam-auth-setup`
- SDK: `pip install twilio` / `npm install twilio`
- For agent routing: TaskRouter — see `twilio-taskrouter-routing`
---
## Quickstart
**Step 1 — Put the inbound caller into a Conference**
When a call comes in, place the caller into a named Conference room.
**Python (Flask)**
```python
from flask import Flask, request
from twilio.twiml.voice_response import VoiceResponse
app = Flask(__name__)
@app.route("/voice", methods=["POST"])
def incoming_call():
call_sid = request.form["CallSid"]
response = VoiceResponse()
dial = response.dial()
dial.conference(
f"room-{call_sid}",
start_conference_on_enter=True,
end_conference_on_exit=False, # Keep conference alive when caller disconnects (for wrap-up)
wait_url="http://twimlets.com/holdmusic?Bucket=com.twilio.music.classical",
status_callback="https://yourapp.com/conference-events",
status_callback_event="join leave",
record="record-from-start"
)
return str(response)
```
**Node.js (Express)**
```node
app.post("/voice", (req, res) => {
const callSid = req.body.CallSid;
const response = new VoiceResponse();
const dial = response.dial();
dial.conference(
`room-${callSid}`,
{
startConferenceOnEnter: true,
endConferenceOnExit: false,
waitUrl: "http://twimlets.com/holdmusic?Bucket=com.twilio.music.classical",
statusCallback: "https://yourapp.com/conference-events",
statusCallbackEvent: "join leave",
record: "record-from-start",
}
);
res.type("text/xml").send(response.toString());
});
```
**Step 2 — Connect an agent to the same Conference**
After TaskRouter assigns a worker, dial the agent into the conference:
> **Security:** Never interpolate untrusted user input into inline `twiml=` strings. Use the SDK's `VoiceResponse` builder for any dynamic content.
**Python**
```python
# Called from your assignment callback or agent connect logic
def connect_agent(conference_name, agent_phone):
client.calls.create(
to=agent_phone,
from_="+15551234567", # your Twilio number
twiml=f'''<Response>
<Dial>
<Conference>{conference_name}</Conference>
</Dial>
</Response>''',
status_callback="https://yourapp.com/agent-call-status"
)
```
**Node.js**
```node
async function connectAgent(conferenceName, agentPhone) {
await client.calls.create({
to: agentPhone,
from: "+15551234567",
twiml: `<Response><Dial><Conference>${conferenceName}</Conference></Dial></Response>`,
statusCallback: "https://yourapp.com/agent-call-status",
});
}
```
---
## Key Patterns
### Warm Transfer
Put caller on hold → dial new agent into Conference → original agent briefs new agent → original agent drops.
**Python**
```python
def warm_transfer(conference_sid, original_agent_call_sid, new_agent_phone, conference_name):
# Step 1: Put caller on hold (hold = hears music, can't hear agents)
caller_participant = client.conferences(conference_sid) \
.participants(caller_call_sid) \
.update(hold=True)
# Step 2: Dial new agent into the same conference
client.calls.create(
to=new_agent_phone,
from_="+15551234567",
twiml=f'<Response><Dial><Conference>{conference_name}</Conference></Dial></Response>',
status_callback="https://yourapp.com/transfer-agent-status"
)
# Step 3: Original agent briefs new agent (caller is on hold, can't hear)
# ... agents talk ...
# Step 4: Take caller off hold
client.conferences(conference_sid) \
.participants(caller_call_sid) \
.update(hold=False)
# Step 5: Original agent leaves
client.conferences(conference_sid) \
.participants(original_agent_call_sid) \
.update(status="completed") # Removes from conference
```
### Cold Transfer
Simpler — just redirect the caller to a new agent without briefing.
**Python**
```python
def cold_transfer(conference_sid, original_agent_call_sid, new_agent_phone, conference_name):
# Remove original agent
client.conferences(conference_sid) \
.participants(original_agent_call_sid) \
.update(status="completed")
# Dial new agent into conference
client.calls.create(
to=new_agent_phone,
from_="+15551234567",
twiml=f'<Response><Dial><Conference>{conference_name}</Conference></Dial></Response>'
)
```
### Hold vs Mute
| Feature | Hold | Mute |
|---------|------|------|
| Participant hears | Hold music | Everything (but can't speak) |
| Other participants hear | Nothing from held party | Nothing from muted party |
| Use when | Transfer briefing, agent lookup | Quick aside (agent mutes self to cough) |
| API | `hold=True` | `muted=True` |
```python
# Hold — plays music to the held participant
client.conferences(conf_sid).participants(participant_sid).update(hold=True)
client.conferences(conf_sid).participants(participant_sid).update(hold=False)
# Mute — silences the participant but they still hear
client.conferences(conf_sid).participants(participant_sid).update(muted=True)
client.conferences(conf_sid).participants(participant_sid).update(muted=False)
```
**Critical distinction:** Hold plays music. Mute just silences. Using mute when you mean hold exposes agent-side conversations to the caller.
### Coaching (Supervisor Whisper)
Supervisor joins the Conference and can speak to the agent only — the caller cannot hear the supervisor.
**Python**
```python
def add_coach(conference_sid, supervisor_phone, conference_name):
"""Add supervisor as coach — speaks to agent only, caller can't hear."""
client.calls.create(
to=supervisor_phone,
from_="+15551234567",
twiml=f'''<Response>
<Dial>
<Conference
coach="{agent_call_sid}"
statusCallback="https://yourapp.com/coach-events"
>{conference_name}</Conference>
</Dial>
</Response>'''
)
```
**Node.js**
```node
async function addCoach(conferenceSid, supervisorPhone, conferenceName, agentCallSid) {
await client.calls.create({
to: supervisorPhone,
from: "+15551234567",
twiml: `<Response>
<Dial>
<Conference coach="${agentCallSid}">${conferenceName}</Conference>
</Dial>
</Response>`,
});
}
```
**Coach behavior:**
- Supervisor hears both caller and agent
- Supervisor can speak to agent only (caller cannot hear)
- Coach audio is NOT captured in conference recording — record separately if needed
- To switch from coach to barge (speak to everyone), update the participant
### Supervisor Barge
Supervisor joins and speaks to everyone — useful for escalation or takeover.
```python
def barge_in(conference_sid, supervisor_phone, conference_name):
"""Supervisor joins as full participant — everyone hears them."""
client.calls.create(
to=supervisor_phone,
from_="+15551234567",
twiml=f'<Response><Dial><Conference>{conference_name}</Conference></Dial></Response>'
)
```
### Participant Management
```python
# List all participants in a conference
participantRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.