Skip to content

Instantly share code, notes, and snippets.

@marks
Created August 20, 2009 04:43
Show Gist options
  • Save marks/170841 to your computer and use it in GitHub Desktop.
Save marks/170841 to your computer and use it in GitHub Desktop.
require "socket"
tcp_socket = TCPSocket.new('thehost', 20000)
active_call = true
options = { :choices => '1,2,3,4,5,6,7,8,9,0' }
while active_call == true do
result = ask 'Please enter a command.', options
if result.value == 0
active_call = false
else
tcp_socket.send result.value
end
end
say 'Thank you, goodbye.'
tcp_socket.close
hangup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment