Menu

Expand
Rate this page:

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.

Known Issues

  • The <Connect> verb is designed to connect individual PSTN phone calls into a Video Room. This functionality should not be used to bridge a Programmable Voice Conference with a Video Room. This is an unsupported use case and it can fail in unexpected ways.
Rate this page:

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 by visiting our Twilio Community forums or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

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

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more