SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
respond_to :voice
   The Convergence of Web and Voice
    Interfaces with Rails and Asterisk

                     or

An introduction to Telegraph - Voice done
                  MVC


               Jonathan Palley
           Co-Founder, Idapted Inc.
            jpalley@idapted.com
VoIP Development Is NOT
about cheaper phone calls




Already done and telcos can do cheaper...
It’s about the
 applications.
Voice is Another Interface for Your
            Application
The Plan

• Voice as the next Killer Interface
• The Voice/Web Analogy
• Asterisk in 5 minutes
• Telegraph - Bridging Voice and Rails
Why add voice? Why
      now?
   Only Recently Available

     Ripe for Innovation

         Ubiquitous
Lowered Barriers to Voice App
       Development


• DB Driven applications (Rails/etc.)
• Phone system (VoIP/OSS PBX)
Space To Innovate

• Existing Voice Design Thinking =   Phone
  Prompt Hell
• Few applications merge voice and web.
  Most users do.
• Underlying OSS Servers/Technology
  Available
Ubiquity
• 2.7 Billion mobile phones. 1.4 Billion fixed-
  lines.
• 1/3 of “Internet Users” access the internet
  from their mobile phone.
• Each of those 4.1 billion users can be
  uniquely identified by a standardized
  numerical system

                Source: http://communities-dominate.blogs.com/brands/2007/02/mobile_the_7th_.html
The Voice/Web Analogy: Technology
Technology           Web                   VoIP
                                       SIP - Ind. Standard
                      HTTP
                                      IAX - Asterisk only
                       FTP
   Protocol                            H.323 - Obsolete
                       RTP
                                          Jingle - Gtalk
                       etc
                                      Skype - Proprietary

                                     g.711 - high bandwidth
                       gzip
                                    gsm - medium bandwidth
    Codec           jpg/gif/etc.
                                     g.729 - low bandwidth
                   wmv/rm/etc
                                      iLBC - low bandwidth

    Server        apache/lighttpd           asterisk

                                             AGI
  Interactivity        CGI
                                             AMI
Asterisk: The 5min
         Tutorial
• OSS Multipurpose PBX
• Very powerful/flexible
• Relatively Stable
• Very messy to deal with
Asterisk: Key Concepts
Concept                       Explanation
 Channel     A “Channel” in Asterisk is what can setup/receive calls

              Determines what to do with call. Given a call and a
               dialed number, what sounds should be played, input
 Dialplan
            received or connections made? Written in a “BASIC like
                                   language.

                 Stdin/out or TCP method that allows external
   AGI
                   applications to dynamically write dialplans

            Method to send commands to Asterisk (independent of
  AMI
                     calls) and listen for stateful events
Voice System Setup
                                  SIP/IAX
                     VoIP
                    Clients


                                                                      Rails/
              Origination/        SIP/IAX                 AGI/AMI
                                               Asterisk
 PSTN
                                                                    Telegraph
              Termination
                                                Server
Network
                                                                     Server
                Server


                     Analog
     PSTN                       Zaptel/Other
                    Interface
    Phones/
                      Cards
    Network
Existing Ruby/Asterisk
         Integration Tools

                             Just for AGI.
  RAGI               Not well integrated into rails
                              Not active.
                                AMI.
  RAMI                   No Rails Integration.
                            Not Active.

                           Active. Real Apps?
                    Good for writing pure voice apps
Adhearsion   Not tied to Rails or concept of shared voice/web
                                 interfaces.
Introducing Telegraph
• Extracted from Real Application (Idapted’s
  distributed voice system for oral language
  training - EnglishQuad) with input of
  others.
• Started with RAGI/RAMI
• Tightly Integrated with Rails/Web
  Interfaces.
• Embraces the Voice/Web analogy.
Telegraph 1: Making Interfaces (AGI)

