O'Reilly logo

Twilio Cookbook by Roger Stringer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Leaving a message

OK, instead of hanging up the call when an agent doesn't answer, let's forward them to a company voice mailbox.

Getting Ready

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

How to do it...

We're going to set this up so that, if a caller can't reach an agent, or just generally wants to leave a message, they can do so by pressing 5.

  1. Download the Twilio Helper Library from https://github.com/twilio/twilio-php/zipball/master and unzip it.
  2. Upload the Services/ folder to your website.
  3. Update config.php to your website and make sure the following variables are set:
    <?php $dbhost = '';//YOUR DATABASE HOST $dbname = '';//YOUR DATABASE NAME $dbuser = '';//YOUR DATABASE USER $dbpass = '';//YOUR DATABASE PASS ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required