SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
RoR puede también hablar:
Interface de voz con Rails

              Svet Ivantchev, eFaber
                 svet@efaber.net

 22 de noviembre de 2007, ConferenciaRails 2007, Madrid
¿Qué es VoIP?
Ejemplos




           ... y 1000s más
¿Es por dinero?


• Ok, las llamadas VoIP son baratas pero no
  eso es importante
• Flexibilidad y integración con aplicaciones
Demo

• Consulta de notas por web
• Consulta de notas por teléfono

        La voz es una interface más
¿Por qué ahora?

• Web stack (ej: SO, BD, RoR :-))
• VoIP (ej: Asterisk)
• Ancho de banda
• Los IVR dejan mucho que desear
Asterisk (conceptos)
                    http://asterisk.org



• Centralita Open
  Source (PBX)
• Protocolos: SIP, IAX
• Proveedores
Componentes
Clientes VoIP                                      DID


                      SIP, IAX   SIP, IAX




                                        SIP, IAX
                ZAP

  Red PSTN                                   Terminación
Asterisk (instalación)
compilamos:
  $ wget http://downloads.digium.com/pub/
                 asterisk/releases/asterisk-1.4.13.tar.gz
  $ tar zxvf asterisk-1.4.13.tar.gz
  $ cd asterisk-1.4.13
  $ ./configure
  $ make menuselect
  $ make
  $ sudo make install
  $ sudo make samples


comprobamos:
  $ sudo asterisk -vvvvvc
voces en castellano: http://www.voipnovatos.es
Asterisk (config)
en /etc/asterisk/sip.conf

   [pb15]                             [spa941]
   context=demo1                      context=demo1
   type=friend                        type=friend
   secret=sekreto42                   secret=otrapassw
   host=dynamic                       host=dynamic
   canreinvite=no                     canreinvite=no



en /etc/asterisk/extensions.conf
    [demo1]
    exten => 101,1,Dial(SIP/pb15)
    exten => 102,1,Dial(SIP/spa941)
Cliente softphone
Cliente hardware
Números públicos
DID y SIP URI
Demo


• Llamada entre dos números
• Con el número público
Ideas
• Respuesta diferente por horas
• Respuesta diferente en función del CallerID
• Integración con Jabber
• Voicemail
• IVR, colas
• 1000s de cosas mas ...
El dialplan se complica
[efmenu]
include => users5xx
include => rooms
include => efhq
exten => s,1,NoOp(Entering eF main menu for caller ${CALLERID})
exten => s,2,Answer
exten => s,3,Wait(2)
exten => s,4,Playback(beep)
exten => s,5,Background(${SALUDOEN}enter-ext-of-person)
exten => s,6,Background(beep)
exten => s,7,WaitExten(15)
exten => 101,1,Playback(room-service)
exten => 101,2,Goto(efmenu,s,4)
exten => 999,1,Goto(svetdisa,s,1)
exten => 999,2,Goto(efmenu,s,4)
exten => i,1,Playback(pbx-invalid)
exten => i,2,Goto(efmenu,s,6)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup()
...y se hace feo
exten => 508,1,Macro(voicemail,SIP/esti)
exten => 509,1,Macro(voicemail,SIP/kolio)
exten => 510,1,Macro(voicemail,SIP/jean)
exten => 511,1,Macro(voicemail,SIP/ruben)
exten => 512,1,Macro(voicemail,SIP/inaki)



[macro-voicemail]
exten => s,1,Dial(${ARG1},30)
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Voicemail(u${MACRO_EXTEN})
exten => s-NOANSWER,n,Hangup()
exten => s-CHANUNAVAIL,1,Playback(unavailable)
exten => s-CHANUNAVAIL,n,Hangup()
exten => s-CONGESTION,1,Busy(5)
exten => s-CONGESTION,n,Hangup()
exten => s-BUSY,1,Voicemail(b${MACRO_EXTEN})
exten => s-BUSY,n,Hangup()
exten => _s-.,1,Goto(s-NOANSWER,1)
AGI y AMI


• Asterisk Gateway Interface
• Asterisk Manager Interface
Alternativas


  • Adhearsion
  • Telegraph
