Skip to content

Instantly share code, notes, and snippets.

@andrewwatson
Created June 30, 2011 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewwatson/1055598 to your computer and use it in GitHub Desktop.
Save andrewwatson/1055598 to your computer and use it in GitHub Desktop.
Call me and Read Me A Text
<?php
// Where I define my credentials in AccountSid and AuthToken
include("../config.inc");
// Twilio Helper Library
include("twilio.php");
$what = $_POST['Body'];
$T = new TwilioRestClient($AccountSid, $AuthToken, "https://api.twilio.com/2010-04-01");
$vars = array("Url" =>
"http://twimlets.com/message?Message%5B0%5D=" . urlencode($what),
"From" => $_POST['To'],
"To" => $_POST['From']
);
$resp = $T->request("Accounts/${AccountSid}/Calls", "POST", $vars);
header("Content-type: text/xml");
?>
<Response>
</Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment