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
call('[email protected]', [ | |
network: 'GMAIL', | |
onAnswer: { | |
ask("Hey, did you remember to take your pills?", [ | |
timeout: 120, | |
choices: 'yes(yes,y,1), no(no,n,2)', | |
onChoice: { event-> | |
if(event.value == "yes") { | |
say "ok, just checkin." | |
} else { |
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
answer() | |
ask("Welcome to the Tropo company directory. Who are you trying to reach?", [ | |
choices: "department(support, engineering, sales), person(jose, jason, adam)", | |
onChoice: { event-> | |
switch(event.value) { | |
case "department": | |
log("Department info: $event.choice.interpretation") | |
break | |
case "person": | |
log("Person info: $event.choice.interpretation") |
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
answer() | |
result = ask("What's your favorite color?", [ | |
choices: "red, blue, green"]) | |
log("They said: $result.value") | |
hangup() |
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
answer() | |
result = ask("What's your favorite color?", [ | |
attempts: 3, | |
choices: "red, blue, green", | |
onBadChoice: { event-> | |
switch(event.attempt){ | |
case 1: | |
say "We don't support that color. You can say red, blue or green." | |
break | |
case 2: |
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
answer() | |
record("Please leave your message at the beep.", [ | |
beep: true, | |
timeout: 10, | |
silenceTimeout: 7, | |
maxTime: 60, | |
onRecord: { event-> | |
log("Recording result = " + event.recordURI) | |
say("You said " + event.recordURI)} | |
]) |
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
answer() | |
startCallRecording("http://myServer.com/recordings/testfile.wave", [ | |
transcriptionOutURI: "mailto:[email protected]"]) | |
//continue with your script here | |
stopCallRecording() | |
hangup() |
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
answer() | |
say("Please wait while we transfer your call") | |
transfer("tel:+14075551212", [ | |
playvalue: "http://myServer.com/ElevatorMusic.wav", | |
onTimeout: { event-> | |
say "Sorry, but nobody answered" } | |
]) |
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
<?xml version= "1.0"?> | |
<grammar xmlns="http://www.w3.org/2001/06/grammar" | |
xml:lang="en-US" root = "MYRULE"> | |
<rule id="MYRULE" scope="public"> | |
<one-of> | |
<item>james brown </item> </one-of> | |
</rule> | |
</grammar> | |
<?xml version= "1.0"?> |
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
answer() | |
ask("What's your four digit pin?", [ | |
choices: "[4 DIGITS]", | |
mode: "voice", | |
recognizer: "en-us", // will recognize 'one two three four' | |
onChoice: {event -> say("You said $event.value")} | |
]) | |
answer() | |
ask("¿Cuál es su número de identificación?", [ |
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
answer() | |
say("Welcome to the geek singles hotline!") | |
conference("1337", [terminator: "*"]) | |
say("We hope you had fun, call back soon!") | |
hangup() |