← Twilio Developer KitCONTENT HISTORY

Update to Twilio Developer Kit

Snapshot Sep 30, 2026 · 22:50 UTC · version 0.2.2

Collection source: not recorded for this historical snapshot.

WHAT CHANGED · RULE-BASED ANALYSIS

First saved snapshot

No earlier snapshot is available to establish a change.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "name": "twilio-conference-calls",
  "description": "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.",
  "included_files": [
    {
      "relative_path": "agents/openai.yaml",
      "size_in_bytes": 227
    }
  ],
  "skill_md_contents": "---\nname: twilio-conference-calls\ndescription: >\n  Build multi-party calls using Twilio Conference. Covers warm transfer,\n  cold transfer, coaching (whisper), hold vs mute, participant modes, and\n  supervisor barge. Use this skill for any contact center, support line,\n  or scenario requiring transfers, holds, or multi-party calls.\n---\n\n## Overview\n\nConference 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.\n\n```\nCaller ──→ Conference Room ←── Agent\n                  ↑\n              Supervisor (coach mode: speaks to agent only)\n```\n\n**Contact center best practice:** Every multi-agent call should use Conference, not direct Dial.\n\n---\n\n## Prerequisites\n\n- Twilio account with a voice-capable phone number — see `twilio-account-setup`\n- `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` — see `twilio-iam-auth-setup`\n- SDK: `pip install twilio` / `npm install twilio`\n- For agent routing: TaskRouter — see `twilio-taskrouter-routing`\n\n---\n\n## Quickstart\n\n**Step 1 — Put the inbound caller into a Conference**\n\nWhen a call comes in, place the caller into a named Conference room.\n\n**Python (Flask)**\n```python\nfrom flask import Flask, request\nfrom twilio.twiml.voice_response import VoiceResponse\n\napp = Flask(__name__)\n\n@app.route(\"/voice\", methods=[\"POST\"])\ndef incoming_call():\n    call_sid = request.form[\"CallSid\"]\n    response = VoiceResponse()\n    dial = response.dial()\n    dial.conference(\n        f\"room-{call_sid}\",\n        start_conference_on_enter=True,\n        end_conference_on_exit=False,  # Keep conference alive when caller disconnects (for wrap-up)\n        wait_url=\"http://twimlets.com/holdmusic?Bucket=com.twilio.music.classical\",\n        status_callback=\"https://yourapp.com/conference-events\",\n        status_callback_event=\"join leave\",\n        record=\"record-from-start\"\n    )\n    return str(response)\n```\n\n**Node.js (Express)**\n```node\napp.post(\"/voice\", (req, res) => {\n    const callSid = req.body.CallSid;\n    const response = new VoiceResponse();\n    const dial = response.dial();\n    dial.conference(\n        `room-${callSid}`,\n        {\n            startConferenceOnEnter: true,\n            endConferenceOnExit: false,\n            waitUrl: \"http://twimlets.com/holdmusic?Bucket=com.twilio.music.classical\",\n            statusCallback: \"https://yourapp.com/conference-events\",\n            statusCallbackEvent: \"join leave\",\n            record: \"record-from-start\",\n        }\n    );\n    res.type(\"text/xml\").send(response.toString());\n});\n```\n\n**Step 2 — Connect an agent to the same Conference**\n\nAfter TaskRouter assigns a worker, dial the agent into the conference:\n\n> **Security:** Never interpolate untrusted user input into inline `twiml=` strings. Use the SDK's `VoiceResponse` builder for any dynamic content.\n\n**Python**\n```python\n# Called from your assignment callback or agent connect logic\ndef connect_agent(conference_name, agent_phone):\n    client.calls.create(\n        to=agent_phone,\n        from_=\"+15551234567\",  # your Twilio number\n        twiml=f'''<Response>\n            <Dial>\n                <Conference>{conference_name}</Conference>\n            </Dial>\n        </Response>''',\n        status_callback=\"https://yourapp.com/agent-call-status\"\n    )\n```\n\n**Node.js**\n```node\nasync function connectAgent(conferenceName, agentPhone) {\n    await client.calls.create({\n        to: agentPhone,\n        from: \"+15551234567\",\n        twiml: `<Response><Dial><Conference>${conferenceName}</Conference></Dial></Response>`,\n        statusCallback: \"https://yourapp.com/agent-call-status\",\n    });\n}\n```\n\n---\n\n## Key Patterns\n\n### Warm Transfer\n\nPut caller on hold → dial new agent into Conference → original agent briefs new agent → original agent drops.\n\n**Python**\n```python\ndef warm_transfer(conference_sid, original_agent_call_sid, new_agent_phone, conference_name):\n    # Step 1: Put caller on hold (hold = hears music, can't hear agents)\n    caller_participant = client.conferences(conference_sid) \\\n        .participants(caller_call_sid) \\\n        .update(hold=True)\n\n    # Step 2: Dial new agent into the same conference\n    client.calls.create(\n        to=new_agent_phone,\n        from_=\"+15551234567\",\n        twiml=f'<Response><Dial><Conference>{conference_name}</Conference></Dial></Response>',\n        status_callback=\"https://yourapp.com/transfer-agent-status\"\n    )\n\n    # Step 3: Original agent briefs new agent (caller is on hold, can't hear)\n    # ... agents talk ...\n\n    # Step 4: Take caller off hold\n    client.conferences(conference_sid) \\\n        .participants(caller_call_sid) \\\n        .update(hold=False)\n\n    # Step 5: Original agent leaves\n    client.conferences(conference_sid) \\\n        .participants(original_agent_call_sid) \\\n        .update(status=\"completed\")  # Removes from conference\n```\n\n### Cold Transfer\n\nSimpler — just redirect the caller to a new agent without briefing.\n\n**Python**\n```python\ndef cold_transfer(conference_sid, original_agent_call_sid, new_agent_phone, conference_name):\n    # Remove original agent\n    client.conferences(conference_sid) \\\n        .participants(original_agent_call_sid) \\\n        .update(status=\"completed\")\n\n    # Dial new agent into conference\n    client.calls.create(\n        to=new_agent_phone,\n        from_=\"+15551234567\",\n        twiml=f'<Response><Dial><Conference>{conference_name}</Conference></Dial></Response>'\n    )\n```\n\n### Hold vs Mute\n\n| Feature | Hold | Mute |\n|---------|------|------|\n| Participant hears | Hold music | Everything (but can't speak) |\n| Other participants hear | Nothing from held party | Nothing from muted party |\n| Use when | Transfer briefing, agent lookup | Quick aside (agent mutes self to cough) |\n| API | `hold=True` | `muted=True` |\n\n```python\n# Hold — plays music to the held participant\nclient.conferences(conf_sid).participants(participant_sid).update(hold=True)\nclient.conferences(conf_sid).participants(participant_sid).update(hold=False)\n\n# Mute — silences the participant but they still hear\nclient.conferences(conf_sid).participants(participant_sid).update(muted=True)\nclient.conferences(conf_sid).participants(participant_sid).update(muted=False)\n```\n\n**Critical distinction:** Hold plays music. Mute just silences. Using mute when you mean hold exposes agent-side conversations to the caller.\n\n### Coaching (Supervisor Whisper)\n\nSupervisor joins the Conference and can speak to the agent only — the caller cannot hear the supervisor.\n\n**Python**\n```python\ndef add_coach(conference_sid, supervisor_phone, conference_name):\n    \"\"\"Add supervisor as coach — speaks to agent only, caller can't hear.\"\"\"\n    client.calls.create(\n        to=supervisor_phone,\n        from_=\"+15551234567\",\n        twiml=f'''<Response>\n            <Dial>\n                <Conference\n                    coach=\"{agent_call_sid}\"\n                    statusCallback=\"https://yourapp.com/coach-events\"\n                >{conference_name}</Conference>\n            </Dial>\n        </Response>'''\n    )\n```\n\n**Node.js**\n```node\nasync function addCoach(conferenceSid, supervisorPhone, conferenceName, agentCallSid) {\n    await client.calls.create({\n        to: supervisorPhone,\n        from: \"+15551234567\",\n        twiml: `<Response>\n            <Dial>\n                <Conference coach=\"${agentCallSid}\">${conferenceName}</Conference>\n            </Dial>\n        </Response>`,\n    });\n}\n```\n\n**Coach behavior:**\n- Supervisor hears both caller and agent\n- Supervisor can speak to agent only (caller cannot hear)\n- Coach audio is NOT captured in conference recording — record separately if needed\n- To switch from coach to barge (speak to everyone), update the participant\n\n### Supervisor Barge\n\nSupervisor joins and speaks to everyone — useful for escalation or takeover.\n\n```python\ndef barge_in(conference_sid, supervisor_phone, conference_name):\n    \"\"\"Supervisor joins as full participant — everyone hears them.\"\"\"\n    client.calls.create(\n        to=supervisor_phone,\n        from_=\"+15551234567\",\n        twiml=f'<Response><Dial><Conference>{conference_name}</Conference></Dial></Response>'\n    )\n```\n\n### Participant Management\n\n```python\n# List all participants in a conference\nparticipants = client.conferences(conference_sid).participants.list()\nfor p in participants:\n    print(f\"CallSid: {p.call_sid}, Muted: {p.muted}, Hold: {p.hold}\")\n\n# Remove a participant\nclient.conferences(conference_sid).participants(call_sid).update(status=\"completed\")\n\n# End the entire conference\nclient.conferences(conference_sid).update(status=\"completed\")\n```\n\n---\n\n## Gotchas\n\n### 1. Conference Requires 2+ Participants to \"Exist\"\n\nA Conference with only one participant is in a waiting state. The single participant hears hold music. API calls to the Conference may behave unexpectedly until a second participant joins.\n\n### 2. Coach Audio Not in Recording\n\nConference recordings capture the main audio mix only. Coach/whisper audio is NOT recorded. If you need to record coaching sessions for QA, add a separate recording on the supervisor's call leg.\n\n### 3. endConferenceOnExit Behavior\n\nIf `endConferenceOnExit=True` for any participant, the conference ends when they leave — dropping all other participants. Set this carefully:\n- Caller: Usually `False` (so agents can wrap up)\n- Agent: Usually `False` (so caller can be transferred)\n- Supervisor: Always `False`\n\n### 4. Conference Name Is Account-Scoped\n\nConference names must be unique within your account at any given time. Use a unique identifier (like CallSid) in the name to prevent collisions:\n```python\nconference_name = f\"room-{call_sid}\"  # unique per call\n```\n\n---\n\n## CANNOT\n\n- **Cannot use `<Gather>` inside a Conference** — DTMF goes into the audio mix, not a handler. Gather before joining the conference.\n- **Cannot rely on speaker events for app logic** — Speaker events fire too frequently to be actionable in real-time routing.\n- **Cannot get post-flight participant data from REST API** — Completed conferences return empty participant lists. Use Voice Insights for historical data.\n- **Coach audio is NOT in the conference recording** — Supervisor whisper audio is excluded from the recorded mix. Record the supervisor's call leg separately if needed.\n- **Cannot filter Insights list endpoint by `processing_state`** — Must fetch by Conference SID directly.\n- **Cannot use PII in `friendlyName`** — Compliance requirement, not just a suggestion.\n- **Cannot create a conference with 0 call legs and get Insights data** — Insights requires at least 1 participant call attempt.\n- **Cannot poll Insights immediately after conference end** — Takes 15-30+ minutes for data to appear, even for `in_progress` state.\n- **Cannot exceed 250 participants per conference** — Hard limit\n- **Cannot pre-add phone numbers to a conference** — Participants must be active calls\n- **Cannot use a private URL for hold music** — Hold music URL must be publicly accessible\n- **Cannot get per-participant recordings from conference recording** — Recording is per-conference (mono mixed). Use dual-channel recording for QA — see `twilio-call-recordings`\n\n---\n\n## Next Steps\n\n- **Route calls to agents:** `twilio-taskrouter-routing`\n- **Record calls:** `twilio-call-recordings`\n- **IVR before conferencing:** `twilio-voice-twiml`\n- **AI agent with escalation:** `twilio-voice-conversation-relay`\n"
}

SHA-256: e920816bd1fb4ff6b0c4b8a6b98eddfce853bdf96ef304da5db69e0e9c182605