Skip to content

Instantly share code, notes, and snippets.

@exaV
Last active September 17, 2016 21:42
Show Gist options
  • Save exaV/6be84f24513a12203a0a77b91bdc7b1e to your computer and use it in GitHub Desktop.
Save exaV/6be84f24513a12203a0a77b91bdc7b1e to your computer and use it in GitHub Desktop.
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