Skip to content

Instantly share code, notes, and snippets.

@radralph
Last active May 15, 2018 02:47
Show Gist options
  • Save radralph/0dc5fbd399a0b0439dc8 to your computer and use it in GitHub Desktop.
Save radralph/0dc5fbd399a0b0439dc8 to your computer and use it in GitHub Desktop.
call $caller, {:callerID => 'sip:21581156@sip.tropo.net'}
say "Hello! This is to inform you that we have sent a document you requested to the email you gave us. Kindly check your inbox or your spam folder for the message."
result = ask "Were you able to receive the document you requested? Press '1' for YES, or press '2' for NO.", {
:choices => "1,2",
:timeout => 10.0,
:attempts => 3,
:terminator => '#'
}
ans = result.value.to_s
if ans == "1"
say "We are glad to be of service. Goodbye!"
elsif ans == "2"
say "You need further assistance. Please wait as we connect you to an agent"
transfer ["9175609210","sip:21581156@sip.tropo.net"], {
:playvalue => "http://www.phono.com/audio/holdmusic.mp3",
:terminator => "*",
:callerID => "21581156",
:onTimeout => lambda { |event|
say "Sorry, but nobody answered"}}
else
say "You selected #{ans} which is not part of the list. Were you able to receive the bill you requested? Press '1' for YES, or press '2' for NO."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment