Asterisk-Java

What is Asterisk-Java?

The Asterisk-Java package consists of a set of Java classes that allow you to easily build Java applications that interact with an Asterisk PBX Server. Asterisk-java supports both interfaces that Asterisk provides for this scenario: The FastAGI protocol and the Manager API.

Asterisk-Java is compatible with Asterisk 1.0 and 1.2.

The FastAGI implementation supports all commands currently available from Asterisk.

The Manager API implementation supports receiving events from the Asterisk server (e.g. call progess, registered peers, channel state) and sending actions to Asterisk (e.g. originate call, agent login/logoff, start/stop voice recording).

A complete list of the available events and actions is available in the javadocs.

License

Asterisk-Java is provided under the terms of the Apache License, Version 2.0.

Status

Asterisk-Java 0.2 has been released in late november and is available from the sourceforge project page.

Ideas for the future include a stateful higher level API that supports operations like "get list of currently active calls" or "place call" with objects like "Call" or "Channel" that are transparently updated as the state of the corresponding object within the asterisk server changes. An option is to provide an implementation of the Java Telephony API (JTAPI) based on the Generic JTAPI and JCC Project (GJTAPI).

Download

Official releases and release candidates are available on the sourceforge project page.

You can also download a snapshot.

Please feel free to provide any feedback or ask for support via the Asterisk-Java user's mailing list.

Asterisk-Java is also available via cvs from sourcforge:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/asterisk-java login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/asterisk-java co asterisk-java

When prompted for a password for anonymous, simply press the Enter key.

Requirements

At runtime Asterisk-Java requires a Java Runtime Environment (JRE) of at least version 1.4. It has been successfully tested on Sun's JVM and Bea's JRockit.

Of course you also need a working Asterisk server. When using the Manager API be sure that it has been enabled (see Asterisk config manager.conf).

For logging Asterisk-Java will use log4j when available. If you do not include log4j in your Classpath Asterisk-Java will use java.util.logging.

If you choose to compile Asterisk-Java on your own you need a Java Developer Kit (JDK) of at least version 1.4. To run the unit tests you need JUnit and EasyMock in addition.

Related Projects

Asterisk Desktop Manager, or ADM for short, brings the power of Asterisk to the user's desktop. It is written in Java, uses the Eclipse SWT library for its GUI and Asterisk-Java to provide Asterisk connectivity.

Available under the GNU General Public License (GPL).

Asterisk-IM is a plugin for the Jive Messenger XMPP (jabber) server. It provides integrated presence between your IM client and phone, notification of incoming calls by IM and originate calls from the IM client - and of course it is based on Asterisk-Java.

Available under the GNU General Public License (GPL).

AsterFax provides an SMTP Fax gateway for the transmission of faxes using Asterisk and is based on Asterisk-Java.
Available under a modified GNU General Public License (Organizations with more than one fax lines must purchase a commercial licence).

Asterisk-JTAPI is a JTAPI implementation for the Asterisk software PBX system. JTAPI is a provider independent programming interface for Java to build applications for computer telephony or to add support for it. JTAPI covers a wide range of usage scenarios starting from controlling a single telephone to a whole PBX system for example in call-centers.

Asterisk-JTAPI builds on top of two other projects: Asterisk-Java, which provides a Java interface to the Asterisk Manager API, and GJTAPI, which provides a general framework for JTAPI interfaces.

Available under Apache License.

Asterisk .NET is a full port of Asterisk-Java to .NET. It supports both the Manager API and FastAGI. The latest version is available from SourceForge.

Available under Apache License.

Asterisk-Java for Mono/.NET is a port of Asterisk-Java to C# for Mono, Microsoft's .NET Framework and anything else that implements the basic portions of the framework. It currently only supports the Manager API and is based on a pre-0.1 snapshot of Asterisk-Java.

Available under Apache License.

Mobicents is a VoIP Middleware based on the JAIN SLEE standard. It includes an Asterisk RA that is based on Asterisk-Java.

Available under Lesser GNU General Public License (LGPL)

Jast Agi is another toolkit for writing Java applications that connect to Asterisk using the FastAGI protocol. The lastest version introduces a statemachine approach to handle AGI requests and uses java.nio to process all requests in one Thread.

Available under Apache License.

OrderlyCalls has replaced JAGIServer and supports writing Java based AGI Scripts using FastAGI. Support for the Manager API was recently added.

Available under a modified Lesser GNU General Public License (It is prohibited to use it for automating 'cold-calling' and you need prior written permission to provide or augment call queuing).

JAsterisk is a set of JNI classes providing direct access to Asterisk PBX functionality from Java. It is not a socket-level interface to Asterisk (like Asterisk-Java) but a true Java-Asterisk integration at the Thread level.

Available under GNU General Public License.

Sponsors

Thanks to our sponsors:

Sourceforge.net for hosting the development infrastructure for Asterisk-Java.

Cenqua for providing free licenses of Clover and FishEye.

ej-technologies for providing free licenses of JProfiler and install4j.

JetBrains for providing a free license of IntelliJ Idea.

Contact

You can reach me at srt at reucon dot net