public interface AgiServer
AgiRequest that is then handed over to the appropriate
AgiScript for processing.To pass a call from Asterisk to the AGI server add an extension to your dialplan that makes use of the AGI() application. For example:
exten => 5551212,1,AGI(agi://192.168.0.2/GetCallerRecord)Before Asterisk-Java returns control to the dialplan it sets the channel variable
AJ_AGISTATUS to one of the following
values:
NOT_FOUND if no AGI script had been configured to
handle the request.
SUCCESS if the AGI script was executed successfully.
FAILED if the AGI script terminated abnormally by
throwing an exception or there was an internal error processing it.
AJ_AGISTATUS variable is not set.
The AJ_AGISTATUS variable complements the AGISTATUS
variable that is set by Asterisk to SUCCESS, FAILURE
or HANGUP and is available since Asterisk 1.4.
AgiServerThread| Modifier and Type | Method and Description |
|---|---|
void |
setSocketReadTimeout(int socketReadTimeout)
Connection is dropped if it stales on read longer than the timeout.
|
void |
shutdown()
Stops this AgiServer.
|
void |
startup()
Starts this AgiServer.
|
void startup()
throws IOException,
IllegalStateException
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.
IOException - if the server socket cannot be bound.IllegalStateException - if this AgiServer is already running.void shutdown()
throws IllegalStateException
The server socket is closed, new connections are refused and resources
are freed. Any running AgiScripts are finish before shutdown
completes.
IllegalStateException - if this AgiServer is already shut down or
has not yet been started.void setSocketReadTimeout(int socketReadTimeout)
socketReadTimeout - the read timeout value to be used in
milliseconds.Socket.setSoTimeout(int)Copyright © 2004–2021. All rights reserved.