Tropo is part of CiscoLearn More

name

Depending on the event that ends the method, event.name will be set to one of the following:

  • choice
  • record
  • timeout
  • badChoice
  • hangup
  • silenceTimeout
  • error

The following example would return "affirmative" or "negative" followed by "...which is a choice":

Examples

  var event = ask("Do you want to make an appointment? Say yes or no", {
   choices:"affirmative(yes, yeah, one), negative(no, nah, two)"
});
say("You said " + event.value + " which is a " + event.name);  
event = ask "Do you want to make an appointment? Say yes or no", {
   :choices => "affirmative(yes, yeah, one), negative(no, nah, two)"}
say "You said #{event.value} which is a #{event.name}"
<?php

$event = ask("Do you want to make the appointment?  Reply with yes or no", array(
   "choices" => "affirmative(yes, one), negative(no, two)"
));
 
say("You selected " . $event->value . " which is a " . $event->name);

?> 
event = ask("Do you want to make an appointment? Say yes or no", {
   "choices":"affirmative(yes, yeah, one), negative(no, nah, two)"})
say("You said " + event.value + " which is a " + event.name)
event = ask("Do you want to make an appointment? Say yes or no", [
   choices: "affirmative(yes, yeah, one), negative(no, nah, two)"])
say("You said $event.value which is a $event.name")