17
Building real life applica/ons with Adhearsion Luca Pradovera Voice Applica/on Developer at Mojo Lingo – Atlanta, GA

Building Real Life Applications with Adhearsion

Embed Size (px)

DESCRIPTION

Building Real Life Applications with Adhearsion presented by Luca Pradovera at Lone Star Ruby Conference 2012

Citation preview

Page 1: Building Real Life Applications with Adhearsion

Building  real  life  applica/ons  with  Adhearsion  

Luca  Pradovera  Voice  Applica/on  Developer  at  

Mojo  Lingo  –  Atlanta,  GA  

Page 2: Building Real Life Applications with Adhearsion

What  is  Adhearsion?  

•  Ruby  voice  applica/on  framework  •  Provides  logic  for  telephony  apps  •  Open  source  and  managed  by  a  Founda/on  •  Version  2.1  released  on  08/08  •  2.0  was  released  in  April  with  a  complete  overhaul  

LSRC  2012  –  Aus/n,  TX   2  

Page 3: Building Real Life Applications with Adhearsion

Supported  plaSorms  

•  Ruby  1.9,  Jruby  with  a  couple  issues  •  Asterisk  •  Voxeo  PRISM  •  FreeSWITCH  in  2.1.0  •  Rayo  protocol  allows  for  other  plaSorms  to  be  supported  

LSRC  2012  –  Aus/n,  TX   3  

Page 4: Building Real Life Applications with Adhearsion

An  Adhearsion  applica/on  

•  Configura/on  •  Call  Controllers  •  Rou/ng  •  The  ahn  command:  create,  daemon,  start,  stop,  restart,  generate,  help,  version  

LSRC  2012  –  Aus/n,  TX   4  

Page 5: Building Real Life Applications with Adhearsion

Call  Controllers  

•  Contain  the  logic  for  the  applica/on  •  Have  a  #run  method  that  is  called  for  execu/on  

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

LSRC  2012  –  Aus/n,  TX   5  

Page 6: Building Real Life Applications with Adhearsion

Rou/ng  

•  Matches  condi/ons  to  controllers  •  Is  in  adhearsion.rb  together  with  the  config    Adhearsion.router do! route 'Simple controller', SimpleController, :to => '1'! route 'Outbound Notification', Adhearsion::OutboundCall, ConnectingController! route 'default', MenuController!

end!

LSRC  2012  –  Aus/n,  TX   6  

Page 7: Building Real Life Applications with Adhearsion

Basics  

•  Output:  #play,  #say  •  Input:  #ask  •  Menu:  #menu  •  Recording:  #record  •  Logging  •  DemoController  demo  

LSRC  2012  –  Aus/n,  TX   7  

Page 8: Building Real Life Applications with Adhearsion

Plugins  

•  Provide  extra  func/onality  in  a  reusable  manner  

•  Packaged  as  gems  •  Self-­‐documen/ng  configura/on  •  “Just”  a  library  of  classes  •  Expose  hooks  for  loading  and  star/ng  •  The  adhearsion-­‐drb  plugin  

LSRC  2012  –  Aus/n,  TX   8  

Page 9: Building Real Life Applications with Adhearsion

Integra/ng  with  other  apps  

•  Database  (Ac/ve  Record,  Sequel)  •  HTTP/REST  •  DRb  •  Queue  systems  •  Click  to  call  demo  

LSRC  2012  –  Aus/n,  TX   9  

Page 10: Building Real Life Applications with Adhearsion

Events  

•  Are  exposed  through  guarded  handlers  •  Handled  globally  or  per-­‐call  •  Essen/al  for  building  complex  interac/ons  •  Events  in  the  browser  demo  

LSRC  2012  –  Aus/n,  TX   10  

Page 11: Building Real Life Applications with Adhearsion

Call  events  and  /mers  

•  The  main  object  you  work  with  is  a  Call  •  Calls  have  specialized  handlers  •  On_joined,  on_answer,  on_end  •  Timers  allow  for  periodic  events  •  BillingController  demo  

LSRC  2012  –  Aus/n,  TX   11  

Page 12: Building Real Life Applications with Adhearsion

Case  studies  

•  Adhearsion  is  used  in  produc/on  now  •  Usage  covers  a  wide  range  of  applica/ons  •  Testability,  integra/on,  modularity  •  Built  for  the  developer  experience  

LSRC  2012  –  Aus/n,  TX   12  

Page 13: Building Real Life Applications with Adhearsion

E-­‐Mediators  

•  Adhearsion  1.2  •  Cultural  mediator  service  •  Mul/lingual  menu  and  interface  •  Complex  billing  with  rechargeable  accounts  •  Web-­‐based  SIP  interface  with  Java  and  Websockets  

•  Mostly  SIP  based  

LSRC  2012  –  Aus/n,  TX   13  

Page 14: Building Real Life Applications with Adhearsion

SOS  Travel  Card  

•  Transla/on  service  for  travelers  •  Prepaid  cards  with  PIN  system  •  Completely  manageable  through  IVR,  SMS,  and  Web  

•  Voicemail  handles  busy  situa/ons,  users  are  called  back  automa/cally  

•  Cellphone  based  and  operated  

LSRC  2012  –  Aus/n,  TX   14  

Page 15: Building Real Life Applications with Adhearsion

VerbalizeIt  

•  Human  transla/on  service  •  For  business  and  travelers  •  Provides  over  the  phone  service,  a  mobile  app,  and  and  API    

•  Also  offers  language  learning  sessions  

LSRC  2012  –  Aus/n,  TX   15  

Page 16: Building Real Life Applications with Adhearsion

Mobile  operator  

•  “Inside  the  carrier”  deployment  •  New  MVNO  opera/ng  in  North  America  •  Ahn  operates  the  subscriber  database,  authen/ca/on,  billing  

•  All  call  rou/ng  •  Voicemail  and  services  •  In-­‐call  audio  using  early  media  to  provide  innova/ve  content  

LSRC  2012  –  Aus/n,  TX   16  

Page 17: Building Real Life Applications with Adhearsion

Thank  you!  

Presented  by:  Luca  Pradovera  

 @lucaprado  

Github:  polysics  hpp://adhearsion.com  hpp://mojolingo.com  

LSRC  2012  –  Aus/n,  TX   17