Book Image

Twilio Cookbook: Second Edition

By : Roger Stringer
Book Image

Twilio Cookbook: Second Edition

By: Roger Stringer

Overview of this book

Table of Contents (20 chapters)
Twilio Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Muting a participant


Sometimes, when you get a list of conference participants, it's nice to be able to mute someone. Maybe there's too much noise on one end, a participant is being disruptive, or the moderator only wants one speaker to talk (in the case of seminars). This recipe lets you mute and unmute your callers.

Getting ready

The complete source code for this recipe can be found in the Chapter4/ folder.

How to do it...

We're going to create three files in this recipe.

  1. The first file is view.php. Add the following code to it:

    <?php
    include("config.php");
    include("pdo.class.php");
    include 'Services/Twilio.php';
    $pdo = Db::singleton();
    $client = new Services_Twilio($accountsid, $authtoken);
    ?>
    <table>
    <thead>
    <tr>
      <td>Participant</td>
      <td>Muted</td>
      <td></td>
    </thead>
    <tbody>
    <?php
    foreach ($client->account->conferences->getIterator(0, 50, array("Status" => "in-progress","FriendlyName" => $_GET[...