Skip to content

Instantly share code, notes, and snippets.

@johntdyer
Created January 30, 2011 20:48
Show Gist options
  • Save johntdyer/803231 to your computer and use it in GitHub Desktop.
Save johntdyer/803231 to your computer and use it in GitHub Desktop.
module OperatorModule
OPERATOR_NUMBER='14074740214'
TOKEN_ID='612ebc93f0db5440a345dcf231a7b654b4db6bc77729233a5e29f759bc185257e32c111c5c53c269d5ea83ac'
def call_operator(id)
puts "call_operator(#{id})"
uri = URI.parse("http://api.tropo.com/1.0/sessions?action=create&operator_number=#{OPERATOR_NUMBER}&token=#{TOKEN_ID}&conf_id=#{id}")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
puts "Token sent to operator HTTP/#{response.code}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment