East Bay Ruby Tropo presentation

22
Adam Kalsey [email protected] @akalsey Tropo www.Tropo.com @tropo

description

I talked at East Bay Ruby on March 15. These are the slides the audience saw.

Transcript of East Bay Ruby Tropo presentation

Page 1: East Bay Ruby Tropo presentation

Adam [email protected]

@akalsey

Tropowww.Tropo.com

@tropo

Page 2: East Bay Ruby Tropo presentation

copper wires

http://www.flickr.com/photos/anselmhook

Page 3: East Bay Ruby Tropo presentation

expensive

http://www.flickr.com/photos/amagill

Page 4: East Bay Ruby Tropo presentation

Telephony Developers

SS7

JSR289

SIP

G722

RTMP

TAPIGSM

JSR309

Page 5: East Bay Ruby Tropo presentation

Web Developers

HTML

PHP

Ruby

REST

Javascript

JSON

URLs

Page 6: East Bay Ruby Tropo presentation

1,704 or 514,756?

Page 7: East Bay Ruby Tropo presentation

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

Page 8: East Bay Ruby Tropo presentation

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>

Page 9: East Bay Ruby Tropo presentation

http://tropo.com/http://github.com/tropo

Page 10: East Bay Ruby Tropo presentation

• Call

• Answer

• Transfer

• Reject

• Hangup

• Say

• Ask

• Record

• Conference

Page 11: East Bay Ruby Tropo presentation

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

Page 12: East Bay Ruby Tropo presentation

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" }]}

Page 13: East Bay Ruby Tropo presentation

Mozilla RhinoQuercus

PythonJython

JRuby

Page 14: East Bay Ruby Tropo presentation

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'}

Page 15: East Bay Ruby Tropo presentation

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

Page 17: East Bay Ruby Tropo presentation

Call or SMS: (510) 470-7863

GTalk, XMPP: [email protected]

http://github.com/tropo/tropo-samples/

Page 18: East Bay Ruby Tropo presentation

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'

Page 19: East Bay Ruby Tropo presentation

babelverse

Page 20: East Bay Ruby Tropo presentation

phono

Page 21: East Bay Ruby Tropo presentation

$.phono({ onReady: function() { this.phone.dial("510-867-5309") }})

Page 22: East Bay Ruby Tropo presentation

Adam [email protected]

@akalsey

Tropowww.Tropo.com

@tropo