VOIP and Ruby. The Convergence of Web and Voice Applications using Open Source Software. Justin Grammens Localtone Interactive justin@localtone.



Similar documents
VOIP and Ruby. The Convergence of Web and Voice Applications using Open Source Software. Justin Grammens Localtone Interactive

Web Development Frameworks

Overview of Asterisk (*) Jeff Gunther

VoIP and FreeBSD. The daemon meets the phone. May 15th, 2008 University of Ottawa,, Ottawa, Canada Massimiliano Stucchi

Introduction. What is DUNDi? Configuring Asterisk for use with DUNDi

Ruby on Rails is a web application framework written in Ruby, a dynamically typed programming language The amazing productivity claims of Rails is

Mediatrix 3000 with Asterisk June 22, 2011

Micronet VoIP Solution with Asterisk

Asterisk. Michael Kershaw

Asterisk & ENUM. Extending the Open Source PBX. Michael Haberler, IPA Otmar Lendl, nic.at

Open Source Telephony Projects as an Application Development Platform. Frederic Dickey Director Product Management

Introduction to VOIP. Stephen Okay Abdus Salam Int l Center for Theoretical Physics Trieste, Italy, February 21, 2007

How To Use An Asterisk Server For A Phone Or Internet Communication

and Voice Applications Eyal Wirsansky, Verso Technologies JaxJUG

Stack Num IP Username Password

Asterisk: A Non-Technical Overview

Open source VoIP Networks

Outline. Lecture 18: Ruby on Rails MVC. Introduction to Rails

VoIP-PSTN Interoperability by Asterisk and SS7 Signalling

CVOICE Exam Topics Cisco Voice over IP Exam # /14/2005

Setup Guide: on the MyNetFone Service. Revision History

Wildix Management System (WMS) White Paper

Introduction p. 7 About This Book p. 1 Conventions Used in This Book p. 2 What You Don't Have to Read p. 2 Foolish Assumptions p. 2 How This Book Is

Lessons from Building Asterisk GUIs. Presented by Gaston Draque

Internet Technology Voice over IP

Basic configuration of the GXW410x with Asterisk

VoIP Workshop PacNOG3

Hudson Continous Integration Server. Stefan Saasen,

Open Source VoiceXML Interpreter over Asterisk for Use in IVR Applications

Secure, Multi-lateral Peering with Asterisk TM V November 2005

IP-PBX Quick Start Guide

Practical Guide. How to setup VoIP Infrastructure using AsteriskNOW

VoIP and IP IT Tralee

Ruby on Rails in GlassFish Sun Microsystems

Integration of GSM Module with PC Mother Board (GSM Trunking) WHITE/Technical PAPER. Author: Srinivasa Rao Bommana

So, you need to deploy a Private Branch exchange

Configuring Positron s V114 as a VoIP gateway for a 3cx system

VOIP with Asterisk & Perl

Application Note. Using a Dialogic Media Gateway Series as a PSTN Gateway with an Asterisk IP-PBX Server

Configuring a Pure-IP SIP Trunk in Lync 2013

Evaluation. Chapter 1: An Overview Of Ruby Rails. Copy. 6) Static Pages Within a Rails Application

Asterisk Overview. Berkeley In Munich Tech Talks prepared by. Emil Stoyanov

Leveraging Asterisk to Deliver Large Scale VoIP Services in a Carrier Environment. JR Richardson

IP Telephony with Asterisk. Sunday A. Folayan

IBM WebSphere Application Server Communications Enabled Applications

IP Based Voice Server Application With PBX Using Free SWITCH ISSN

Configuration Notes 290

Specialty Answering Service. All rights reserved.

Ryan Brown October 9, 2004 The Burgh Live, LLC. Voice over IP using Asterisk (*)

Chapter 1 - Introduction

How to Configure the Allworx 6x, 24x and 48x for use with Integra Telecom SIP Solutions

Connecting Your Enterprise With Asterisk: IAX to Carriers. Dayton Turner Voxter Communications

Enterprise Voice and Online Services with Microsoft Lync Server 2013

Accelerating Rails with

Configuration Notes 283

Implementing Cisco IOS Unified Communications (IIUC)

