6. PHP 5 Social Networking, PHP 5 E-Commerce Development, Drupal Social Networking (6 & 7), Selling online with Drupal e-Commerce, Building Websites with TYPO3
11. Smith Electric Vehicles & Telemetry Worlds largest manufacturer of Commercial, all-electric vehicles Smith Link – on-board vehicle telematics system, capturing over 2500 data points each second on the vehicle and broadcasting them over mobile network ~400 telemetry enabled vehicles on the road Worlds largest telemetry project outside of F1
56. Ask for a Response <Response> <Gather action=“my-app-url/process" numDigits="1"> <Say>Welcome Conference PHP North West 2011 Delegates.</Say> <Say>For talks at 10 45 press 1.</Say> </Gather> <Say>Sorry, I didn't get your response.</Say> <Redirect>my-app-url</Redirect> </Response>
57. Ask for a Response $response = new Services_Twilio_Twiml(); $gather = $response->gather(array('numDigits' => 1)); $gather->say("Welcome Conference PHP North West 2011 Delegates."); $gather->say("For talks at 10 45 press 1."); $response->say("Sorry, I didn't catch that"); echo $response;
58. Act on a Response $response = (int) $_REQUEST['Digits']; header('Content-type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8"?>'; Switch( $response ) { case 1: echo ‘<Response><Say>Track 1 details…</Say></Response>’ break; case 2: echo ‘<Response><Say>Track 2 details…</Say></Response>’ break; } exit();
73. Really Basic Demo Application <?php $twilio = new TwilioDemo(); class TwilioDemo{ public function __construct() { header('Content-type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8"?>'; $route = ( isset( $_GET['route'] ) ) ? $_GET['route'] : ''; switch( $route ) { case 'process': $this->process(); break; default: case ''; $this->menu(); break; } } Based on the URL, redirect the user
74. Really Basic Demo Application Read the menu, if no response selected, repeat private function menu() { $out = <<<EOD <Response> <Gather action="http://www./twiliodemo/twiliodemo.php?route=process" numDigits="1"> <Say>Hello PHP North West Conference attendee. At Nine Thirty we have the keynote from Ian Barber, How to Stand on the Shoulders of Giants.</Say> <Say>For talks at 10 45, press 1.</Say> <Say>For talks at 11 45, press 2</Say> <Say>Lunch is at 12 45</Say> <Say>For talks at 2 press 3.</Say> <Say>For talks at 3, press 4.</Say> <Say>For talks at 4 30, press 5.</Say> <Say>For un conference talks, press 6.</Say> </Gather> <!-- If caller didn't press any keys, prompt and try again. --> <Say>Sorry, I didn't get your response.</Say> <Redirect>http://www..co.uk/twiliodemo/twiliodemo.php?route=main</Redirect> </Response> EOD; echo $out; exit(); }
75. Really Basic Demo Application private function process() { $selection = (int) $_REQUEST['Digits']; switch( $selection ) { case 1: $this->ten45(); break; case 2: $this->eleven45(); break; case 3: $this->two(); break; case 4: $this->three(); break; case 5: $this->four30(); break; case 5: $this->unconference(); break; default: $this->oi(); break; } } Process based on the user input
76. Really Basic Demo Application Read out the information private function ten45() { echo '<Response>'; echo '<Say>Track 1: Zend Framework 2 - State Of The Art : EnricoZimuel.</Say>'; echo '<Say>Track 2: REST and HATEOAS - A Case Study : Ben Longden.</Say>'; echo '<Say>Track 3: Magic Behind the Numbers - Software Metrics In Practice : Sebastian Marek.</Say>'; echo '<Redirect>http://www.invoicecentral.co.uk/twiliodemo/twiliodemo.php?route=main</Redirect>'; echo '</Response>'; }