SlideShare a Scribd company logo
TESTING
                     ADHEARSION
                     APPLICATIONS
                               Luca	
  Pradovera
                      Voice	
  Applica1on	
  Developer
                               Mojo	
  Lingo	
  LLC




venerdì 1 marzo 13
About me
                        - Rubyist from Italy
                        - Voice Application
                          Developer at Mojo
                          Lingo




venerdì 1 marzo 13
ADHEARSION
       DICTATION CARRIER
       APPLICATIONS CALL   APPS
       CENTERS      CRM
       CUSTOMER SUPPORT
                            ARE
       TRANSLATION          FUN
                       DISTRIBUTED
       C O M M U N I C A T I O N S
       S C H E D U L I N G AND
       CONVERGENCE
                         USEFUL
venerdì 1 marzo 13
BUT...



venerdì 1 marzo 13
THEY
                     MUST BE
                     STABLE!


venerdì 1 marzo 13
THE VILLAINS

                     -   Application exceptions
                     -   Wrong call flow
                     -   Dropped calls
                     -   Integration errors




venerdì 1 marzo 13
THE GOOD GUYS

                     - Unit Testing
                     - Functional Testing
                     - Load Testing



venerdì 1 marzo 13
UNIT TESTING



venerdì 1 marzo 13
Our goals for unit
                             testing:
                     -   Confidence at the class level
                     -   Prevent regression errors
                     -   Promote proper code structure
                     -   Provide CI with something to help us with




venerdì 1 marzo 13
Unit testing Ahn apps

                     -   Call Controllers are an application’s core
                     -   RSpec recommended
                     -   Mock at the controller level
                     -   Support classes are just Ruby!




venerdì 1 marzo 13
Adding RSpec
                                  - Generated apps are
                     Gemfile:        RSpec ready
                 group :test do
                   gem 'rspec'
                                  - Your choice of mocking
                 end
                                    framework
                                  - Just bundle install



venerdì 1 marzo 13
Spec File
           require 'spec_helper'

           describe DemoController do
             let(:mock_call) { mock 'Call' }

               subject do
                 DemoController.new mock_call
               end

             let(:dtmf) { "1" }
             it "should answer, ask for a result, and say it" do
               subject.should_receive(:answer).once
               subject.should_receive(:ask).with("What is your favorite number?", :timeout =>
           10000, :limit => 1).once.and_return(dtmf)
               subject.should_receive(:say).with("Your favorite number seems to be #{dtmf}")
               subject.run
             end
           end




venerdì 1 marzo 13
Our controller

     class DemoController < Adhearsion::CallController
       def run
         answer
         result = ask "What is your favorite number?", :timeout =>
     10000, :limit => 1
         say "Your favorite number seems to be #{result}"
       end
     end




venerdì 1 marzo 13
Passing? COOL!




venerdì 1 marzo 13
FUNCTIONAL
                       TESTING


venerdì 1 marzo 13
Functional Testing
                             101

                     - Needs defining
                     - Quite difficult to approach
                     - Not solved by any single tool



venerdì 1 marzo 13
OK, WE ARE IN BAD
                          SHAPE...


venerdì 1 marzo 13
...but here comes
                         some help!
                     SIPp

                        ahn-loadbot

                                  PJSUA

venerdì 1 marzo 13
SIPp...




                     ... is about as user friendly as the above lion.

venerdì 1 marzo 13
SIPp (seriously)
                     - http://sipp.sourceforge.net/
                     - Free and OSS Test tool and traffic
                       generator
                     - Can run XML scenarios defined by the user
                     - Can play audio and interact
                     - Requires good knowledge of SIP

venerdì 1 marzo 13
SIPp sample run
                      sudo sipp -sn uac -s 1 -l 10 -r 5 -m 100 127.0.0.1


                     - Built-in scenario
                     - Audio is PCAP, raw network capture of an
                       RTP session
                     - In custom scenarios, PCAP files are built
                       with Wireshark/tcpdump
                     - Ability to set call rate, concurrent calls,
                       maximum number of calls, many other
                       options
venerdì 1 marzo 13
SIPp options

                     -   -trace_err gives you an error log
                     -   -trace_stat outputs a CSV report
                     -   -rtp_echo echoes RTP back to the source
                     -   An XML scenario file can play PCAP, pause,
                         and perform general call control



venerdì 1 marzo 13
AHN-LOADBOT



venerdì 1 marzo 13
Friendly
                Neighborhood Robot