Configuring the Cisco SPA8800 IP Telephony Gateway in an Asterisk Environment

The Learn-Verified Full Stack Web Development Program

IP Implementation in Private Branch Exchanges From 9:30 a.m until 4:30 p.m (7 hrs./day) 5 days / week

This manual contains product information for the GSM Series cards. The manual is organized in the following manner:

Ruby on Rails. a high-productivity web application framework. blog.curthibbs.us/ Curt Hibbs <curt@hibbs.com>

IP PBX SH-500N

DUNDi, So Easy A Caveman Could Do It!

Asterisk. the general purpose Open Source Telephony platform. a Advanced Scenarios. Klaus Peter Junghanns (kapejod) 2004 Junghanns.

Deploying, Configuring, and Administering Microsoft Lync Server 2010

IBM WebSphere Application Server Communications Enabled Applications Setup guide

MS 20337A: Enterprise Voice and Online Services with Microsoft Lync 2013

Project SailFin: Building and Hosting Your Own Communication Server.

NetVanta 7100 Exercise Service Provider SIP Trunk

ACD: Average Call Duration is the average duration of the calls routed bya a VoIP provider. It is a quality parameter given by the VoIP providers.

Fig. Setting up of a VoIP call. Fig. Experimental setup

Using the GS8 Modular Gateway with Asterisk

OpenVox GSM Gateway Function Manual

Course 10533A: Deploying, Configuring, and Administering Microsoft Lync Server 2010

Softswitch & Asterisk Billing System

1. Mobile VoIP solutions and Services:

A sysadmin s view of VoIP

Unicorn60x0 IP ANALOG GATEWAY ASTERISK CONFIGURATION

An Introduction to VoIP Protocols

Applications between Asotel VoIP and Asterisk

An introduction to PHP & AGI

Crash Course in Asterisk

Integrate Rails into an Existing IIS Web infrastructure using Mongrel

Tech Bulletin IPitomy AccessLine SIP Provider Configuration

2- Technical Training (9 weeks) 3- Applied Project (3 weeks) 4- On Job Training (OJT) (4 weeks)

Building native mobile apps for Digital Factory

VoIP and IP Telephony

FOR COMPANIES THAT WANT TO EXPAND AND IMPROVE THEIR TELEPHONE SYSTEM

Cloud Voice A new and simpler way to deliver your voice communications

VoIP support on Qtopia. Vladimir Minenko, Ph.D.

Q1 Have you ever migrated an Adhearsion application from one VoIP platform to another?

Asterisk Business Edition TM Digium Partner Certification

Quick Installation Guide

Ruby On Rails. CSCI 5449 Submitted by: Bhaskar Vaish

Improving Quality in Voice Over Internet Protocol (VOIP) on Mobile Devices in Pervasive Environment

FortiVoice. Version 7.00 User Guide

WebRTC: Why and How? FRAFOS GmbH. FRAFOS GmbH Windscheidstr. 18 Ahoi Berlin Germany

Contact Centers and the Voice-Enabled Web. Peter J. Cornelius

Colt VoIP Access Colt Technology Services Group Limited. All rights reserved.

Introducing Cisco Voice and Unified Communications Administration Volume 1

Transcription:

VOIP and Ruby The Convergence of Web and Voice Applications using Open Source Software Justin Grammens Localtone Interactive justin@localtone.com

VOIP is NOT About Cheap Phone Calls Other companies are already doing this cheaper and better.

VOIP Applications! It's about the applications that we can build!

What We Will Cover Why do VOIP now? Ruby Adhearsion Telegraph Demos

Why Now? Only recently has good Open Source Software been developed ( Rails / Asterisk ) Telecoms are slow to react Few applications merge voice and web Cell phone are everywhere!

Why Now? 2.7 Billion mobile phones. 1.4 Billion fixed-lines. 1/3 of Internet Users access the internet from their mobile phone. iphone has shown consumers why they need the interactive internet on their phone. Others will follow. Most phone users can be identified by a standardized numerical system.

