Why Conferences?
Using Twilio Conferences instead of direct calls provides:- Transfers - Add/remove participants without dropping the call
- Hold - Put caller on hold while keeping the session
- Multi-party - Support for warm transfers and coaching
- Recording - Single recording of the entire call
Architecture Overview
Participant Labels
Each participant in a conference has a label:| Label | Description |
|---|---|
agent | The browser user (set via TwiML) |
customer | The PSTN number being called |
transfer-target | The transfer recipient |
- Agent:
participantLabel="agent"in TwiML - Customer:
label="customer"in REST API call - Transfer target: Set during transfer initiation
Call Flow
- Browser calls
device.connect({ To, From }) - Twilio hits
POST /v1/voice/twimlwebhook - Backend creates conference
conf-{uuid} - Returns TwiML:
<Conference startConferenceOnEnter="true">conf-{uuid}</Conference> - Agent joins conference
- Backend dials customer into same conference
Conference Map
The backend maintains a mapping:- Finding the conference during transfers
- Looking up hold status
- Managing participant state
In production, this map should be stored in Redis for multi-instance
deployments.