Asterisk-Java

org.asteriskjava.fastagi
Interface AgiServer

All Known Implementing Classes:
DefaultAgiServer

public interface AgiServer

Listens for incoming AGI connections, reads the inital data and builds an AgiRequest that is then handed over to the appropriate AgiScript for processing.

Version:
$Id: AgiServer.java 938 2007-12-31 03:23:38Z srt $
Author:
srt
See Also:
AgiServerThread

Method Summary
 void shutdown()
          Stops this AgiServer.
 void startup()
          Starts this AgiServer.
 

Method Detail

startup

void startup()
             throws java.io.IOException,
                    java.lang.IllegalStateException
Starts this AgiServer.

After calling startup() this AgiServer is ready to receive requests from Asterisk servers and process them.

Note that this method will not return until the AgiServer has been shut down. If you want to run the AgiServer in the background use wrap it with an AgiServerThread.

Throws:
java.io.IOException - if the server socket cannot be bound.
java.lang.IllegalStateException - if this AgiServer is already running.

shutdown

void shutdown()
              throws java.lang.IllegalStateException
Stops this AgiServer.

The server socket is closed, new connections are refused and resources are freed. Any running AgiScripts are finish before shutdown completes.

Throws:
java.lang.IllegalStateException - if this AgiServer is already shut down or has not yet been started.

Asterisk-Java

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