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

Connecting the first caller in the queue


Next, we're going to build on our first call queue system and a proper queue manager.

For this, we're going to create our queue a little differently; first, we want to create the queue in advance so that we can get the queue SID. You can also use a queue you previously created using the wait-times.php recipe.

This queue will also work by calling an agent directly rather than having an agent call in, and once they finish their call, the agent will then be connected to the next caller in the queue.

Getting started

The complete code for this recipe can be found in the Code/Recipe4/ folder.

How to do it…

OK, let's set up our files to place all incoming calls in a queue and then call the agent, by performing the following steps:

  1. Download the Twilio Helper Library available at https://github.com/twilio/twilio-php/zipball/master and unzip it.

  2. Upload the Services/ folder to your website.

  3. Upload config.php to your web server using the following code:

      <?php
       ...