Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Adding Programmable Voice participants to Video Rooms

Overview

The Programmable Video Rooms API enables developers to add real-time voice and video into web, mobile, and desktop applications. With the Programmable Voice integration, developers can now connect PSTN (Public Switched Telephone Network) and SIP audio calls into their Programmable Video Rooms.

Working with Twilio Video Rooms in TwiML

Programmable Video Rooms are represented in TwiML through the Room noun and Connect verb.

To connect a Programmable Voice call to a Video Room, use the noun with the UniqueName (see the Room REST API documentation for further information):

    <?xml version="1.0" encoding="UTF‐8"?>
    <Response>
      <Connect>
        <Room>DailyStandup</Room>
      </Connect>
    </Response>

The name of the Room is up to you and is namespaced to your account.

Connecting Incoming calls to a Video Room

The Programmable Voice documentation shows how to handle incoming voice calls. When a call comes in, Twilio will webhook into your webserver to request TwiML. To connect the incoming call to a Programmable Video Room, your webserver should be respond back with a TwiML response containing a noun as show above.

Making Outgoing calls and connecting them to a Video Room

The Programmable Voice documentation shows how to make outgoing calls. Twilio will webhook into your webserver when the called party answers the call to request TwiML. To connect the call to a Programmable Video Room, your webserver should be respond back with a TwiML response containing a noun as show above.

Setting the Voice participant’s Identity

Programmable Video Rooms expect every Participant to have a unique Participant identity. Every Programmable Voice participant that joins a Programmable Video Room is considered to be a new participant. You can set a unique identity on the voice caller participant using 'participantIdentity'. If participantIdentity is not provided, then Twilio will generate a random string and set it as the Participant identity.

    <?xml version="1.0" encoding="UTF-8"?>
    <Response>
      <Connect>
        <Room participantIdentity='alice'>DailyStandup</Room>
      </Connect>
    </Response>

Note: Programmable Video requires each Participant to have a unique identity. If duplicate Participants join a Programmable Video Room, then Twilio will disconnect the original duplicate participant and throw an error.

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.