Vo IP Asterisk and Java Michael P Plezbert
Vo. IP, Asterisk, and Java Michael P. Plezbert Agilis Systems, Inc St. Louis Java Users Group April 13, 2006
Overview Vo. IP Basics Asterisk PBX Asterisk Gateway Interface Manager Interface Asterisk-Java Library Example Security Resources About Us Vo. IP, Asterisk, and St. Louis JUG April 13,
Vo. IP Two-way (pseudo-) real-time audio communication over IP network Allows “free” computer-tocomputer calls (disregarding broadband connection fees), e. g. Skype Calls to “regular” phone network requires specialized hardware or service provider, e. g. Vonage Vo. IP, Asterisk, and St. Louis JUG April 13,
Vo. IP Pros Cons Allows use of single network for voice and data Reliability of data network becomes paramount Cost savings over traditional PBX Can leverage IT support staff Latency and jitter are problems, requiring overallocation of bandwidth and/or Qo. S Easier interaction with computer/data systems Vo. IP, Asterisk, and St. Louis JUG Requires Vo. IP phones or other specialized hardware to emulate traditional phone April 13, experience
Asterisk PBX Open source software PBX system Runs on commodity computer hardware (x 86) and software (linux/BSD) Supports standard Vo. IP protocols Hardware available for connection to POTS network Many features built in, e. g. voicemail, call queues, conference calls Vo. IP, Asterisk, and St. Louis JUG April 13,
Asterisk Interaction Asterisk can communicate with external programs in several ways Call a local script 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 More suitable for scripting languages than Java Can be used to originate calls and receive other events Read local “call files” Vo. IP, Asterisk, and Simple way to originate calls St. Louis JUG April 13,
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 St. Louis JUG April 13, Vo. IP, Asterisk, and interface
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 Vo. IP, Asterisk, and Records to local file on the asterisk server St. Louis JUG April 13,
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 Vo. IP, Asterisk, and manager interface St. Louis JUG April 13,
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 Vo. IP, Asterisk, and St. Louis JUG April 13,
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 Vo. IP, Asterisk, and St. Louis JUG April 13,
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 Vo. IP, Asterisk, and St. Louis JUG April 13,
Resources Asterisk: Asterisk@Home: http: //www. asterisk. org http: //asteriskathome. sourceforge. net Asterisk-Java Library: http: //www. asteriskjava. org http: //sourceforge. net/projects/asterisk-java Vo. IP, Asterisk, and St. Louis JUG April 13,
- Slides: 13