1 / 13

VoIP, Asterisk, and Java

Michael P. Plezbert Agilis Systems, Inc St. Louis Java Users Group April 13, 2006. VoIP, Asterisk, and Java. Overview. VoIP Basics Asterisk PBX Asterisk Gateway Interface Manager Interface Asterisk-Java Library Example Security Resources About Us. VoIP.

pravat
Download Presentation

VoIP, Asterisk, and Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Michael P. Plezbert Agilis Systems, Inc St. Louis Java Users Group April 13, 2006 VoIP, Asterisk, and Java

  2. Overview • VoIP Basics • Asterisk PBX • Asterisk Gateway Interface • Manager Interface • Asterisk-Java Library • Example • Security • Resources • About Us

  3. VoIP • Two-way (pseudo-) real-time audio communication over IP network • Allows “free” computer-to-computer calls (disregarding broadband connection fees), e.g. Skype • Calls to “regular” phone network requires specialized hardware or service provider, e.g. Vonage

  4. Cons Reliability of data network becomes paramount Latency and jitter are problems, requiring overallocation of bandwidth and/or QoS Requires VoIP phones or other specialized hardware to emulate traditional phone experience VoIP • Pros • Allows use of single network for voice and data • Cost savings over traditional PBX • Can leverage IT support staff • Easier interaction with computer/data systems

  5. Asterisk PBX • Open source software PBX system • Runs on commodity computer hardware (x86) and software (linux/BSD) • Supports standard VoIP protocols • Hardware available for connection to POTS network • Many features built in, e.g. voicemail, call queues, conference calls

  6. Asterisk Interaction • Asterisk can communicate with external programs in several ways • Call a local script • More suitable for scripting languages than Java • Connect via socket to an “AGI server” • Simple text messages back and forth • Server can be written in any language that supports socket comm • Cannot be used to originate calls • Accept socket (telnet) connections to a manager interface • Can be used to originate calls and receive other events • Read local “call files” • Simple way to originate calls

  7. Asterisk Gateway Interface 1: a call comes into the asterisk server 2: the asterisk server makes a socket connection to an AGI server 3: the AGI server sends commands and receives results over the socket, controlling the flow of the call • Note that the AGI server cannot originate a call using this interface

  8. AGI Commands • The AGI contains many commands for controlling a call, including • answer • hangup • stream file • Limited to streaming local sound files on the asterisk server, NOT over the socket interface • wait for digit • record file • Records to local file on the asterisk server

  9. Manager Interface 1: client connects via socket to the asterisk manager interface and initiates a call 2: asterisk server places the call 3: when call connects, asterisk server connects via socket to the AGI server 4: the AGI server can send commands and receive results and events over both the AGI socket connection and the manager interface connection

  10. The Asterisk-Java Library • Implements both the AGI server interface and the manager client interface • Contains classes and methods for sending commands and receiving events • Eliminates the need to manually build or parse command strings

  11. An Example Simple example will Originate a call Play a sound file Wait up to 5 seconds for a response If 1, 2, or 3 is pressed then Play sound files indicating digit pressed Else Play sound file indicating invalid choice Hangup

  12. Security • VPN or ssl-tunnel suggested • Socket comm is plain text (including authentication to manager interface) • AGI connection is not authenticated • Asterisk configuration • Limit accessibility of external calls

  13. Resources • Asterisk: • http://www.asterisk.org • Asterisk@Home: • http://asteriskathome.sourceforge.net • Asterisk-Java Library: • http://www.asteriskjava.org • http://sourceforge.net/projects/asterisk-java

More Related