• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Asterisk-Java Framework Presentation
 

Asterisk-Java Framework Presentation

on

  • 20,728 views

My presentation of the Asterisk-Java framework and Click-to-Call service I developed to The Groovy Users of Minnesota technology group.

My presentation of the Asterisk-Java framework and Click-to-Call service I developed to The Groovy Users of Minnesota technology group.

Statistics

Views

Total Views
20,728
Views on SlideShare
17,170
Embed Views
3,558

Actions

Likes
9
Downloads
0
Comments
3

23 Embeds 3,558

http://blogs.reucon.com 1330
http://asterisk-java.org 1260
https://blogs.reucon.com 723
http://www.asteriskclub.org 137
http://www.slideshare.net 39
http://translate.googleusercontent.com 25
http://webcache.googleusercontent.com 22
http://www.techgig.com 6
http://www.linkedin.com 2
http://64.233.163.132 1
http://209.85.129.132 1
http://74.125.91.132 1
http://74.125.93.132 1
http://feeds2.feedburner.com 1
http://static.slideshare.net 1
http://office.jawilla.com 1
http://www.feedage.com 1
http://74.125.43.113 1
http://asteriskclub.org 1
http://74.125.77.101 1
http://74.125.45.113 1
http://209.85.227.132 1
https://www.facebook.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