VOIP / Web Analogy Technology Web VOIP Protocol HTTP FTP RTP SIP Industry Standard IAX Asterisk Specific H.323 Obsolete Jingle Gtalk Skype - Proprietary Codec gzip, jpg, gif, mp3, ogg, wma, flv, mpeg, avi g.711 high bandwidth gsm medium bandwidth g.729 low bandwidth Server Apache / Lighttpd Asterisk, Freeswitch Interactivity CGI AGI Asterisk Gateway Interface AMI Asterisk Manager Interface

Asterisk + Open Source Private Branch Exchange (PBX) + Very powerful and flexible + Relatively Stable - Messy to deal with in terms of extending functionality. +++ Free!

Ruby Released in 1995 by Yukihiro Matz Matsumto Open Source programming language Object Oriented ( allows for good software principals to be used ) Dynamic ( compiled at runtime )

Ruby Run on any platform that has the Ruby interpreter installed. Dynamic Language - Can't get something for free. Trade-off Performance vs Ease of use. Ruby Ports to other virtual machines. JRuby (JAVA), IronRuby(.NET), Rubinius(Smalltalk) Try to make programming concise, less code = less bugs, natural to read and FUN.

Ruby Examples # Output "I love Ruby" say = "I love Ruby" puts say # Output "I *LOVE* RUBY" say['love'] = "*love*" puts say.upcase # Output "I *love* Ruby" # five times 5.times { puts say }