venerdì 1 marzo 13
The LoadBot
                     -   https://github.com/mojolingo/ahn-loadbot
                     -   Adhearsion 1 plugin
                     -   Drives calls though an Asterisk server
                     -   Can simulate a call, listen for audio, and
                         record results
                     - Metrics that can be used: duration of calls,
                         ASR for presence of audio


venerdì 1 marzo 13
Loadbot scenario
                                config:
                                  agi_server: 127.0.0.1
                                  prefix: SIP/mycarrier

                                plans:
                                  plan 1:
                                    number: 1231231234
                                    answers:
                                    - 1




                     - Can be driven through DRb or directly
                       through the Ahn1 API


venerdì 1 marzo 13
PJSUA



venerdì 1 marzo 13
Someone has to
                       answer too!




venerdì 1 marzo 13
PJSUA at a glance
                     - Can make single or multiple connection to
                         SIP server
                     -   Can auto-answer, play audio, and record
                     -   Suitable for test support
                     -   Also is a handy tool for QoS
                     -   Does not run a “true” scenario


venerdì 1 marzo 13
Sample PJSUA
                     command line
                     pjsua --config-file options.conf

                     options.conf:
                     --null-audio
                     --realm adhearsion.com
                     --registrar sip.adhearsion.com
                     --id sip:999@adhearsion.com
                     --username 999
                     --password AdhearsionConf
                     --nameserver 8.8.8.8
                     --auto-answer 200
                     --auto-loop
                     --play-file monkeys.wav




venerdì 1 marzo 13
Functional
                               takeaways

                     - Set a specific goal for each scenario
                     - Take advantage of CDR and APIs to do
                       integration testing
                     - Less automated than web functional testing



venerdì 1 marzo 13
LOAD TESTING



venerdì 1 marzo 13
Is my system strong
                          enough?




venerdì 1 marzo 13
Load Testing is...

                     - Running a high amount of concurrent calls
                     - Decide what you are looking for
                     - Tool of choice, SIPp or Loadbot



venerdì 1 marzo 13
Load testing metrics

                     - Failed calls
                     - Average call times getting too long
                     - Exception tracking, not everything happens
                       visibly




venerdì 1 marzo 13
Thank you!
                               http://mojolingo.com
                            https://github.com/polysics
                                Twitter: lucaprado
                     XMPP and Email: lpradovera@mojolingo.com

                                ...and please...
                                   NO MAKE KITTY SAD

                                       ...go rate my talk at
                                     http:/spkr8.com/17421

venerdì 1 marzo 13

More Related Content

PDF
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11
PPT
La caída del imperio colonial y la crisis del 98
PPTX
Historia crisis colonial
ODP
Desastre del 98
PPTX
El desastre de 1898
PPTX
Crisis Colonial
PPT
La independencia de las colonias españolas en américa
PPS
Edad Contemporanea
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11
La caída del imperio colonial y la crisis del 98
Historia crisis colonial
Desastre del 98
El desastre de 1898
Crisis Colonial
La independencia de las colonias españolas en américa
Edad Contemporanea

Similar to Testing Adhearsion Applications (20)

KEY
Testing Adhearsion Applications
PDF
Integrating Voice Through Adhearsion
PDF
Hey man, can I get a clue?
PDF
respond_to :voice - the convergence of voice and web interfaces with Rails an...
PDF
PDF
Talking To Rails
KEY
Fun with Linux Telephony
PDF
Open Source Telephony Disruptive Solutions
PPTX
Asterisk Deployments
PDF
Voicecon - Mashups with Tropo.com
PPTX
SIPfoundry CoLab 2013 - Web Contact Center
PDF
Make ruby talk to your users - literally
PDF
openUC & sipXecs Architecture
PDF
A Hackaton Focused on Call Control
PPT
Si pp introduction_2
PPT
SIPfoundry CoLab 2013 - sipXecs Cloud Architecture (UCCS)
KEY
Jay Phillips's Presentation at Emerging Communication Conference & Awards 200...
PDF
Watch out - The Norwegian Version
PDF
Asterisk-Java Framework Presentation
PDF
"Reinventing the Dialplan" slides from Twilio's Astricon 2009 talk
Testing Adhearsion Applications
Integrating Voice Through Adhearsion
Hey man, can I get a clue?
respond_to :voice - the convergence of voice and web interfaces with Rails an...
Talking To Rails
Fun with Linux Telephony
Open Source Telephony Disruptive Solutions
Asterisk Deployments
Voicecon - Mashups with Tropo.com
SIPfoundry CoLab 2013 - Web Contact Center
Make ruby talk to your users - literally
openUC & sipXecs Architecture
A Hackaton Focused on Call Control
Si pp introduction_2
SIPfoundry CoLab 2013 - sipXecs Cloud Architecture (UCCS)
Jay Phillips's Presentation at Emerging Communication Conference & Awards 200...
Watch out - The Norwegian Version
Asterisk-Java Framework Presentation
"Reinventing the Dialplan" slides from Twilio's Astricon 2009 talk
Ad

