Last active
September 17, 2016 21:42
-
-
Save exaV/6be84f24513a12203a0a77b91bdc7b1e 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
call(phonenumber) | |
say("hi") | |
say(msg) | |
promtForAnswer() | |
hangup() | |
def promtForAnswer(): | |
result = ask("Press 1 if you understood this message Press 2 to hear it again Press 3 to call your emergency number", { | |
"choices":"1,2,3", | |
"terminator":"#", | |
"timeout":15.0, | |
"mode":"dtmf", | |
"interdigitTimeout":5, | |
"onBadChoice": lambda event : promtForAnswer() | |
}) | |
if (result.value == "1"): | |
say("Have a nice day") | |
elif (result.value == "2"): | |
say(msg) | |
promtForAnswer() | |
elif (result.value == "3"): | |
say("calling emergency number now") | |
wait(2000) | |
say("sorry") | |
wait(1000) | |
say("noone picked up") | |
wait(1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment