<< Previous | Home | Next >>

FAQ: Where is the Mailing List?

Links to Asterisk-Java Users and Developers List

It seems we've hidden the link to our mailing lists a bit too well.

We have two mailing lists:

  • Asterisk-Java Users for users of Asterisk-Java seeking help
  • Asterisk-Java Devel for developers of Asterisk-Java, i.e. the guys enhancing the library code itself. This list not intended to provide support regarding the use of Asterisk-Java.

You can find the subscription details for both lists here.

You might also be interested in our Bug Tracker where you can look for known issues, post new bug reports and submit patches.

MD5 Authentication Bug in Asterisk

Asterisk-Java with Asterisk 1.6

The good news is: Asterisk-Java seems to work quite well with the latest development version of Asterisk.

One issue came up with a discussion on igniterealtime.org concerning Asterisk-IM though. Asterisk-IM had problems authenticating to the latest development version of Asterisk. As it turned out the reason for this was a bug in Asterisk introduced a few months ago:

When using challenge/reponse authentication with AMI the "Login" action uses the secret supplied with the "Login" action instead of the one from manager.conf to calculate the MD5 hash.

This has two effects:

  1. Login with "AuthType: MD5" and "Key:" but without a "Secret:" always fails
  2. Anybody who knows a valid username can login without knowing the secret configured in manager.conf

As Asterisk-Java uses MD5 based challenge/response authentication by default there are probably other users out there that are affected by the problem.

The solution is easy: Just upgrade to the latest revision from trunk. Tilghman just commited a fix with r98536.

Tags :

Integrating AGI and Apache Tomcat

Using Spring Framework and AgiServerThread

I've already described how the Spring Framework can be used to externalize your AGI configuration. That blog entry asumed you are running your AGI server as a stand alone application. What is the best way to run it within an app server or a servlet container like Tomcat however?

When you just place the snippet from here into your applicationContext.xml you will notice that Tomcat will hang on start up and that you won't be able to shut it down properly.
The reason for this is that the AGI server is blocking Tomcat and waits for incoming AGI requests. To solve this you have to wrap your AgiServer in a thread so that it runs in the background. Asterisk-Java comes with a utility class called AgiServerThread that just does this.

So the following snippet will work as expected:

<bean class="org.asteriskjava.fastagi.AgiServerThread"
      init-method="startup" destroy-method="shutdown">
    <property name="agiServer" ref="agiServer"/>
</bean>

<bean id="agiServer" class="org.asteriskjava.fastagi.DefaultAgiServer">
    <property name="bindPort" value="4573"/>
    <property name="mappingStrategy">
        <bean class="xxx">
...
        </bean>
    </property>
</bean>

References:

AGI scripts in Groovy

Using a dynamic language with Asterisk-Java (Part 1)

With a little bit of glue code you can implement your AGI scripts in Groovy, an agile dynamic language for the Java Platform. Your scripts run still in the Java VM on top of Asterisk-Java.

A very simple Groovy AGI script might look like this:

channel.streamFile('tt-monkeysintro')

Save it as hello.groovy, put it into your Groovy AGI directory and access it from Asterisk via

exten => 1234,1,Agi(agi://your.agi.server.org/hello.groovy)

Using Groovy for AGI scripts is great for rapid prototyping as you only have to edit your Groovy script to modify the applications behavior. Recompilation happens automatically. You get the benefits of scripting languages and still run on the JVM.

Here is the glue code to make this work:

public class GroovyAgiScript implements AgiScript
{
    private GroovyScriptEngine gse;

    public GroovyAgiScript() throws IOException
    {
        this.gse = new GroovyScriptEngine("/my/groovy/scripts");
    }

    public void service(AgiRequest request, AgiChannel channel)
            throws AgiException
    {
        String script;
        Binding binding;

        script = request.getScript();
        binding = new Binding();
        binding.setVariable("request", request);
        binding.setVariable("channel", channel);

        try
        {
            gse.run(script, binding);
        }
        catch (ResourceException e)
        {
            throw new AgiException("Unable to load groovy script '" + script + "'", e);
        }
        catch (ScriptException e)
        {
            throw new AgiException("Exception while running groovy script '" +
                    script + "'", e);
        }
    }
}

References:

Users: QLess

Virtual Queue Management

QLess is a virtual queue management system for restaurants, theme parks, casinos, doctor's offices -- basically anywhere people are standing around waiting for a service. It holds the user's spot in line and lets them know how the line is moving along and when they reach the front by calling their cell phone. Then the user is free to wander off and make better use of his time.

You can check out their web site at http://qless.com and try out the voice interface at 877-4-0-LINES.

The entire app is written in Java, and they are using Asterisk and Asterisk-Java for all of the voice communication pieces. "It was unbelievably easy to get up and running with both technologies, and they have both been rock-solid reliable. Thanks so much for all of the great work, and keep it coming!" says Tim McCune, their Chief Technical Architect & Cofounder.

Using Asterisk-Java with AstManProxy

A patch by Gaetan Minet

AstManProxy is a proxy application for the Asterisk Manager API that allows connecting multiple servers and clients through a central point of contact.

From a client perspective AstManProxy is almost transparent. Modified behavior includes a different protocol identifier and a changed logout message. Additionally AstManProxy does not correctly handle ActionIDs during the authentication phase.

Support for the protocol identifier of AstManProxy is available in Asterisk-Java since 0.3.1. The fix for the ActionID requires a modification of AstManProxy. Gaetan Minet has now done the work and provides a patch to fix it.

Additionally you will find support for the server property in the latest 1.0.0-SNAPSHOTs of Asterisk-Java. This property is now available in ManagerEvent – the base class of all events in Asterisk-Java – and contains the name of the Asterisk server that sent the event.

Reference: Gaetan Minet's patch to make AstManProxy work with Asterisk-Java

Users: JIRA Caller ID

Integrating Asterisk with Atlassian's issue tracker

The cool aussi guys at Atlassian had another FedEx day. One of the plugins for their issue tracker JIRA they implemented is JIRA Caller ID.

Though JIRA is mainly used to track issues in software development projects this is by far not the only way to use the tool. JIRA is used to track support requests, project issues and Atlassian even uses it to track candidates in their recruitment process. Issues can be entered directly through their web UI, they can result from incoming emails and of course phone calls. So they had the following idea:

Why not improve JIRA's abilities as a tool for capturing and responding to telephone enquiries? Most calls include Caller ID, showing the called party the caller's telephone number. Why not use this information to automatically retrieve the caller's information in JIRA, saving time and frustration for both parties?

The solution they came up with extracts the Caller ID from the current call and finds the corresponding JIRA user so you can easily access the the caller's profile from which you can search for his open issues. In addition to that the new plugin saves a call history complete with recordings of answered calls:

The plugin will soon be publicly available from Atlassian's plugin library. For now you can get the details from Adrian Hempel's blog entry: JIRA Caller ID.

New Developer: Patrick Breucking

Support for the Live API

Patrick has joined our small team of developers and will help us improve the Live API which is the part of Asterisk-Java we will focus on for our 1.0 release:

While checking for new versions I noticed the "new" Live-API. I am really pleased for that feature. but I miss some things. For example a function to retrieve the logged in/out agents for a queue. My first approach was to extend asterisk-java for my own, but I would like to offer my participation on asterisk java development.

So welcome again, Patrick, and thanks for your support!

Asterisk-Java 0.3.1

Asterisk-Java 0.3.1 has been released and is available from http://asterisk-java.org/download/0.3.1.

0.3.1 is a maintenance release, here is the Changelog:

Bug

  • [AJ-81] - executeCliCommand() always executes "show voicemail users"
  • [AJ-86] - getChannelByName doesn't return the latest channel

Improvement

  • [AJ-79] - Support for the CallWeaver protocol identifier
  • [AJ-80] - getMeetMeRooms() should only return active rooms

New Feature

  • [AJ-68] - Support for Bridge Action
  • [AJ-74] - Support Strategy property in QueueParamsEvent

Task

  • [AJ-78] - Documentation needs thorough examples of the Live API

Users: BioCluster

Turning Asterisk into a fully clusterable platform

"BioCluster is a clustering platform for Asterisk. It is installed alongside Asterisk on several machines and can turn them into a VoIP cluster.
BioCluster doesn't require changes to the Asterisk code, but communicates with it as needed by using Asterisk-Java. Although the peer-to-peer protocol used by BioCluster was originally designed to make Asterisk clusterable, it is separate from any Asterisk-dependent parts and can be adapted to make other platforms clusterable.

All data is shared across nodes in the cluster. This includes extensions, trunks, dialplan data, AGI scripts, configuration and many other types of data. Thus there's no single point of failure. Expanding a cluster with another machine is just a matter of connecting it to the network and giving it the right shared network secret. When a new node connects to the network, it discovers other nodes in the cluster and retrieves all relevant data.

BioCluster uses Asterisk-Java for several uses. It is used to monitor events, for example for keeping track of active channels on a local machine and sending updates about these channels to other nodes in the cluster. We also use it for sending events to Asterisk, e.g. hanging up a channel. Another feature used is the FastAGI server functionality provided in Asterisk-Java to support AGI scripts.

Using the Asterisk Management Interface would have normally been inconvenient and prone to trouble, but Asterisk-Java turned it into a simple task. Its API is extensively documented, which helped easily find the right classes for the task."

Meni Livne, BioCluster Maintainer, Atelis PLC