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:
Download the Twilio Helper Library available at https://github.com/twilio/twilio-php/zipball/master and unzip it.
Upload the
Services/
folder to your website.Upload
config.php
to your web server using the following code:<?php ...