•   Setup Dialplan

       exten => 1, 1, AGI(agi://localhost/my_route?param1=value)

•   Add respond_to and voice DSL.

       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 I: Adding Voice Interface to Standard Scaffolding
                    Application.

   Look at account controller in demo app. Description/docs at
                     telegraph.rubyforge.org
Sessions can be shared between
voice and web. Making it easy to link
       voice and web actions
Demo II: Phone Number Confirmation

Look at verify_number controller in demo app. Description/docs at
                    telegraph.rubyforge.org
Telegraph II: Manipulating the System (AMI)
               (follows CRUD)

                             Calls
  Create                   Recordings


                    Call/Channel/Queue Status
   Read                     Variables
                             Mailbox

                            Context
  Update                   Recording
                            Variable


                          Call (Hangup)
  Delete                   Recording
Telegraph II: Deal with system info

•   Create a model-like class:

        class VoiceConnection  Telegraph::AsteriskManager

        end

•   Use CRUD technique’s to get Asterisk parameters, place calls, etc. Examples:

        VoiceConnection.create(:call, :channel=”SIP/
        dave”, :context=”some_context”, :exten=3)

        VoiceConnection.destroy(:call, :channel=my_channel)

        VoiceConnection.find(:sip_peer, :peer=”SIP/joe”)

        VoiceConnection.update
        (:monitor, :channel=my_channel, :file=new_file)
Demo III: Placing a call and getting channel status

 Look at dialer controller in demo app. Description/docs at
                   telegraph.rubyforge.org
Telegraph III: Dealing
     with stateful events
•   Add a special AMILogic class to your project

•   Add methods to deal with events, use params to access info
    sent by asterisk.

•   For example
      class AmiLogic  Telegraph::AMIHandler
      	

 def link
      	

   puts quot;Linked #{params[:channel1]} to #{params[:channel2]}quot;
            end
      end
Look at documentation on AMI Events at telegraph.rubyforge.org
                        for Examples
Easy Deployment/Scaling

• AGI and AMI Events handled by
  independent rails processes that can be
  load balanced.

• AMI runs through distributed Ruby
  process.

• Deployment/daemonization very easy. Like
  mongrel, works with Capistrano
Questions/Discussion
                    telegraph.rubyforge.org
                         talkingruby.org


Thanks To Rabble and John Shulty for their contributions to the source.


                            Contact Me:
                             Jonathan Palley
                         jpalley@idapted.com
                  skype: jpalley, gizmo: jonathanpalley
                    idapted.com || englishquad.com
Appendix: The Voice/Web
               Analogy: Interfaces
    Concept                   Web                  Voice

Interacting with system     Web Browser        IVR Like Systems



                                             DB + Voice Connection
  Get/set info system      Database/Models
                                                  Parameters

                                             Handling connections/
Handling Stateful Events          -            disconnections/
                                                 registrations

Más contenido relacionado

La actualidad más candente

Voice over IP (VoIP)
Voice over IP (VoIP)Voice over IP (VoIP)
Voice over IP (VoIP)
Peter R. Egli
 
Introduction to IP Telephony
Introduction to IP TelephonyIntroduction to IP Telephony
Introduction to IP Telephony
Videoguy
 
Retail Phybridge PoLRE and CLEER
Retail Phybridge PoLRE and CLEERRetail Phybridge PoLRE and CLEER
Retail Phybridge PoLRE and CLEER
Julian Kennedy
 
VoIP Techniques and Challenges PRESENTATION
VoIP Techniques and Challenges PRESENTATIONVoIP Techniques and Challenges PRESENTATION
VoIP Techniques and Challenges PRESENTATION
Karama Said(BEng,MSc)
 
Pbx Presentation V021
Pbx Presentation V021Pbx Presentation V021
Pbx Presentation V021
nicklacey
 
Jain Sip Tutorial
Jain Sip TutorialJain Sip Tutorial
Jain Sip Tutorial
rajibdk
 

La actualidad más candente (20)

Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
 
Voice over IP By SAIKIRAN PANJALA
Voice over IP By SAIKIRAN PANJALAVoice over IP By SAIKIRAN PANJALA
Voice over IP By SAIKIRAN PANJALA
 
Introduction to VoIP, RTP and SIP
Introduction to VoIP, RTP and SIP Introduction to VoIP, RTP and SIP
Introduction to VoIP, RTP and SIP
 
Voice over IP (VoIP)
Voice over IP (VoIP)Voice over IP (VoIP)
Voice over IP (VoIP)
 
voip gateway
 voip gateway voip gateway
voip gateway
 
Quality of Experience
Quality of ExperienceQuality of Experience
Quality of Experience
 
Module9
Module9Module9
Module9
 
Review on portable voice communication system in raspberry pi
Review on portable voice communication system in raspberry piReview on portable voice communication system in raspberry pi
Review on portable voice communication system in raspberry pi
 
Microsoft Lync & Acme Packet Session Management Solutions
Microsoft Lync & Acme Packet Session Management SolutionsMicrosoft Lync & Acme Packet Session Management Solutions
Microsoft Lync & Acme Packet Session Management Solutions
 
Distributed IP-PBX
Distributed IP-PBX Distributed IP-PBX
Distributed IP-PBX
 
Introduction to IP Telephony
Introduction to IP TelephonyIntroduction to IP Telephony
Introduction to IP Telephony
 
IPv6 and How It Impacts Communication Applications
IPv6 and How It Impacts Communication ApplicationsIPv6 and How It Impacts Communication Applications
IPv6 and How It Impacts Communication Applications
 
VoIP
VoIPVoIP
VoIP
 
Retail Phybridge PoLRE and CLEER
Retail Phybridge PoLRE and CLEERRetail Phybridge PoLRE and CLEER
Retail Phybridge PoLRE and CLEER
 
VoIP Techniques and Challenges PRESENTATION
VoIP Techniques and Challenges PRESENTATIONVoIP Techniques and Challenges PRESENTATION
VoIP Techniques and Challenges PRESENTATION
 
Network Readiness[1]
Network Readiness[1]Network Readiness[1]
Network Readiness[1]
 
Pbx Presentation V021
Pbx Presentation V021Pbx Presentation V021
Pbx Presentation V021
 
Vo ip sip
Vo ip sipVo ip sip
Vo ip sip
 
MAF ICIMS™ Monitoring, Analytics & Reporting for Microsoft Teams and UC - glo...
MAF ICIMS™ Monitoring, Analytics & Reporting for Microsoft Teams and UC - glo...MAF ICIMS™ Monitoring, Analytics & Reporting for Microsoft Teams and UC - glo...
MAF ICIMS™ Monitoring, Analytics & Reporting for Microsoft Teams and UC - glo...
 
Jain Sip Tutorial
Jain Sip TutorialJain Sip Tutorial
Jain Sip Tutorial
 

Similar a respond_to :voice - the convergence of voice and web interfaces with Rails and Asterisk

JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st Century
Gnu Alsonative
 
JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st Century
Gnu Alsonative
 
Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011
grandyho
 
VoIP - seminar at IASRI, New Delhi
VoIP - seminar at IASRI, New DelhiVoIP - seminar at IASRI, New Delhi
VoIP - seminar at IASRI, New Delhi
Nishikant Taksande
 
Seaside Status Message
Seaside Status MessageSeaside Status Message
Seaside Status Message
Lukas Renggli
 
From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011
telestax
 
Are ott the new walled gardens
Are ott the new walled gardensAre ott the new walled gardens
Are ott the new walled gardens
Amir Zmora
 
Twilio Voice Applications with Amazon AWS S3 and EC2
Twilio Voice Applications with Amazon AWS S3 and EC2Twilio Voice Applications with Amazon AWS S3 and EC2
Twilio Voice Applications with Amazon AWS S3 and EC2
Twilio Inc
 
Cisco Presentation 1
Cisco Presentation 1Cisco Presentation 1
Cisco Presentation 1
changcai
 
Asterisk - Glen Bastes
Asterisk - Glen BastesAsterisk - Glen Bastes
Asterisk - Glen Bastes
soss
 

Similar a respond_to :voice - the convergence of voice and web interfaces with Rails and Asterisk (20)

Ruby voip
Ruby voipRuby voip
Ruby voip
 
Adhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework PresentationAdhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework Presentation
 
JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st Century
 
JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st Century
 
Voip
VoipVoip
Voip
 
Asterisk-Java Framework Presentation
Asterisk-Java Framework PresentationAsterisk-Java Framework Presentation
Asterisk-Java Framework Presentation
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installations
 
Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011
 
VoIP - seminar at IASRI, New Delhi
VoIP - seminar at IASRI, New DelhiVoIP - seminar at IASRI, New Delhi
VoIP - seminar at IASRI, New Delhi
 
Seaside Status Message
Seaside Status MessageSeaside Status Message
Seaside Status Message
 
Seaside News
Seaside NewsSeaside News
Seaside News
 
01 introduction
01 introduction01 introduction
01 introduction
 
VoIP Radio Gateway : Case Study
VoIP Radio Gateway : Case StudyVoIP Radio Gateway : Case Study
VoIP Radio Gateway : Case Study
 
voip_en
voip_envoip_en
voip_en
 
From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011
 
Are ott the new walled gardens
Are ott the new walled gardensAre ott the new walled gardens
Are ott the new walled gardens
 
Twilio Voice Applications with Amazon AWS S3 and EC2
Twilio Voice Applications with Amazon AWS S3 and EC2Twilio Voice Applications with Amazon AWS S3 and EC2
Twilio Voice Applications with Amazon AWS S3 and EC2
 
Multimedia Broadcasting Platform
Multimedia Broadcasting PlatformMultimedia Broadcasting Platform
Multimedia Broadcasting Platform
 
Cisco Presentation 1
Cisco Presentation 1Cisco Presentation 1
Cisco Presentation 1
 
Asterisk - Glen Bastes
Asterisk - Glen BastesAsterisk - Glen Bastes
Asterisk - Glen Bastes
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

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...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

respond_to :voice - the convergence of voice and web interfaces with Rails and Asterisk

  • 1. respond_to :voice The Convergence of Web and Voice Interfaces with Rails and Asterisk or An introduction to Telegraph - Voice done MVC Jonathan Palley Co-Founder, Idapted Inc. jpalley@idapted.com
  • 2. VoIP Development Is NOT about cheaper phone calls Already done and telcos can do cheaper...
  • 3. It’s about the applications.
  • 4. Voice is Another Interface for Your Application
  • 5. The Plan • Voice as the next Killer Interface • The Voice/Web Analogy • Asterisk in 5 minutes • Telegraph - Bridging Voice and Rails
  • 6. Why add voice? Why now? Only Recently Available Ripe for Innovation Ubiquitous
  • 7. Lowered Barriers to Voice App Development • DB Driven applications (Rails/etc.) • Phone system (VoIP/OSS PBX)
  • 8. Space To Innovate • Existing Voice Design Thinking = Phone Prompt Hell • Few applications merge voice and web. Most users do. • Underlying OSS Servers/Technology Available
  • 9. Ubiquity • 2.7 Billion mobile phones. 1.4 Billion fixed- lines. • 1/3 of “Internet Users” access the internet from their mobile phone. • Each of those 4.1 billion users can be uniquely identified by a standardized numerical system Source: http://communities-dominate.blogs.com/brands/2007/02/mobile_the_7th_.html
  • 10. The Voice/Web Analogy: Technology Technology Web VoIP SIP - Ind. Standard HTTP IAX - Asterisk only FTP Protocol H.323 - Obsolete RTP Jingle - Gtalk etc Skype - Proprietary g.711 - high bandwidth gzip gsm - medium bandwidth Codec jpg/gif/etc. g.729 - low bandwidth wmv/rm/etc iLBC - low bandwidth Server apache/lighttpd asterisk AGI Interactivity CGI AMI
  • 11. Asterisk: The 5min Tutorial • OSS Multipurpose PBX • Very powerful/flexible • Relatively Stable • Very messy to deal with
  • 12. Asterisk: Key Concepts Concept Explanation Channel A “Channel” in Asterisk is what can setup/receive calls Determines what to do with call. Given a call and a dialed number, what sounds should be played, input Dialplan received or connections made? Written in a “BASIC like language. Stdin/out or TCP method that allows external AGI applications to dynamically write dialplans Method to send commands to Asterisk (independent of AMI calls) and listen for stateful events
  • 13. Voice System Setup SIP/IAX VoIP Clients Rails/ Origination/ SIP/IAX AGI/AMI Asterisk PSTN Telegraph Termination Server Network Server Server Analog PSTN Zaptel/Other Interface Phones/ Cards Network
  • 14. Existing Ruby/Asterisk Integration Tools Just for AGI. RAGI Not well integrated into rails Not active. AMI. RAMI No Rails Integration. Not Active. Active. Real Apps? Good for writing pure voice apps Adhearsion Not tied to Rails or concept of shared voice/web interfaces.
  • 15. Introducing Telegraph • Extracted from Real Application (Idapted’s distributed voice system for oral language training - EnglishQuad) with input of others. • Started with RAGI/RAMI • Tightly Integrated with Rails/Web Interfaces. • Embraces the Voice/Web analogy.
  • 16. Telegraph 1: Making Interfaces (AGI) • Setup Dialplan exten => 1, 1, AGI(agi://localhost/my_route?param1=value) • Add respond_to and voice DSL. 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
  • 17. Demo I: Adding Voice Interface to Standard Scaffolding Application. Look at account controller in demo app. Description/docs at telegraph.rubyforge.org
  • 18. Sessions can be shared between voice and web. Making it easy to link voice and web actions
  • 19. Demo II: Phone Number Confirmation Look at verify_number controller in demo app. Description/docs at telegraph.rubyforge.org
  • 20. Telegraph II: Manipulating the System (AMI) (follows CRUD) Calls Create Recordings Call/Channel/Queue Status Read Variables Mailbox Context Update Recording Variable Call (Hangup) Delete Recording
  • 21. Telegraph II: Deal with system info • Create a model-like class: class VoiceConnection Telegraph::AsteriskManager end • Use CRUD technique’s to get Asterisk parameters, place calls, etc. Examples: VoiceConnection.create(:call, :channel=”SIP/ dave”, :context=”some_context”, :exten=3) VoiceConnection.destroy(:call, :channel=my_channel) VoiceConnection.find(:sip_peer, :peer=”SIP/joe”) VoiceConnection.update (:monitor, :channel=my_channel, :file=new_file)
  • 22. Demo III: Placing a call and getting channel status Look at dialer controller in demo app. Description/docs at telegraph.rubyforge.org
  • 23. Telegraph III: Dealing with stateful events • Add a special AMILogic class to your project • Add methods to deal with events, use params to access info sent by asterisk. • For example class AmiLogic Telegraph::AMIHandler def link puts quot;Linked #{params[:channel1]} to #{params[:channel2]}quot; end end
  • 24. Look at documentation on AMI Events at telegraph.rubyforge.org for Examples
  • 25. Easy Deployment/Scaling • AGI and AMI Events handled by independent rails processes that can be load balanced. • AMI runs through distributed Ruby process. • Deployment/daemonization very easy. Like mongrel, works with Capistrano
  • 26. Questions/Discussion telegraph.rubyforge.org talkingruby.org Thanks To Rabble and John Shulty for their contributions to the source. Contact Me: Jonathan Palley jpalley@idapted.com skype: jpalley, gizmo: jonathanpalley idapted.com || englishquad.com
  • 27. Appendix: The Voice/Web Analogy: Interfaces Concept Web Voice Interacting with system Web Browser IVR Like Systems DB + Voice Connection Get/set info system Database/Models Parameters Handling connections/ Handling Stateful Events - disconnections/ registrations