East Bay Ruby Tropo presentation
-
Upload
adam-kalsey -
Category
Technology
-
view
1.301 -
download
4
description
Transcript of East Bay Ruby Tropo presentation
copper wires
http://www.flickr.com/photos/anselmhook
expensive
http://www.flickr.com/photos/amagill
Telephony Developers
SS7
JSR289
SIP
G722
RTMP
TAPIGSM
JSR309
Web Developers
HTML
PHP
Ruby
REST
Javascript
JSON
URLs
1,704 or 514,756?
menu 'welcome', 'for-spanish-press-8', 'main-ivr', :timeout => 8.seconds, :tries => 3 do |link| link.shipment_status 1 link.ordering 2 link.representative 4 link.spanish 8 link.employee 900..999 link.on_invalid { play 'invalid selection' } end
voicexml
<?xml version="1.0" encoding="UTF-8"?><vxml version = "2.1" > <form> <block> <prompt> Hello World. This is my first telephone application. </prompt> </block> </form></vxml>
http://tropo.com/http://github.com/tropo
• Call
• Answer
• Transfer
• Reject
• Hangup
• Say
• Ask
• Record
• Conference
answer
options = { :choices => '1 (1,sales), 2 (2 support)' }result = ask 'Hi. For sales, say Sales or press 1. For support, say Support or press 2.', options
if result.name == 'choice' case result.value when '1' say 'Your money is important to us.' when '2' say 'Your call will be ignored in the order received.' end end
hangup
PHP
<?phpanswer();say("Hello World");hangup();?>
Javascript
answer();say("Hello World");hangup();
Ruby
answersay "Hello World"hangup
Python
answer()say("Hello World")hangup()
Groovy
answer()say("Hello World")hangup()
JSON
{"tropo":[{ "say": "Hello World" }]}
Mozilla RhinoQuercus
PythonJython
JRuby
function call($to, $options){ ... $_newCall_ = $callFactory->call( $options['callerID'], $to, $options['recordURI'], $options['recordFormat'] ); ...}
event = call 'tel:+19166002497', { :recordURI => 'http://example.com/', :recordFormat => 'audio/mp3'}
Prophecy Media Server
PRISM Application Server
Tropo
Moho
State Machine Events Monitoring Plugins...
Control API Routing Sciprting WebAPI
JSR 289 JSR 309 JMX Clustering
Call Recording Speech Recognition Text to Speech Audio / Video
Conference
WAV / MP3 Plugin Architecture
Signal Detection MRCP
require 'rubygems'require 'open-uri'require 'json'
default_voice = 'en'voices = { :es => { :lang => 'Spanish', :name => 'Carmen' }, :de => { :lang => 'German', :name => 'Katrin' }, :it => { :lang => 'Italian', :name => 'Paola' }, :nl => { :lang => 'Dutch', :name => 'Saskia' }, :fr => { :lang => 'French', :name => 'Florence' }, :pl => { :lang => 'Polish', :name => 'zosia' } }
text = 'Berkeley is such a beautiful city!'translate_uri = "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=#{text}"
say text, :voice => 'vanessa'
voices.each do |voice| url = URI.encode(translate_uri + "&langpair=#{default_voice}|#{voice[0].to_s}") translation = JSON.parse(open(url).read) say "Now in #{voice[1][:lang]}", :voice => 'victor' log translation.inspect if translation['responseData']['translatedText'] say translation['responseData']['translatedText'], :voice => voice[1][:name] endend
say 'Thanks for listening! Goodbye.', :voice => 'simon'
babelverse
phono
$.phono({ onReady: function() { this.phone.dial("510-867-5309") }})