Adhearsion
   http://adhearsion.com


• El dialplan escrito en Ruby
• ActiveRecord integrado
• Integración con Rails
• versiones (0.7.7 vs 0.8)
Adhearsion 1: Hello World

  $ sudo gem install adhearsion
  $ ahn create hello1
  Creating /Users/svet/hello1/config/adhearsion.sqlite3
  Creating /Users/svet/hello1/config/adhearsion.yml
  Creating /Users/svet/hello1/config/database.rb
  Creating /Users/svet/hello1/config/database.yml
  Creating /Users/svet/hello1/config/helpers/drb_server.yml
  Creating /Users/svet/hello1/config/helpers/factorial.alien.c.yml
  Creating /Users/svet/hello1/config/helpers/growler.yml
  Creating /Users/svet/hello1/config/helpers/lookup.yml
  Creating /Users/svet/hello1/config/helpers/manager_proxy.yml
  Creating /Users/svet/hello1/config/helpers/micromenus/collab.rb
  ...
Hello World
en /etc/asterisk/extensions.conf

  [adhearsion]
  exten => 101,1,AGI(agi://127.0.0.1)


$ cd hello1


en extensions.rb

  dhearsion {
      play 'hello-word'
  }


$ ahn start .
internal {
    case extension
      when 101...200
        employee = User.find_by_extension extension
          if employee.busy? then voicemail extension
          else
            dial employee, :for => 10.rings
            voicemail unless last_call_successful?
          end
      when 888
        play weather_report(quot;Dallas Texasquot;)
      when 999 then +joker_voicemail
    end
}
Adhearsion II: Amazon
require 'amazon/search'

r = Amazon::Search::Request.new( '10N1KX1NVQZ2VXXXXXXX')

begin
  resp = r.keyword_search( '0596529260', 'books' )
  resp.products.each do |p|
    unless p.availability =~ /not available/
       printf( quot;%s (ASIN %s) -- %snquot;,
               p.product_name, p.asin, p.our_price )
    end
  end
rescue
  puts quot;No se encuentra.quot;
end



$ ruby price2
RESTful Web Services (ASIN 0596529260) -- $26.39
Adhearsion II: Amazon
adhearsion {
  require 'amazon/search'
  r = Amazon::Search::Request.new( '10N1KX1NVQZ2VXXXXXXX')
  begin
    resp = r.keyword_search( extension, 'books' )
    resp.products.each do |p|
      unless p.availability =~ /not available/
          play p.our_price
      end
    end
  rescue
    play quot;no-info-about-numberquot;
  end
}
voxbone {
  sleep 2.seconds
  play quot;hello-worldquot;
  isbn = input()
  require 'amazon/search'
  r = Amazon::Search::Request.new( '10N1KX1NVQZ2VXXXXXXX')
  begin
    resp = r.keyword_search( isbn, 'books' )
    resp.products.each do |p|
      unless p.availability =~ /not available/
         play p.our_price
      end
    end
  rescue
    play quot;no-info-about-numberquot;
  end
}
Telegraph
http://telegraph.rubyforge.org




       • MVC
       • respond_to
Telegraph y AGI
exten => 105, 1, AGI(agi://127.0.0.1/my_route?param1=value)



wants.voice do
 render_voice do |voice|
    voice.play “hello-world”
    voice.link_to_dtmf 'bank-lineitem-menu' do
      link 1, :action=>quot;newquot;
      link 2, :action=>quot;listquot;
      link 3, :action=>quot;indexquot;
    end
 end
end
Demo
<h1>Consultas</h1>
 <ul>
      <li> <%= link_to quot;Faltasquot;, :action=>quot;faltasquot; %> </li>
      <li> <%= link_to quot;Notasquot;, :action=>quot;notasquot; %> </li>
 </ul>

                                <h1>Consultar notas</h1>
                                <% form_tag '/alumnos/show_notas' do %>
                                  DNI: <%= text_field_tag 'dni' %>
                                  <%= submit_tag 'Ver notas' %>
                                <% end %>


def show_notas
      @alumno = Alumno.find_by_dni(params[:dni])
      @notas = @alumno.notas_ultima_evaluacion
end



                  <% @notas.each do |nota| %>
                    <tr>
                      <td class=quot;listquot;><%= nota.asignatura %></td>
                      <td class=quot;listquot;><%= nota.nota %></td>
                    </tr>
                    <% end %>
Telegraph
$ script/plugin install svn://rubyforge.org/var/svn/telegraph/trunk




en /etc/asterisk/extensions.conf:
exten => 777,1, AGI(agi://192.168.1.1:4574/alumnos/index)




en app/controllers/alumnos_controller.rb:
def index
      respond_to do |wants|
        wants.html { render }
        wants.voice {
          render_voice { |voice| voice.play_sound quot;hello-worldquot; }
        }
      end
end
Telegraph: configuración
$ vi config/telegraph.yaml


  development:
    agi_server: 127.0.0.1
    agi_port: 4574
    ami_server: druby://localhost:9000
    outgoing_call_path: /var/spool/asterisk/outgoing
    wakeup_call_path: /var/spool/asterisk/wakeups
    sound_path: /var/lib/asterisk/sounds
    recording_path: /var/lib/asterisk/sounds



$ script/agi_server
respond_to

  def index
    respond_to do |wants|
      wants.html { render }
      wants.voice { render_voice }
    end
  end


$ vi app/views/alumnos/index.voice


voice.play_sound quot;hello-worldquot;
index
# index.rhtml
<h1>Consultas</h1>
<ul>
  <li> <%= link_to quot;Faltasquot;, :action=>quot;faltasquot; %> </li>
  <li> <%= link_to quot;Notasquot;,   :action=>quot;notasquot; %> </li>
</ul>




                     # index.voice
                     voice.play_sound 'thank-you-for-calling'
                     voice.link_to_dtmf 'presione1-2' do
                       link 1, :controller => quot;alumnosquot;, :action => quot;faltasquot;
                       link 2, :action => quot;notasquot;
                     end
formulario
# notas.rhtml
<h1>Consultar notas</h1>
<% form_tag '/alumnos/show_notas' do %>
  DNI: <%= text_field_tag 'dni' %>
  <%= submit_tag 'Ver notas' %>
<% end %>




                           # notas.voice
                           voice.form :url=>{:controller =>
                           'alumnos', :action=>'show_notas'} do |form|
                            form.numeric_input 'dni', 'dni', :max_digits=>8
                           end
resultados
# show_notas rhtml
<h3>Notas de <%= @alumno.nombre %></h3>
<table class=quot;listquot;>
  <% @notas.each do |nota| %>
  <tr>
    <td class=quot;listquot;><%= nota.asignatura %></td>
    <td class=quot;listquot;><%= nota.nota %></td>
  </tr>
  <% end %>
</table>


                                      # show.voice
                                      @notas.each do |nota|
                                          voice.play nota.asignatura.to_slug
                                          voice.play nota.nota
                                      end
                                      sleep 2.seconds
                                      voice.play quot;vm-goodbyequot;
No hay que pasarse


  • Web vs Mobile web vs Voz
  • ej: 466453.com
Telegraph con AMI
$ script/generate ami_model AMIModel



# environment.rb (user y password en manager.conf):
Telegraph::AMIManager.establish_connection!(
    :host=> 'your.host.name.com',
    :username=>'user',
    :secret=>'password')
$ script/ami_server


# usar así:
AMIModel.create(:call, :channel=>'SIP/101', :context=>'default',
                :exten => 'outgoing', :priority=>1)
Links
•   http://asterisk.org/

•   http://www.voipnovatos.es

•   http://www.voip-info.org

•   http://adhearsion.com

•   http://www.linuxjournal.com/article/9519

•   http://telegraph.rubyforge.org

•   http://telegraph.rubyforge.org/wiki/wiki.pl?UsingAGI
Q &A

Weitere ähnliche Inhalte

Was ist angesagt?

WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hackingJeroen van Dijk
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hackingJeroen van Dijk
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with ExtbaseJochen Rau
 
Top 10 php classic traps php serbia
Top 10 php classic traps php serbiaTop 10 php classic traps php serbia
Top 10 php classic traps php serbiaDamien Seguy
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 WorldFabien Potencier
 
Your own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyYour own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyLindsay Holmwood
 
Routing System In Symfony 1.2
Routing System In Symfony 1.2Routing System In Symfony 1.2
Routing System In Symfony 1.2Alex Demchenko
 
Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmersxSawyer
 
Writing webapps with Perl Dancer
Writing webapps with Perl DancerWriting webapps with Perl Dancer
Writing webapps with Perl DancerAlexis Sukrieh
 
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)xSawyer
 

Was ist angesagt? (19)

WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hacking
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hacking
 
Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
 
Dancing Tutorial
Dancing TutorialDancing Tutorial
Dancing Tutorial
 
Top 10 php classic traps php serbia
Top 10 php classic traps php serbiaTop 10 php classic traps php serbia
Top 10 php classic traps php serbia
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 World
 
Your own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyYour own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with Ruby
 
PHP Tips & Tricks
PHP Tips & TricksPHP Tips & Tricks
PHP Tips & Tricks
 
Command
CommandCommand
Command
 
Routing System In Symfony 1.2
Routing System In Symfony 1.2Routing System In Symfony 1.2
Routing System In Symfony 1.2
 
Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmers
 
Writing webapps with Perl Dancer
Writing webapps with Perl DancerWriting webapps with Perl Dancer
Writing webapps with Perl Dancer
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Perl5i
Perl5iPerl5i
Perl5i
 
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)
 

Andere mochten auch

Teaching, Learning,Technology- Part 3
Teaching, Learning,Technology- Part 3Teaching, Learning,Technology- Part 3
Teaching, Learning,Technology- Part 3Chris Kennedy
 
Visual Design - Alfresco Green Theme
Visual Design - Alfresco Green ThemeVisual Design - Alfresco Green Theme
Visual Design - Alfresco Green ThemeAlfrescoUE
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsMike Subelsky
 
Legal Plan, Legal & ID Theft Shields for Group
Legal Plan, Legal & ID Theft Shields for GroupLegal Plan, Legal & ID Theft Shields for Group
Legal Plan, Legal & ID Theft Shields for Grouprickyholloway
 
Stranger Across the Amo River
Stranger Across the Amo RiverStranger Across the Amo River
Stranger Across the Amo Rivermusabomer
 
2008 Navidad Felicitacion
2008 Navidad Felicitacion2008 Navidad Felicitacion
2008 Navidad FelicitacionMireia Buchaca
 
Комплексное продвижение ВКонтакте
Комплексное продвижение ВКонтактеКомплексное продвижение ВКонтакте
Комплексное продвижение ВКонтактеPavel Grachev
 
Enterprise Brochure in English 8 7 2016
Enterprise Brochure in English 8 7 2016Enterprise Brochure in English 8 7 2016
Enterprise Brochure in English 8 7 2016Tove Selin
 
24_Working_Together_Global_Aggregation.original
24_Working_Together_Global_Aggregation.original24_Working_Together_Global_Aggregation.original
24_Working_Together_Global_Aggregation.originalChristina Lumsden
 
evidencia 4
evidencia 4evidencia 4
evidencia 4yesivira
 
DOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPS
DOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPSDOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPS
DOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPSfederico almenara ramirez
 

Andere mochten auch (17)

Teaching, Learning,Technology- Part 3
Teaching, Learning,Technology- Part 3Teaching, Learning,Technology- Part 3
Teaching, Learning,Technology- Part 3
 
OB Report
OB ReportOB Report
OB Report
 
Visual Design - Alfresco Green Theme
Visual Design - Alfresco Green ThemeVisual Design - Alfresco Green Theme
Visual Design - Alfresco Green Theme
 
Creativity
CreativityCreativity
Creativity
 
Amazing Landscapes
Amazing LandscapesAmazing Landscapes
Amazing Landscapes
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
 
Legal Plan, Legal & ID Theft Shields for Group
Legal Plan, Legal & ID Theft Shields for GroupLegal Plan, Legal & ID Theft Shields for Group
Legal Plan, Legal & ID Theft Shields for Group
 
DHRUV RESUME
DHRUV RESUMEDHRUV RESUME
DHRUV RESUME
 
Stranger Across the Amo River
Stranger Across the Amo RiverStranger Across the Amo River
Stranger Across the Amo River
 
2008 Navidad Felicitacion
2008 Navidad Felicitacion2008 Navidad Felicitacion
2008 Navidad Felicitacion
 
Clipping cnc 18032016 versão de impressão
Clipping cnc 18032016   versão de impressãoClipping cnc 18032016   versão de impressão
Clipping cnc 18032016 versão de impressão
 
Question 2
Question 2Question 2
Question 2
 
Комплексное продвижение ВКонтакте
Комплексное продвижение ВКонтактеКомплексное продвижение ВКонтакте
Комплексное продвижение ВКонтакте
 
Enterprise Brochure in English 8 7 2016
Enterprise Brochure in English 8 7 2016Enterprise Brochure in English 8 7 2016
Enterprise Brochure in English 8 7 2016
 
24_Working_Together_Global_Aggregation.original
24_Working_Together_Global_Aggregation.original24_Working_Together_Global_Aggregation.original
24_Working_Together_Global_Aggregation.original
 
evidencia 4
evidencia 4evidencia 4
evidencia 4
 
DOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPS
DOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPSDOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPS
DOMINGO 10º DEL TO. CICLO C. DÍA 5 DE JUNIO DEL 2016.PPS
 

Ähnlich wie Interface de Voz con Rails

Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the FinishYehuda Katz
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsAbhay Sapru
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overviewYehuda Katz
 
Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosEdgar Suarez
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricksbcoca
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!cloudbring
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottO'Reilly Media
 
What's new in Rails 4
What's new in Rails 4What's new in Rails 4
What's new in Rails 4Fabio Akita
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Librariesjeresig
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
Ch1(introduction to php)
Ch1(introduction to php)Ch1(introduction to php)
Ch1(introduction to php)Chhom Karath
 

Ähnlich wie Interface de Voz con Rails (20)

Mojolicious
MojoliciousMojolicious
Mojolicious
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutos
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter Scott
 
What's new in Rails 4
What's new in Rails 4What's new in Rails 4
What's new in Rails 4
 
EC2
EC2EC2
EC2
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
 
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Ch1(introduction to php)
Ch1(introduction to php)Ch1(introduction to php)
Ch1(introduction to php)
 
PHP PPT FILE
PHP PPT FILEPHP PPT FILE
PHP PPT FILE
 

Mehr von Svet Ivantchev

Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).Svet Ivantchev
 
Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)Svet Ivantchev
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a ElixirSvet Ivantchev
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Svet Ivantchev
 
Gaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot ControlGaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot ControlSvet Ivantchev
 
Gaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y FirmataGaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y FirmataSvet Ivantchev
 
Gaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBotGaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBotSvet Ivantchev
 
Gaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al ArduinoGaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al ArduinoSvet Ivantchev
 
Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?Svet Ivantchev
 
How Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human LearningHow Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human LearningSvet Ivantchev
 
Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2Svet Ivantchev
 
Libros electrónicos III
Libros electrónicos IIILibros electrónicos III
Libros electrónicos IIISvet Ivantchev
 
Libros electrónicos II - ePub
Libros electrónicos II - ePubLibros electrónicos II - ePub
Libros electrónicos II - ePubSvet Ivantchev
 
Libros electrónicos I
Libros electrónicos ILibros electrónicos I
Libros electrónicos ISvet Ivantchev
 
Cloud Computing: Just Do It
Cloud Computing: Just Do ItCloud Computing: Just Do It
Cloud Computing: Just Do ItSvet Ivantchev
 
Cloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'TsCloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'TsSvet Ivantchev
 
Los mitos de la innovación
Los mitos de la innovaciónLos mitos de la innovación
Los mitos de la innovaciónSvet Ivantchev
 

Mehr von Svet Ivantchev (20)

Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).
 
Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a Elixir
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
Gaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot ControlGaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot Control
 
Gaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y FirmataGaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y Firmata
 
Gaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBotGaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBot
 
Gaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al ArduinoGaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al Arduino
 
Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?
 
How Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human LearningHow Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human Learning
 
Vienen los Drones!
Vienen los Drones!Vienen los Drones!
Vienen los Drones!
 
Data Science
Data ScienceData Science
Data Science
 
Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2
 
Libros electrónicos III
Libros electrónicos IIILibros electrónicos III
Libros electrónicos III
 
Libros electrónicos II - ePub
Libros electrónicos II - ePubLibros electrónicos II - ePub
Libros electrónicos II - ePub
 
Libros electrónicos I
Libros electrónicos ILibros electrónicos I
Libros electrónicos I
 
Cloud Computing: Just Do It
Cloud Computing: Just Do ItCloud Computing: Just Do It
Cloud Computing: Just Do It
 
Cloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'TsCloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'Ts
 
BigData
BigDataBigData
BigData
 
Los mitos de la innovación
Los mitos de la innovaciónLos mitos de la innovación
Los mitos de la innovación
 

Kürzlich hochgeladen

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Interface de Voz con Rails

  • 1. RoR puede también hablar: Interface de voz con Rails Svet Ivantchev, eFaber svet@efaber.net 22 de noviembre de 2007, ConferenciaRails 2007, Madrid
  • 3. Ejemplos ... y 1000s más
  • 4. ¿Es por dinero? • Ok, las llamadas VoIP son baratas pero no eso es importante • Flexibilidad y integración con aplicaciones
  • 5. Demo • Consulta de notas por web • Consulta de notas por teléfono La voz es una interface más
  • 6. ¿Por qué ahora? • Web stack (ej: SO, BD, RoR :-)) • VoIP (ej: Asterisk) • Ancho de banda • Los IVR dejan mucho que desear
  • 7. Asterisk (conceptos) http://asterisk.org • Centralita Open Source (PBX) • Protocolos: SIP, IAX • Proveedores
  • 8. Componentes Clientes VoIP DID SIP, IAX SIP, IAX SIP, IAX ZAP Red PSTN Terminación
  • 9. Asterisk (instalación) compilamos: $ wget http://downloads.digium.com/pub/ asterisk/releases/asterisk-1.4.13.tar.gz $ tar zxvf asterisk-1.4.13.tar.gz $ cd asterisk-1.4.13 $ ./configure $ make menuselect $ make $ sudo make install $ sudo make samples comprobamos: $ sudo asterisk -vvvvvc voces en castellano: http://www.voipnovatos.es
  • 10. Asterisk (config) en /etc/asterisk/sip.conf [pb15] [spa941] context=demo1 context=demo1 type=friend type=friend secret=sekreto42 secret=otrapassw host=dynamic host=dynamic canreinvite=no canreinvite=no en /etc/asterisk/extensions.conf [demo1] exten => 101,1,Dial(SIP/pb15) exten => 102,1,Dial(SIP/spa941)
  • 14. DID y SIP URI
  • 15. Demo • Llamada entre dos números • Con el número público
  • 16. Ideas • Respuesta diferente por horas • Respuesta diferente en función del CallerID • Integración con Jabber • Voicemail • IVR, colas • 1000s de cosas mas ...
  • 17. El dialplan se complica [efmenu] include => users5xx include => rooms include => efhq exten => s,1,NoOp(Entering eF main menu for caller ${CALLERID}) exten => s,2,Answer exten => s,3,Wait(2) exten => s,4,Playback(beep) exten => s,5,Background(${SALUDOEN}enter-ext-of-person) exten => s,6,Background(beep) exten => s,7,WaitExten(15) exten => 101,1,Playback(room-service) exten => 101,2,Goto(efmenu,s,4) exten => 999,1,Goto(svetdisa,s,1) exten => 999,2,Goto(efmenu,s,4) exten => i,1,Playback(pbx-invalid) exten => i,2,Goto(efmenu,s,6) exten => t,1,Playback(vm-goodbye) exten => t,2,Hangup()
  • 18. ...y se hace feo exten => 508,1,Macro(voicemail,SIP/esti) exten => 509,1,Macro(voicemail,SIP/kolio) exten => 510,1,Macro(voicemail,SIP/jean) exten => 511,1,Macro(voicemail,SIP/ruben) exten => 512,1,Macro(voicemail,SIP/inaki) [macro-voicemail] exten => s,1,Dial(${ARG1},30) exten => s,2,Goto(s-${DIALSTATUS},1) exten => s-NOANSWER,1,Voicemail(u${MACRO_EXTEN}) exten => s-NOANSWER,n,Hangup() exten => s-CHANUNAVAIL,1,Playback(unavailable) exten => s-CHANUNAVAIL,n,Hangup() exten => s-CONGESTION,1,Busy(5) exten => s-CONGESTION,n,Hangup() exten => s-BUSY,1,Voicemail(b${MACRO_EXTEN}) exten => s-BUSY,n,Hangup() exten => _s-.,1,Goto(s-NOANSWER,1)
  • 19. AGI y AMI • Asterisk Gateway Interface • Asterisk Manager Interface
  • 20. Alternativas • Adhearsion • Telegraph
  • 21. Adhearsion http://adhearsion.com • El dialplan escrito en Ruby • ActiveRecord integrado • Integración con Rails • versiones (0.7.7 vs 0.8)
  • 22. Adhearsion 1: Hello World $ sudo gem install adhearsion $ ahn create hello1 Creating /Users/svet/hello1/config/adhearsion.sqlite3 Creating /Users/svet/hello1/config/adhearsion.yml Creating /Users/svet/hello1/config/database.rb Creating /Users/svet/hello1/config/database.yml Creating /Users/svet/hello1/config/helpers/drb_server.yml Creating /Users/svet/hello1/config/helpers/factorial.alien.c.yml Creating /Users/svet/hello1/config/helpers/growler.yml Creating /Users/svet/hello1/config/helpers/lookup.yml Creating /Users/svet/hello1/config/helpers/manager_proxy.yml Creating /Users/svet/hello1/config/helpers/micromenus/collab.rb ...
  • 23. Hello World en /etc/asterisk/extensions.conf [adhearsion] exten => 101,1,AGI(agi://127.0.0.1) $ cd hello1 en extensions.rb dhearsion { play 'hello-word' } $ ahn start .
  • 24.
  • 25. internal { case extension when 101...200 employee = User.find_by_extension extension if employee.busy? then voicemail extension else dial employee, :for => 10.rings voicemail unless last_call_successful? end when 888 play weather_report(quot;Dallas Texasquot;) when 999 then +joker_voicemail end }
  • 27. require 'amazon/search' r = Amazon::Search::Request.new( '10N1KX1NVQZ2VXXXXXXX') begin resp = r.keyword_search( '0596529260', 'books' ) resp.products.each do |p| unless p.availability =~ /not available/ printf( quot;%s (ASIN %s) -- %snquot;, p.product_name, p.asin, p.our_price ) end end rescue puts quot;No se encuentra.quot; end $ ruby price2 RESTful Web Services (ASIN 0596529260) -- $26.39
  • 28. Adhearsion II: Amazon adhearsion { require 'amazon/search' r = Amazon::Search::Request.new( '10N1KX1NVQZ2VXXXXXXX') begin resp = r.keyword_search( extension, 'books' ) resp.products.each do |p| unless p.availability =~ /not available/ play p.our_price end end rescue play quot;no-info-about-numberquot; end }
  • 29.
  • 30.
  • 31. voxbone { sleep 2.seconds play quot;hello-worldquot; isbn = input() require 'amazon/search' r = Amazon::Search::Request.new( '10N1KX1NVQZ2VXXXXXXX') begin resp = r.keyword_search( isbn, 'books' ) resp.products.each do |p| unless p.availability =~ /not available/ play p.our_price end end rescue play quot;no-info-about-numberquot; end }
  • 33. Telegraph y AGI exten => 105, 1, AGI(agi://127.0.0.1/my_route?param1=value) wants.voice do render_voice do |voice| voice.play “hello-world” voice.link_to_dtmf 'bank-lineitem-menu' do link 1, :action=>quot;newquot; link 2, :action=>quot;listquot; link 3, :action=>quot;indexquot; end end end
  • 34. Demo
  • 35.
  • 36.
  • 37. <h1>Consultas</h1> <ul> <li> <%= link_to quot;Faltasquot;, :action=>quot;faltasquot; %> </li> <li> <%= link_to quot;Notasquot;, :action=>quot;notasquot; %> </li> </ul> <h1>Consultar notas</h1> <% form_tag '/alumnos/show_notas' do %> DNI: <%= text_field_tag 'dni' %> <%= submit_tag 'Ver notas' %> <% end %> def show_notas @alumno = Alumno.find_by_dni(params[:dni]) @notas = @alumno.notas_ultima_evaluacion end <% @notas.each do |nota| %> <tr> <td class=quot;listquot;><%= nota.asignatura %></td> <td class=quot;listquot;><%= nota.nota %></td> </tr> <% end %>
  • 38. Telegraph $ script/plugin install svn://rubyforge.org/var/svn/telegraph/trunk en /etc/asterisk/extensions.conf: exten => 777,1, AGI(agi://192.168.1.1:4574/alumnos/index) en app/controllers/alumnos_controller.rb: def index respond_to do |wants| wants.html { render } wants.voice { render_voice { |voice| voice.play_sound quot;hello-worldquot; } } end end
  • 39. Telegraph: configuración $ vi config/telegraph.yaml development: agi_server: 127.0.0.1 agi_port: 4574 ami_server: druby://localhost:9000 outgoing_call_path: /var/spool/asterisk/outgoing wakeup_call_path: /var/spool/asterisk/wakeups sound_path: /var/lib/asterisk/sounds recording_path: /var/lib/asterisk/sounds $ script/agi_server
  • 40. respond_to def index respond_to do |wants| wants.html { render } wants.voice { render_voice } end end $ vi app/views/alumnos/index.voice voice.play_sound quot;hello-worldquot;
  • 41. index # index.rhtml <h1>Consultas</h1> <ul> <li> <%= link_to quot;Faltasquot;, :action=>quot;faltasquot; %> </li> <li> <%= link_to quot;Notasquot;, :action=>quot;notasquot; %> </li> </ul> # index.voice voice.play_sound 'thank-you-for-calling' voice.link_to_dtmf 'presione1-2' do link 1, :controller => quot;alumnosquot;, :action => quot;faltasquot; link 2, :action => quot;notasquot; end
  • 42. formulario # notas.rhtml <h1>Consultar notas</h1> <% form_tag '/alumnos/show_notas' do %> DNI: <%= text_field_tag 'dni' %> <%= submit_tag 'Ver notas' %> <% end %> # notas.voice voice.form :url=>{:controller => 'alumnos', :action=>'show_notas'} do |form| form.numeric_input 'dni', 'dni', :max_digits=>8 end
  • 43. resultados # show_notas rhtml <h3>Notas de <%= @alumno.nombre %></h3> <table class=quot;listquot;> <% @notas.each do |nota| %> <tr> <td class=quot;listquot;><%= nota.asignatura %></td> <td class=quot;listquot;><%= nota.nota %></td> </tr> <% end %> </table> # show.voice @notas.each do |nota| voice.play nota.asignatura.to_slug voice.play nota.nota end sleep 2.seconds voice.play quot;vm-goodbyequot;
  • 44.
  • 45. No hay que pasarse • Web vs Mobile web vs Voz • ej: 466453.com
  • 46. Telegraph con AMI $ script/generate ami_model AMIModel # environment.rb (user y password en manager.conf): Telegraph::AMIManager.establish_connection!( :host=> 'your.host.name.com', :username=>'user', :secret=>'password') $ script/ami_server # usar así: AMIModel.create(:call, :channel=>'SIP/101', :context=>'default', :exten => 'outgoing', :priority=>1)
  • 47. Links • http://asterisk.org/ • http://www.voipnovatos.es • http://www.voip-info.org • http://adhearsion.com • http://www.linuxjournal.com/article/9519 • http://telegraph.rubyforge.org • http://telegraph.rubyforge.org/wiki/wiki.pl?UsingAGI
  • 48. Q &A