Created
August 13, 2010 19:15
-
-
Save mheadd/523398 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Include Tropo classes. | |
require('library/TropoClasses.php'); | |
// Create a new instance of the Tropo object. | |
$tropo = new Tropo(); | |
// Create a new Tropo Session Object and determine the channel in use. | |
$session = new Session(); | |
$from_info = $session->getFrom(); | |
// Ask the caller to say or enter start, depending on the channel used. | |
if($from_info["channel"] == Channel::$voice) { | |
$tropo->ask("To begin, say start.", array("choices" => "start", "attempts" => 3)); | |
} else { | |
$tropo->ask("To begin, enter start.", array("choices" => "start")); | |
} | |
$tropo->on(array("event" => "continue", "next" => "test-2.php", "say" => "Please hold...")); | |
// Render the JSON for the Tropo WebAPI to consume. | |
$tropo->RenderJson(); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Include Tropo classes. | |
require('library/TropoClasses.php'); | |
// Create a new instance of the Result object. | |
$result = new Result(); | |
// Create a new instance of the Tropo object. | |
$tropo = new Tropo(); | |
// Tell the user what they entered. | |
$tropo->say("You entered, ".$result->getValue()); | |
// Hangup when finished. | |
$tropo->hangup(); | |
// Render the JSON for the Tropo WebAPI to consume. | |
$tropo->RenderJson(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment