2017 © Pedro Peláez
 

package fuel-twilio

Twilio package for FuelPHP

image

maca134/fuel-twilio

Twilio package for FuelPHP

  • Wednesday, January 2, 2013
  • by maca134
  • Repository
  • 2 Watchers
  • 5 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Twilio

Twilio is a package to allow interaction with the Twilio service., (*1)

Installation

  1. Clone (git clone git://github.com/maca134/fuelphp-twilio) / download
  2. Copy to fuel/packages/
  3. Copy fuel/packages/twilio/config/twilio.php to fuel/app/config/
  4. Add your Twilio credentials and defaults for each twiml element.

Introduction

Rest API

This package will allow you to send requests to Twilio:, (*2)

TwiML: Twilio Markup Language

It also includes an object based implementation of Twilio's TwiML., (*3)

Here are the TwiML elements:, (*4)

Configuration

Copy config/twilio.php to app/config/twilio.php and change whatever setting in need of changing., (*5)

Rest API Examples

Make a call

$call = Twilio\Twilio::request('MakeCall');
$response = $call->create(array(
    'To' => '+4412345678901',
    'From' => '+4416789012345',
    'Url' => Uri::create('welcome/call')
));

Send an SMS message

$sms = Twilio\Twilio::request('SmsMessage');
$response = $sms->create(array(
    'To' => '+4412345678901',
    'From' => '+4416789012345',
    'Body' => 'SMS content'
));

TwiML Examples

Simple Example

$twiml = Twilio\Twilio::twiml();
$twiml->say('Hello World!')->pause('', array('length' => '5'));
$twiml->render();

Will render:, (*6)

<?xml version="1.0" encoding="UTF-8" ?>
    <Response>
        <Say voice="man" language="en" loop="1">Hello World!</Say>
        <Pause length="5" />
    </Gather>
</Response>

Grabbing key presses during a call

$question = Twilio\Twilio::twiml();
$question->say('Please press 1 or 2')->pause()->play('http://some.place.com/music.mp3');

$twiml = Twilio\Twilio::twiml();
$twiml->pause()->gather($question, array(
    'action' => Uri::create('twilio/next_action'),
    'numDigits' => '1'
        )
);
$response = $twiml->render();

Sending an SMS message

$twiml = Twilio\Twilio::twiml();
$twiml->sms($message, array('from' => '+441234567890'));

Notes

Only the TwiML elements Gather and Dial have nested objects., (*7)

Gather can have the following nested variables:, (*8)

  • Say
  • Play
  • Pause

Dial can have:, (*9)

  • A string, telephone number
  • Number
  • Client
  • Conference

Get In Touch

You can get in touch either through GitHub or you can email me at maca134@googlemail.com., (*10)

Checkout my site at http://maca134.co.uk, (*11)

Thanks

The Versions

02/01 2013

dev-master

9999999-dev https://github.com/maca134/fuel-twilio

Twilio package for FuelPHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

log fuelphp error twilio