Asterisk-Java

org.asteriskjava.fastagi
Class AsyncAgiServer

java.lang.Object
  extended by org.asteriskjava.fastagi.AbstractAgiServer
      extended by org.asteriskjava.fastagi.AsyncAgiServer
All Implemented Interfaces:
java.util.EventListener, ManagerEventListener

public class AsyncAgiServer
extends AbstractAgiServer
implements ManagerEventListener

AGI server for AGI over the Manager API (AsyncAGI).

AsyncAGI is available since Asterisk 1.6.

Since:
1.0.0

Constructor Summary
AsyncAgiServer()
          Creates a new AsyncAgiServer.
AsyncAgiServer(AgiScript agiScript)
          Creates a new AsyncAgiServer that will execute the given AGI script for every request.
AsyncAgiServer(MappingStrategy mappingStrategy)
          Creates a new AsyncAgiServer with the given MappingStrategy.
 
Method Summary
 void onManagerEvent(ManagerEvent event)
          This method is called when an event is received.
 
Methods inherited from class org.asteriskjava.fastagi.AbstractAgiServer
createPool, execute, finalize, getMappingStrategy, isDie, setMappingStrategy, setMaximumPoolSize, setPoolSize, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncAgiServer

public AsyncAgiServer()
Creates a new AsyncAgiServer.

Note that you must set a MappingStrategy before using it.

See Also:
AbstractAgiServer.setMappingStrategy(MappingStrategy)

AsyncAgiServer

public AsyncAgiServer(MappingStrategy mappingStrategy)
Creates a new AsyncAgiServer with the given MappingStrategy.

Please note that Async AGI does not currently support passing a script name, so your MappingStrategy must be aware that the script property of the AgiRequests will likely be null.

Parameters:
mappingStrategy - the MappingStrategy to use to determine which AGI script to run for a certain request.

AsyncAgiServer

public AsyncAgiServer(AgiScript agiScript)
Creates a new AsyncAgiServer that will execute the given AGI script for every request.

Internally this constructor uses a StaticMappingStrategy.

Parameters:
agiScript - the AGI script to execute.
Method Detail

onManagerEvent

public void onManagerEvent(ManagerEvent event)
Description copied from interface: ManagerEventListener
This method is called when an event is received.

Specified by:
onManagerEvent in interface ManagerEventListener
Parameters:
event - the event that has been received

Asterisk-Java

Copyright © 2004-2009 Stefan Reuter. All Rights Reserved.