SourceForge.net Logo
Download Now
On Sourceforge:
Bug Tracker
Mailing List
API Javadocs
Developer's Guide
Migration Guide
Support This Project

Migrating from JAGIServer

OrderlyCalls contains code from the JAGIServer project to handle Asterisk FastAGI. In addition to Manager support, OrderlyCalls offers an extensible Named Service architecture, and extensible XML configuration, so JAGIServer users hould migrate their code to OrderlyCalls.

OrderlyCalls also contains a number of bug fixes and performance enhancements compared with the JAGIServer release, which is no longer supported, as OrderlyCalls supercedes it in every way.

OrderlyCalls has designed with ease of migration in mind, so please follow these instructions to migrate your code. If you find that you need to make any additional changes as a result of migration, please email us so we can add the details to these instructions.

Step 1: Change import declarations

The JAGI* classes in com.orderlysoftware.phone have been moved to com.orderlysoftware.orderlycalls.asterisk.agi, so you should change your import statements to

import com.orderlysoftware.orderlycalls.asterisk.agi.*;

Step 2: Change your reference declarations

The AGI classes have been renamed as follows:

JAGIServer OrderlyCalls
JAGIProcessor AGIProcessor
JAGIClient AGIConnection
JAGIServer AGIServer

You should change all declared references to use the new classes. You should also make sure your old JAGIProcessors implement the new AGIProcessor interface instead.

Step 3: Update Function Calls

AGIClient (JAGIConnection)
Function names have been preserved, except for the getContextProperty() functions, which have been renamed getAGIProperty() for clarity.

AGIServer (JAGIServer)
This class has been modified extensively, and the old getJAGIServer(processorName, port, reuse) function is no longer supported as OrderlyCalls uses Settings objects to encapsulate initialisation parameters.

  • Preferably, you should use OrderlyCalls to specify this information as a Named Service in the configuration XML file. You can then get a running instance of the new AGIServer by calling OrderlyCalls.getService(name) or AGIServer.getInstance(name).

    You can access the OrderlyCalls functions either by running OrderlyCalls as a stand-alone application server, or by calling OrderlyCalls.init(File f) from within your own code.

  • Alternatively, you may get a running instance of AGIServer without OrderlyCalls as follows:
    String processorName="com.mypackage.MyProcessor";
    int port=4573;
    String name="myAGIServer";
    AGIServer agiServer=null;
    try {
    	AGISettings settings = new AGISettings();
    	AGISettings.BindSettings bs = settings.new BindSettings();
    	bs.setAddress(new InetSocketAddress(port));
    } catch (Exception e) {
    	System.out.println("Error while creating server:");

You can get the same instance subsequently by calling AGIServer.getInstance(name).

You should also replace calls to jagiServer.cease() with agiServer.shutdown().

Step 4: Upgrade your Processors (Optional)

Once you've got a working system, you should consider upgrading your AGIProcessors to implement the AGIReusableProcessor interface for more efficient object reuse, and greater performance.

Please see the API Javadocs for further details.

Copyright Orderly Software 2004-2005, All Rights Reserved.