Mais conteúdo relacionado Semelhante a East Bay Ruby Tropo presentation (20) East Bay Ruby Tropo presentation1. Tropo Adam Kalsey
www.Tropo.com akalsey@tropo.com
@tropo @akalsey
3. expensive
http://www.flickr.com/photos/amagill
4. GSM
G722 TAPI
JSR289
Telephony
Developers
SIP SS7
RTMP
JSR309
7. 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
10. • Call • Say
• Answer • Ask
• Transfer • Record
• Reject • Conference
• Hangup
11. 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
12. PHP Javascript
<?php answer();
answer(); say("Hello World");
say("Hello World"); hangup();
hangup();
?>
Ruby JSON
answer {"tropo":[{
say "Hello World" "say": "Hello World"
hangup }]}
Python Groovy
answer() answer()
say("Hello World") say("Hello World")
hangup() hangup()
14. event = call 'tel:+19166002497', {
:recordURI => 'http://example.com/',
:recordFormat => 'audio/mp3'}
function call($to, $options){
...
$_newCall_ = $callFactory->call(
$options['callerID'],
$to,
$options['recordURI'],
$options['recordFormat']
);
...
}
15. Tropo
Control API Routing Sciprting WebAPI
Moho
State Machine Events Monitoring Plugins...
JSR 289 JSR 309 JMX Clustering
PRISM Application Server
Speech Audio / Video
Call Recording Text to Speech
Recognition Conference
Plugin Signal
WAV / MP3 MRCP
Architecture Detection
Prophecy Media Server
17. Call or SMS: (510) 470-7863
GTalk, XMPP: bartdemo@tropo.im
http://github.com/tropo/tropo-samples/
18. 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]
end
end
say 'Thanks for listening! Goodbye.', :voice => 'simon'
21. $.phono({
onReady: function() {
this.phone.dial("510-867-5309")
}
})
22. Tropo Adam Kalsey
www.Tropo.com akalsey@tropo.com
@tropo @akalsey