Recipes← all recipesView on GitHub

Build a conference call

Voiceconference calling

Put several legs in one room and control each member independently.

conference

The claim

Several callers in one audio room, with nothing created beforehand. join_conference takes a name, and every call using that name is in that conference. Once the room exists, members can be muted, removed and listed over REST.

Why it holds

The interesting part is not joining. It is who is allowed to end the room.

How it works

name is the only required field, and it is the whole identity of the room.

- join_conference:
    name: standup
    start_on_enter: false
    end_on_exit: false
    beep: onEnter
    max_participants: 25

start_on_enter and end_on_exit are per participant, which is what lets one document be a host and another a guest. The host starts the room and closes it; a guest joining early waits, and a guest hanging up leaves everyone else talking. Give every participant end_on_exit: true and the first person to drop off ends the meeting.

Two fields are narrower than they look. beep is one of true, false, onEnter or onExit, and status_callback_event takes a *single* event name from start, end, join, leave, mute, hold, modify, speaker or announcement. A space-separated list of events is a natural thing to write and does not validate.

Membership control is Compatibility REST, once the room has a SID:

client.compat.conferences.update_participant(conf, call, Muted="true")
client.compat.conferences.remove_participant(conf, call)
client.compat.conferences.list_participants(conf)

Removing a participant ends their call and leaves the room running.

Limitations

The room is a string, so anyone who can serve a document naming it can join. There is no membership check here; if that matters, the name should be a secret you mint per meeting rather than standup.

Participant control needs the conference SID, which arrives on the status callback. Before the first participant joins there is nothing to address.

What to change first

Set end_on_exit: true on the guest document. The first guest to hang up ends the standup for everyone.