Sketching in VOIP with Tropo
At eComm Jeevan and I heard some intriguing stuff about a service called Tropo, a cloud-based scriptable VOIP system designed to let web hackers start working in the voice and telephony world.
The app provides a pretty damn slick interface to quickly set up a real phone number (plus SIP plus Skype, all in one place), then assign it to a script written in javascript, groovy, python, ruby, or probably whatever other BSF language they support.
Here’s one I wrote and deployed in about 20 minutes to read off all the Miniature Monster descriptions from the RSS feed (Tropo calls highlighted). You can test it out by calling (650) 273-5382 (or +99000936 9991428654 on Skype, though I haven’t tried that):
require 'net/http'
require 'rexml/document'
answer
wait(3000)
say "hello, welcome to professor engd's miniature monster hotline. here are your monster updates."
wait(1000)
url = "http://feedproxy.google.com/miniaturemonsters"
xml_data = Net::HTTP.get_response(URI.parse(url)).body
xml_doc = REXML::Document.new(xml_data)
xml_doc.elements.to_a( "//description" ).reverse.each do |desc|
if (m = (/\<div id=\"description\">\s*\<em\>(.*?)\<\/em\>\<\/div\>/i).match(desc.text))
say m[1]
wait(1000)
end
end
hangup
I’ve worked on some projects recently involving Asterisk-to-web-to-hardware style hacking, typically using something like Gizmo to register a regular phone number assigned to a SIP number, then setting up asterisk as the SIP softphone and messing around with a retarded dialplan syntax to get things going. Tropo seems to simplify all that… substantially.
The documentation is solid if a little thin, but it’s so new, and the app is so slick and well done, so I’m sure there’s more coming. It’s unclear at this point which Ruby libraries and gems they support, if any. And it all feels a little like a toy, but no more than, say, Google App Engine, and for me it’s actually more potentially useful. What I can say at this point is that it’s a solid way to sketch your telelphony ideas quickly and with zero setup time, which is very cool. Are you listening ITP?
Anyway, happy voip hacking.