Ruby Examples Intuitive operations on Arrays cities = [ 'Detroit', 'Denver', 'New York' ] cities_been_to = [ 'Detroit, 'Denver' ] cities_to_visit = cities - cities_been_to puts cities_to_visit Interactive Ruby Shell Example (irb)

Ruby on Rails Open Source Web Framework Created by a Danish Programmer named David Heinemeier Hansson (DHH) Increases speed at which applications can be developed. Convention over configuration. DRY Don't repeat yourself.

Ruby on Rails Many modules already included ActiveRecord TestUnit WEBrick Javascript Libraries RESTful Web Services Follows a paradigm of Model, View Controller (MVC) Model Database objects View The display in the web browser Controller Routing of the display to the view.

Typical Voice System VOIP Clients SIP Rails PSTN Network Origination/ Termination Server SIP / IAX Asterisk Server AGI / AMI / Adhearsion / Telegraph PSTN Network Analog Interface Card Zaptel / Other

Asterisk Dialplan Language [demo] ; Sample from Asterisk configuration extensions.conf file ; ; We start with what to do when a call first comes in. ; exten => s,1,wait(1) ; Wait a second, just for fun exten => s,n,answer ; Answer the line exten => s,n,set(timeout(digit)=5) ; Set Digit Timeout to 5 seconds exten => s,n,set(timeout(response)=10) ; Set Response Timeout to 10 seconds exten => s,n(restart),background(demo-congrats) ; Play a congratulatory message exten => s,n(instruct),background(demo-instruct); Play some instructions exten => s,n,waitexten ; Wait for an extension to be dialed. exten => 2,1,BackGround(demo-moreinfo) exten => 2,n,Goto(s,instruct) ; Give some more information. exten => 3,1,Set(LANGUAGE()=fr) exten => 3,n,Goto(s,restart) ; Set language to french ; Start with the congratulations exten => 1000,1,Goto(default,s,1)

Difficulties in Asterisk Conditional Loops Error Handling Complex Data Structure Date and time handling Database / LDAP Integration RegEx Pattern Matching Extending the language Portability - Asterisk v.s Freeswitch, etc. Variables Object Oriented Design

Ruby / Asterisk Integration Tools RAGI Just for AGI. Not integrated with Rails. No longer active. RAMI Just for Management Interface. No Rails Integration. Not Active. Adhearsion Active. Good for writing pure voice applications. Not tied with Rails (but can be without too much effort). Telegraph Active. Tightly integrated with Rails. Embraces the Voice/Web Analogy.

Adhearsion Standalone server that talks with Asterisk Developed by Jay Phillips of Codemecca Open Source Current version is 0.7.7 Development on 0.8 is nearly complete. Lots of new changes.

Adhearsion Put the line below in extensions.conf Tells Asterisk to process all calls by our Adhearsion server exten => _X.,1,Agi(agi://127.0.0.1) or... when extension 888 is dialed. exten => 888,1,Agi(agi://127.0.0.1)

Adhearsion - dialplan.rb adhearsion { play %w(press-1 for minneapolis press-2 for chicago or press-3 for dallas weather otherwise-press 4) selection = input() w = new_weather case selection when '1' then play w.weather_report("minneapolis, MN") when '2' then play w.weather_report("chicago, IL") when '3' then play w.weather_report("dallas, TX") else simon = new_simon_game simon.start end }

Adhearsion - Demos SIP Phone XLite Asterisk extensions.conf [ adhearsion ] exten => 8000,1, Agi(agi://...) Adhearsion dialplan.rb adhearsion { code.. code.. }

Adhearsion - Demo Notes: Start up Asterisk : sudo asterisk Show asterisk CLI. Start up Adhearsion 0.8 Server : ~/development/adhersion/trunk/bin/ahn start. in the rumadhearsion directory Point Xlite Phone to Localhost dial extension 8000

Adhearsion Weather Demo Demo #1 - Weather - Parses data from Yahoo RSS feed <yweather:forecast day="mon" date="31 Dec 2007" low="6" high="19" text="flurries" code="13" /> rep = %W(weather is-currently #{w.current.temp} degrees today high #{today.high} low #{today.low}) + w.current.desc

Adhearsion Simon Says Demo #2 - Play Simon Says Game def verify_attempt if attempt_correct? call_context.play 'good' else call_context.play %W(#{number.size - 1} times wrong-try-again-smarty) reset end end

Adhearsion Write Ruby in our dial plans! Ability to use any Ruby gems we need (Active Record, etc.) Test and debug our application in isolation. Bring OO practices to VOIP development

Adhearsion It's abstracted and portable across other PBXes It's simple It's extensible It's readable It's maintainable It's fun!

Adhearsion Where's the Rails? Not directly integrated with Rails by choice. Written to stand on it's own, but you can link in your models using ActiveRecord. Looking for VOIP in the MVC framework? Look no further than Telegraph...

Telegraph Written by a company named Idapted. Extracted from production application ( Idapted's distributed voice system for English language learning EnglishQuad ) Started with RAGI / RAMI Tightly Integrated with the Rails/Web Interface They claim it embraces the Voice/Web analogy

Telegraph Installs into any Rails project as a plugin script/plugin install svn://rubyforge.org/var/svn/telegraph/trunk start up the server script/agi_server Interfaces with the gateway (incoming calls) script/ami_server Interfaces with the Asterisk manager

Telegraph Banking Demo SIP Phone XLite Rails Application Asterisk AGI Server

Telegraph Add this to your extensions.conf exten => s, n, AGI(agi://localhost/account) respond_to do wants #r index.html wants.html { render } # Telegraph allows render_voice # which uses the index.voice file wants.voice{ render_voice } end

Banking Demo index.voice: voice.play "welcome-to-demo #{say_amount(@balance)}" voice.link_to_dtmf 'banking-main-menu' do link 1, :action=>'new' link 2, :action=>'list' link :default, :action=>'index' end

Telegraph - Demo Start up telegraph server : telegraph/banking_demo ruby script/asterisk_server ruby script/server Visit http://localhost:3000/account Dial Extension 9000

Real World Application estara Offers a service where a user browsing a site can enter their phone number. The system will dial their number, ask the person to hold and then dial customer service. We'll do this.

Demo Topology Cell Phone PSTN Origination/ Termination Server Internet Asterisk Rails Application AGI Demos: 1. Using the browser to initiate phone call. 2. Who Wants To Be A Billionaire game. AMI

Demo Using PSTN Telegraph Demos - Use the browser to initiate a wakeup call. Use the browser to initiate phone calls to 10 digit phone numbers and bridge the calls Use the browser to initiate a call and verify correct code was entered. Adhearsion Demo - Adhearsion My Who Wants To Be A Billionaire application.

Resources http://rubyhoedown2007.confreaks.com/session03.htm http://www.slideshare.net/jpalley/respondto-voicethe-convergence-of-voice-and-web-interfaceswith-rails-and-asterisk http://adhearsion.com/ http://telegraph.rubyforge.org http://www.voip-info.org