13 of 3 previous next Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • mantab bro !
    Are you sure you want to
    Your message goes here
    Processing…
  • nice one
    Are you sure you want to
    Your message goes here
    Processing…
  • nice!
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Asterisk-Java Framework Presentation Asterisk-Java Framework Presentation Presentation Transcript

    • VoIP using Groovy Building a “Click to Call” web service in Groovy using Open Source Software. Justin Grammens Localtone Interactive justin@localtone.com
    • But First A lot of background on Asterisk, VoIP, Open Source Telephony... and a little of who I am.
    • About Me Interested and developing applications using Asterisk for more than a year. Created screencasts for how to get started with Asterisk and Adhearsion. Developed an application for GeekSquad to handle computer repairs Currently developing a phone voting interface for Localtone Radio
    • 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 What is Asterisk? ➢ What is a VoIP application? ➢ Why build it now? ➢ Asterisk-Java ➢ Click to Call Web Service ➢
    • Asterisk + Open Source Private Branch Exchange (PBX). ➢ Handles calls over ethernet or RJ11 (phone line). + Very powerful and flexible. I call Asterisk not ➢ just a PBX, but a telephony platform. + Relatively stable and scalable. ➢ - Messy to deal with in terms of extending ➢ functionality. +++ Free! ➢
    • Asterisk : Terminology Channel – A channel is what can setup and ➢ receive calls. Dialplan – Script of what to do with a call. Written ➢ in the asterisk macro language. AGI – Stdin/out TCP method allowing external ➢ applications to dynamically write dialplans. AMI – Allows sending of commands and listen ➢ for stateful events.
    • VOIP / Web Analogy Technology Web VOIP HTTP Protocol SIP – Industry Standard FTP IAX – Asterisk Specific RTP H.323 – Obsolete Jingle – Gtalk Skype - Proprietary gzip, jpg, gif, g.711 – high bandwidth Codec mp3, ogg, wma, gsm – medium bandwidth flv, mpeg, avi g.729 – low bandwidth Apache / Tomcat Asterisk, Freeswitch Server AGI – Asterisk Gateway Interactivity Interface CGI AMI – Asterisk Manager Interface
    • What is a VoIP Application Same applications we typically develop, but the website can interface with voice and phones. User's send commands using the dialpad of their phone. Users see the application change either on their phone or on the internet. It's all just data!
    • Why Now? Only recently has good Open Source Software ➢ been developed ( Grails / Groovy / 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. ➢ Users can access your application by any ➢ standard home phone. Still hundreds of millions of phones that don't ➢ have an internet browser. Most phone users can be identified by a ➢ standardized numerical system.
    • Typical Voice System VOIP Clients SIP Grails / Origination/ AGI / PSTN Termination Asterisk SIP / IAX AMI Asterisk Network Server - Java Server Libs / Tomcat Analog PSTN Zaptel Interface Network / Other Card
    • 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) ; Give some more information. exten => 2,n,Goto(s,instruct) exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french exten => 3,n,Goto(s,restart) ; Start with the congratulations exten => 1000,1,Goto(default,s,1)
    • Difficulties in Asterisk Conditional Loops Error Handling ➢ ➢ Complex Data Date and time ➢ ➢ Structure handling Database / LDAP RegEx Pattern ➢ ➢ Integration Matching Extending the Variables ➢ ➢ language Object Oriented ➢ Portability - Asterisk Design ➢ v.s Freeswitch, etc.
    • Java / Asterisk Integration Tools Asterisk-Java project ➢ Started in 2005. ➢ ➢ Provides support for AGI and AMI. ➢ Open Source library. ➢ Runs in the JVM, so it's accessible via Groovy. ➢ Have used it via JRuby as well. ➢ Cross platform.
    • Asterisk-Java Put the line below in extensions.conf Tells Asterisk to process all calls by our Asterisk-Java process exten => _X.,1,Agi(agi://127.0.0.1/hello.agi) or... when extension 888 is dialed. exten => 888,1,Agi(agi://127.0.0.1/hello.agi)
    • AGI Topology Cell Origination/ Phone Asterisk Termination AGI Java Server StdOut Asterisk PSTN Process Internet extensions .conf AGI StdIn
    • Asterisk – Groovy AGI import org.asteriskjava.fastagi.* public class HelloAgiScript extends BaseAgiScript { public void service(AgiRequest request, AgiChannel channel) throws AgiException { answer() // Answer streamFile(quot;welcomequot;) // play file hangup() //hangup } }
    • AMI Topology Grails Cell Origination/ Phone Termination Server PSTN Asterisk Internet AMI Web Request
    • Asterisk – Groovy AMI import org.asteriskjava.manager.* class HelloManager { def void run() throws IOException, AuthenticationFailedException, TimeoutException { originateAction = new OriginateAction() originateAction.setChannel(quot;SIP/Johnquot;) originateAction.setContext(quot;defaultquot;) originateAction.setExten(quot;1300quot;) originateAction.setPriority(new Integer(1)) originateAction.setTimeout(new Integer(30000)) }
    • Asterisk - Java Write Groovy in our ➢ dial plans! Ability to use ➢ databases, frameworks (Grails) rd and 3 party Java libraries. Test and debug our ➢ application in isolation.
    • Asterisk - Java It's Java (or Groovy) ➢ It's simpler ➢ It's extensible ➢ It's readable ➢ It's maintainable ➢ Bring OO practices to ➢ VoIP development.
    • Asterisk Screencast Learn more at http://localtone.blogspot.com/ ➢ Downloading Asterisk. ➢ Configuring Asterisk in extensions.conf ➢ Download X-Lite or SJ Phone. ➢ Register to Asterisk two phones using SIP ● protocol.
    • 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.
    • Amazon Support – Click to Call
    • Click to Call Web Service Problem: You have a website and want to allow your users to type their phone number in and have your business phone ring and then connect the call. Web service allows you to pass in a source phone number, a destination phone number and an API Key.
    • Web Service Request Request: /dial/create?source=${SOURCE}&destination=${D ESTINATION}&apiKey=${APIKEY} Result: <Result xml:ns=quot;urn:localtone:clicktocalljavaquot; xsi:schemaLocation=quot;http://api.localtoneinteractiv e.com/ClickToCallJava/V1/DialResponse.xsdquot;> <Guid>IQ40M</Guid> <Status>100</Status> <Description>Call queued</Description> </Result>
    • Web Service Status Request: /clicktocalljava/dial/show/IQ40M Result: <Result xml:ns=quot;urn:localtone:clicktocalljavaquot; xsi:schemaLocation=quot;http://api.localtoneinteractiv e.com/ClickToCallJava/V1/DialResponse.xsdquot;> <Guid>IQ40M</Guid> <Status>200</Status> <Description>No Answer</Description> <Source>SIP/200</Source> <Destination>SIP/200</Destination> <User>admin</User> </Result>
    • GitHub Project Current code for the click to call web service implemented in Asterisk-Java can be found at: http://github.com/justingrammens/clicktocalljava/tr ee/master Working on an implementation in Ruby, using the Adhearsion framework.
    • Questions? Thanks!