Asterisk 1.6.0-beta1 Released


Since a few days the first beta of Asterisk 1.6.0 is available for download.

So far, Asterisk-Java seems to work fine with the new release.


If you encounter any problems feel free to post a comment, join our mailing list or post a bug report.

Update 2008-01-29:

…and they followed up with 1.6.0-beta2.

For the 1.4 series they start providing release candidates, an idea that was discussed on the -dev list before and aims at providing better qualitiy for the final production releases:

The release candidate for 1.4.18 is only
available via svn. It is available for anyone that would like to help test 1.4.18 over the next couple of days before it gets officially released.

Grab it from http://svn.digium.com/svn/asterisk/tags/1.4.18.

Posted in Uncategorized | Tagged

FAQ: Where is the Mailing 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

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.

Posted in Uncategorized | Tagged

Integrating AGI and Apache Tomcat


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


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


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

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


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

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!