VoiceTel

Support / VoiceML examples / Build a conference bridge with VoiceML

Build a conference bridge with VoiceML.

Jurassic Park runs a fictional incident bridge. The control room opens it by calling in, park staff who call first wait on hold until it starts, visitors can listen without being heard, and the bridge closes for everyone when the control room hangs up. It is one document published on voiceml.org, with no application server.

Free trial <Conference> reference

What callers get

  • A moderator

    Calls from the control room’s numbers open the bridge, and the bridge closes when they hang up.

  • Hold until it starts

    Staff and visitors who call before the control room hear hold music, not silence.

  • Staff who speak

    Pressing 1 joins the bridge with a voice.

  • Visitors who listen

    Pressing 2 joins muted, without the join tone, to hear the bridge without interrupting it.

Before you start

  1. A VoiceML account with a phone number. See VoiceML or start a free trial.
  2. The numbers the control room calls from, in E.164 format.

The control room numbers in this document are fictional. They use the 555-0100 to 555-0199 range, which is set aside for fiction. Replace them with your own before you publish.

Step 1: Publish the document and point the number at it

Replace the control room numbers with your own, then publish it at voiceml.org and set the /r/ URL it returns as the phone number’s voice URL. Keep the URL exactly as returned, key included, and don’t post it publicly.

main.xml

<Response>
  {% assign control_room = "+15105550101,+15105550102" | split: "," %}

  {% if control_room contains From %}
    <!-- The control room opens the bridge, and closing it ends the call for everyone -->
    <Say>Control room, the incident bridge is open. Hold on to your butts.</Say>
    <Dial>
      <Conference startConferenceOnEnter="true" endConferenceOnExit="true" beep="true"
                  participantLabel="control-room">isla-nublar-incident</Conference>
    </Dial>
    <Hangup/>

  <!-- Park staff can speak, and wait on hold until the control room arrives -->
  {% elsif Digits == "1" %}
    <Say>Joining the incident bridge.</Say>
    <Dial>
      <Conference startConferenceOnEnter="false" beep="true"
                  participantLabel="staff">isla-nublar-incident</Conference>
    </Dial>
    <Say>The incident bridge has closed. Goodbye.</Say>
    <Hangup/>

  <!-- Visitors listen in, muted -->
  {% elsif Digits == "2" %}
    <Say>You are joining as a listener. You will hear the bridge, but you will not be heard.</Say>
    <Dial>
      <Conference startConferenceOnEnter="false" muted="true" beep="false"
                  participantLabel="visitor">isla-nublar-incident</Conference>
    </Dial>
    <Say>The incident bridge has closed. Goodbye.</Say>
    <Hangup/>

  {% else %}
    <Gather input="dtmf" numDigits="1" timeout="5" method="POST">
      <Say>Welcome to Jurassic Park visitor services.</Say>
      <Say>Park staff, press 1 to join the incident bridge. Visitors, press 2 to listen in.</Say>
    </Gather>
    <Say>We did not receive a selection. Goodbye.</Say>
    <Hangup/>
  {% endif %}
</Response>

Step 2: Test it

  1. From a phone that isn’t on the control room list, call and press 1. You hear hold music.
  2. From a control room phone, call the same number. The bridge opens and the two calls are connected.
  3. From a third phone, call and press 2. You hear the other two, but they can’t hear you.
  4. Hang up the control room phone. The other two calls leave the bridge and hear that it has closed.

How the bridge works

Everyone joins the same room with <Dial><Conference>isla-nublar-incident</Conference></Dial>. Room names are private to your account, so another account using the same name gets a separate room. What differs between callers is the attributes:

The <Conference> attributes for each kind of caller
Attribute Control room Staff Visitors
startConferenceOnEntertrue: starts the bridgefalse: waits on holdfalse: waits on hold
endConferenceOnExittrue: closes it for everyoneDefault falseDefault false
mutedDefault falseDefault falsetrue: heard by no one
beeptruetruefalse: joins without a tone
participantLabelcontrol-roomstaffvisitor

None of them sets waitUrl, so callers waiting for the control room hear the platform’s default hold playlist. The control room is recognized by From, using the same Liquid list check as the call screening example; everyone else chooses with a key. When a participant leaves the room, the document carries on after the <Dial>, which is where staff and visitors hear that the bridge has closed.

Where the movie turns up

References to Jurassic Park in the call flow
Where Reference
The room nameIsla Nublar, the park’s island.
The control room“Hold on to your butts,” Ray Arnold’s line.

Limits of this design

  • Anyone who calls can join as staff. There is no code to get in. To require one, add the check from the PIN-protected line example before the staff branch.
  • The control room must call from a listed number. Calling from any other phone joins as staff, and the bridge won’t start.
  • One room. Every call joins isla-nublar-incident. A second, simultaneous incident needs a second room name.
  • Not recorded. Add record="record-from-start" to the control room’s <Conference> to record the bridge; recording stops when the control room leaves.

Credits

  • Jurassic Park, Isla Nublar, and Ray Arnold come from Jurassic Park (1993), directed by Steven Spielberg, based on the novel by Michael Crichton, and distributed by Universal Pictures. Sam Neill, Laura Dern, Jeff Goldblum, and Richard Attenborough star; Samuel L. Jackson plays Ray Arnold, the park’s chief engineer.
  • The bridge, its callers, and its phone numbers are fictional in this example. VoiceTel is not affiliated with the film or its rights holders.
  • References: the <Conference> reference and the voiceml.org publishing and integration guide.

Trusted by