More from Mojo Lingo (20)

PDF
ConnectJS 2015: Video Killed the Telephone Star
PDF
AstriCon 2015: WebRTC: How it Works, and How it Breaks
PDF
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In Sight
PDF
Now Hear This! Putting Voice, Video, and Text into Ruby on Rails
PDF
Using Asterisk to Create "Her"
PDF
Tipping the Scales: Measuring and Scaling Asterisk
PDF
WebRTC Overview by Dan Burnett
PDF
AdhearsionConf 2013 Keynote
PDF
Speech-Enabling Web Apps
PDF
WebRTC: What? How? Why? - ClueCon 2013
PDF
Infiltrando Telecoms Usando Ruby
PDF
Enhancing FreePBX with Adhearsion
PDF
Connecting Adhearsion
PDF
Testing Telephony: It's Not All Terrible
PDF
Rayo for XMPP Folks
PDF
Building Real Life Applications with Adhearsion
PDF
Keeping It Realtime!
PDF
Infiltrating Telecoms Using Ruby
PDF
Telephony Through Ruby Colored Lenses
PDF
Voice Applications for the Modern Open Source Hacker
ConnectJS 2015: Video Killed the Telephone Star
AstriCon 2015: WebRTC: How it Works, and How it Breaks
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In Sight
Now Hear This! Putting Voice, Video, and Text into Ruby on Rails
Using Asterisk to Create "Her"
Tipping the Scales: Measuring and Scaling Asterisk
WebRTC Overview by Dan Burnett
AdhearsionConf 2013 Keynote
Speech-Enabling Web Apps
WebRTC: What? How? Why? - ClueCon 2013
Infiltrando Telecoms Usando Ruby
Enhancing FreePBX with Adhearsion
Connecting Adhearsion
Testing Telephony: It's Not All Terrible
Rayo for XMPP Folks
Building Real Life Applications with Adhearsion
Keeping It Realtime!
Infiltrating Telecoms Using Ruby
Telephony Through Ruby Colored Lenses
Voice Applications for the Modern Open Source Hacker
Ad

Recently uploaded (20)

PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Mushroom cultivation and it's methods.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Approach and Philosophy of On baking technology
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
project resource management chapter-09.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
A Presentation on Touch Screen Technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
August Patch Tuesday
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
Enhancing emotion recognition model for a student engagement use case through...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Mushroom cultivation and it's methods.pdf
Hybrid model detection and classification of lung cancer
Web App vs Mobile App What Should You Build First.pdf
Approach and Philosophy of On baking technology
WOOl fibre morphology and structure.pdf for textiles
project resource management chapter-09.pdf
Chapter 5: Probability Theory and Statistics
A Presentation on Touch Screen Technology
Programs and apps: productivity, graphics, security and other tools
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Unlocking AI with Model Context Protocol (MCP)
A comparative analysis of optical character recognition models for extracting...
August Patch Tuesday
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
OMC Textile Division Presentation 2021.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf

