Top Banner
Integrating Voice through Adhearsion Luca Pradovera Telephony Devroom FOSDEM 2013 Brussels, February 3rd, 2013 venerdì 1 marzo 13
27

Integrating Voice Through Adhearsion

Dec 18, 2014

Download

Technology

Mojo Lingo

Integrating Voice Through Adhearsion presented by Luca Pradovera at FOSDEM 2013
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Integrating Voice Through Adhearsion

Integrating Voice through Adhearsion

Luca PradoveraTelephony Devroom

FOSDEM 2013Brussels, February 3rd, 2013

venerdì 1 marzo 13

Page 2: Integrating Voice Through Adhearsion

Who am I?

• Italian computer engineer

•No, I didn’t vote for Berlusconi

• Voice application developer at Mojo Lingo LLC, Atlanta (GA)

•Managed to learn Ruby without doing Rails work!

venerdì 1 marzo 13

Page 3: Integrating Voice Through Adhearsion

What is Adhearsion?

• Ruby voice application framework

• Provides logic for telephony apps

•Open source and managed by a Foundation

• Version 2.2.1 released on 06/01

• 2.0 was released in April 2012

venerdì 1 marzo 13

Page 4: Integrating Voice Through Adhearsion

ADHEARSION 101

venerdì 1 marzo 13

Page 5: Integrating Voice Through Adhearsion

Supported platforms

• Ruby 1.9 only - JRuby working

• Asterisk

• FreeSWITCH

• Voxeo PRISM

• Rayo protocol support (http://rayo.org/)

venerdì 1 marzo 13

Page 6: Integrating Voice Through Adhearsion

Rayo sounds tasty.

• XMPP-based protocol for 3PCC

• Call control

• Audio and media control

• Telephony primitives

venerdì 1 marzo 13

Page 7: Integrating Voice Through Adhearsion

Why should I use Adhearsion?

•Dialplan applications only get you so far

• Every platform has its own syntax

• Some features are simply impossible to achieve

• It’s Ruby. Everybody likes Ruby.

venerdì 1 marzo 13

Page 8: Integrating Voice Through Adhearsion

What can I do?

venerdì 1 marzo 13

Page 9: Integrating Voice Through Adhearsion

How does Ahn talk to platforms?

• Asterisk: AsyncAGI (AMI)

• FreeSWITCH: Inbound Event Socket

• PRISM: Pure Rayo

venerdì 1 marzo 13

Page 10: Integrating Voice Through Adhearsion

Anatomy of an app

• Configuration

• Call Controllers

• Routing

• The ahn command: create, daemon, start, stop, restart, generate, help, version

venerdì 1 marzo 13

Page 11: Integrating Voice Through Adhearsion

Call Controllers

class SimpleController < Adhearsion::CallController def run answer play "tt-weasels" hangup endend

•Hold the application logic (dialplan)

• The #run method is used to invoke the controller

venerdì 1 marzo 13

Page 12: Integrating Voice Through Adhearsion

Other features

• Playback, menus, user input, recording

• Configuration system

• Plugin architecture

• Routing

• Testability

venerdì 1 marzo 13

Page 13: Integrating Voice Through Adhearsion

Sounds great, huh?

venerdì 1 marzo 13

Page 14: Integrating Voice Through Adhearsion

Demo time!class DemoController < Adhearsion::CallController def run answer menu "#{Adhearsion.config.platform[:root]}/sounds/demo-menu", :timeout => 5.seconds, :tries => 3 do match 1 do enter_number end match 2 do record_message end

timeout do play "#{Adhearsion.config.platform[:root]}/sounds/menu-timeout" end invalid do play "#{Adhearsion.config.platform[:root]}/sounds/menu-invalid" end

failure do play "#{Adhearsion.config.platform[:root]}/sounds/menu-failure" hangup end end end

def enter_number number = ask "#{Adhearsion.config.platform[:root]}/sounds/please-enter", :limit => 1, :timeout => 5.seconds if number play "#{Adhearsion.config.platform[:root]}/sounds/you-entered" play "digits/#{number}" end end

def record_message play "#{Adhearsion.config.platform[:root]}/sounds/please-speak-after" record_result = record :start_beep => true, :max_duration => 5_000 logger.info "Recording saved to #{record_result.recording_uri}" play record_result.recording_uri.gsub(/file:\/\//, '').gsub(/\.wav/, '') endend

venerdì 1 marzo 13

Page 15: Integrating Voice Through Adhearsion

Event support

• Adhearsion allows you to trace and react to events

•Guarded handlers in apps

• A specialized block for everything else

venerdì 1 marzo 13

Page 16: Integrating Voice Through Adhearsion

Events over HTTPAdhearsion::Events.draw do punchblock do |event| conn = Faraday.new("http://localhost:3000") conn.post "/publish", { :event => event.inspect } if event.respond_to? :name endend

A Sinatra app with Faye can then distribute events to browsers through Websockets

venerdì 1 marzo 13

Page 17: Integrating Voice Through Adhearsion

Plugins• Virginia provides a Reel interface for

Adhearsion

• It loads a Reel::App and makes all methods availablerequire 'reel'require 'reel/app'

class RequestHandler include Reel::App get('/dial') do Adhearsion::OutboundCall.originate "SIP/100" do invoke ConnectingController end [200, {}, "200 OK"] endend

venerdì 1 marzo 13

Page 18: Integrating Voice Through Adhearsion

Are you sold now?

venerdì 1 marzo 13

Page 19: Integrating Voice Through Adhearsion

Adhearsion in the wild

venerdì 1 marzo 13

Page 20: Integrating Voice Through Adhearsion

•Mobile wireless provider and enabler (MVNO - MVNE)

•OTT applications

• In-call apps

• Adhearsion powers all call logic, billing, and features

venerdì 1 marzo 13

Page 21: Integrating Voice Through Adhearsion

• Voice conversation automation and metrics

• Ad tracking

•Hosted IVR

• Lead tracking

• http://www.ifbyphone.com/

venerdì 1 marzo 13

Page 22: Integrating Voice Through Adhearsion

•House remodeling

• Robo-dialing for appointment sign-up and confirmation

• Real-time data pushed to mobile CRM

•Over 5 million calls in 2012 (one every 5 seconds!)

venerdì 1 marzo 13

Page 23: Integrating Voice Through Adhearsion

• Pre-paid translation service for travelers

• Billing and credit management

• Translator search with AMD detection and adaptive selection

• http://www.sostravelcard.it/

venerdì 1 marzo 13

Page 24: Integrating Voice Through Adhearsion

What the future holds...

•WebRTC: Adhearsion can perform all 3PCC functions

•Multiple device tracking and switching

• Protocol convergence

• Some of these are already implemented in upcoming products

venerdì 1 marzo 13

Page 25: Integrating Voice Through Adhearsion

Adhearsion 3.0

• Currently at the planning stage

• Unified communication platform

• Better ASR support

• Revamped component structure

venerdì 1 marzo 13

Page 26: Integrating Voice Through Adhearsion

AdhearsionConf 2013

• 2012 edition had over 120 attendants

• 2 days, 15 presentations, training, beer

• http://adhearsionconf.com/

venerdì 1 marzo 13

Page 27: Integrating Voice Through Adhearsion

Thank you!

• http://adhearsion.com/

• http://mojolingo.com/

•@adhearsion, @mojolingo

•@lucaprado

•Demo source available at https://github.com/polysics/fosdem2013

venerdì 1 marzo 13