Tropo is part of CiscoLearn More

Changing Ask Timeouts

As mentioned in 5 Steps to Ask Compete Questions, Tropo will by default wait up to thirty seconds for the user to respond. What if you want to wait 10 seconds between attempts instead of thirty? Just use the timeout parameter:

var result = ask("What's your favorite color?  Choose from red, blue or green.", {
    choices: "red, blue, green",
    timeout: 10.0,
    attempts: 3
});
say("You chose " + result.value);
result = ask "What's your favorite color?  Choose from red, blue or green.", {
    :choices => "red, blue, green",
    :timeout => 10.0,
    :attempts => 3}
say "You chose " + result.value
<?php

$result = ask("What's your favorite color?  Choose from red, blue or green.", array(
    "choices" => "red, blue, green",
    "timeout" => 10.0,
    "attempts" => 3,
));
say("You chose" . $result->value);

?>
result = ask("What's your favorite color? Choose from red, blue or green.", {
    "choices":"red, blue, green",
    "timeout":10.0,
    "attempts":3})
say("You chose " + result.value)
result = ask("What's your favorite color? Choose from red, blue or green.", [
    choices: "red, blue, green",
    timeout: 10.0,
    attempts: 3])
say("You chose $result.value")

With the above, Tropo will still ask up to three times, but only wait 10 seconds between attempts.

Next chapter covers including some error handling into your app.