Testing Adhearsion Applications

  • 1. TESTING ADHEARSION APPLICATIONS Luca  Pradovera Voice  Applica1on  Developer Mojo  Lingo  LLC venerdì 1 marzo 13
  • 2. About me - Rubyist from Italy - Voice Application Developer at Mojo Lingo venerdì 1 marzo 13
  • 3. ADHEARSION DICTATION CARRIER APPLICATIONS CALL APPS CENTERS CRM CUSTOMER SUPPORT ARE TRANSLATION FUN DISTRIBUTED C O M M U N I C A T I O N S S C H E D U L I N G AND CONVERGENCE USEFUL venerdì 1 marzo 13
  • 5. THEY MUST BE STABLE! venerdì 1 marzo 13
  • 6. THE VILLAINS - Application exceptions - Wrong call flow - Dropped calls - Integration errors venerdì 1 marzo 13
  • 7. THE GOOD GUYS - Unit Testing - Functional Testing - Load Testing venerdì 1 marzo 13
  • 9. Our goals for unit testing: - Confidence at the class level - Prevent regression errors - Promote proper code structure - Provide CI with something to help us with venerdì 1 marzo 13
  • 10. Unit testing Ahn apps - Call Controllers are an application’s core - RSpec recommended - Mock at the controller level - Support classes are just Ruby! venerdì 1 marzo 13
  • 11. Adding RSpec - Generated apps are Gemfile: RSpec ready group :test do gem 'rspec' - Your choice of mocking end framework - Just bundle install venerdì 1 marzo 13
  • 12. Spec File require 'spec_helper' describe DemoController do let(:mock_call) { mock 'Call' } subject do DemoController.new mock_call end let(:dtmf) { "1" } it "should answer, ask for a result, and say it" do subject.should_receive(:answer).once subject.should_receive(:ask).with("What is your favorite number?", :timeout => 10000, :limit => 1).once.and_return(dtmf) subject.should_receive(:say).with("Your favorite number seems to be #{dtmf}") subject.run end end venerdì 1 marzo 13
  • 13. Our controller class DemoController < Adhearsion::CallController def run answer result = ask "What is your favorite number?", :timeout => 10000, :limit => 1 say "Your favorite number seems to be #{result}" end end venerdì 1 marzo 13
  • 15. FUNCTIONAL TESTING venerdì 1 marzo 13
  • 16. Functional Testing 101 - Needs defining - Quite difficult to approach - Not solved by any single tool venerdì 1 marzo 13
  • 17. OK, WE ARE IN BAD SHAPE... venerdì 1 marzo 13
  • 18. ...but here comes some help! SIPp ahn-loadbot PJSUA venerdì 1 marzo 13
  • 19. SIPp... ... is about as user friendly as the above lion. venerdì 1 marzo 13
  • 20. SIPp (seriously) - http://sipp.sourceforge.net/ - Free and OSS Test tool and traffic generator - Can run XML scenarios defined by the user - Can play audio and interact - Requires good knowledge of SIP venerdì 1 marzo 13
  • 21. SIPp sample run sudo sipp -sn uac -s 1 -l 10 -r 5 -m 100 127.0.0.1 - Built-in scenario - Audio is PCAP, raw network capture of an RTP session - In custom scenarios, PCAP files are built with Wireshark/tcpdump - Ability to set call rate, concurrent calls, maximum number of calls, many other options venerdì 1 marzo 13
  • 22. SIPp options - -trace_err gives you an error log - -trace_stat outputs a CSV report - -rtp_echo echoes RTP back to the source - An XML scenario file can play PCAP, pause, and perform general call control venerdì 1 marzo 13
  • 24. Friendly Neighborhood Robot venerdì 1 marzo 13
  • 25. The LoadBot - https://github.com/mojolingo/ahn-loadbot - Adhearsion 1 plugin - Drives calls though an Asterisk server - Can simulate a call, listen for audio, and record results - Metrics that can be used: duration of calls, ASR for presence of audio venerdì 1 marzo 13
  • 26. Loadbot scenario config: agi_server: 127.0.0.1 prefix: SIP/mycarrier plans: plan 1: number: 1231231234 answers: - 1 - Can be driven through DRb or directly through the Ahn1 API venerdì 1 marzo 13
  • 28. Someone has to answer too! venerdì 1 marzo 13
  • 29. PJSUA at a glance - Can make single or multiple connection to SIP server - Can auto-answer, play audio, and record - Suitable for test support - Also is a handy tool for QoS - Does not run a “true” scenario venerdì 1 marzo 13
  • 30. Sample PJSUA command line pjsua --config-file options.conf options.conf: --null-audio --realm adhearsion.com --registrar sip.adhearsion.com --id sip:999@adhearsion.com --username 999 --password AdhearsionConf --nameserver 8.8.8.8 --auto-answer 200 --auto-loop --play-file monkeys.wav venerdì 1 marzo 13
  • 31. Functional takeaways - Set a specific goal for each scenario - Take advantage of CDR and APIs to do integration testing - Less automated than web functional testing venerdì 1 marzo 13
  • 33. Is my system strong enough? venerdì 1 marzo 13
  • 34. Load Testing is... - Running a high amount of concurrent calls - Decide what you are looking for - Tool of choice, SIPp or Loadbot venerdì 1 marzo 13
  • 35. Load testing metrics - Failed calls - Average call times getting too long - Exception tracking, not everything happens visibly venerdì 1 marzo 13
  • 36. Thank you! http://mojolingo.com https://github.com/polysics Twitter: lucaprado XMPP and Email: lpradovera@mojolingo.com ...and please... NO MAKE KITTY SAD ...go rate my talk at http:/spkr8.com/17421 venerdì 1 marzo 13