Asterisk-Java

org.asteriskjava.manager.action
Class AgiAction

java.lang.Object
  extended by org.asteriskjava.manager.action.AbstractManagerAction
      extended by org.asteriskjava.manager.action.AgiAction
All Implemented Interfaces:
java.io.Serializable, EventGeneratingAction, ManagerAction

public class AgiAction
extends AbstractManagerAction
implements EventGeneratingAction

Add a new AGI command to execute by the Async AGI application.

It will append the application to the specified channel's queue. If the channel is not inside Async AGI application it will return an error.

It is implemented in res/res_agi.c

Available since Asterisk 1.6

Since:
1.0.0
Version:
$Id: AgiAction.java 1169 2008-09-18 07:06:52Z srt $
Author:
srt
See Also:
AsyncAgiEvent, Serialized Form

Constructor Summary
AgiAction()
          Creates a new empty AgiAction.
AgiAction(java.lang.String channel, java.lang.String command)
          Creates a new AgiAction with channel and command.
AgiAction(java.lang.String channel, java.lang.String command, java.lang.String commandId)
          Creates a new AgiAction with channel, command and commandId.
 
Method Summary
 java.lang.String getAction()
          Returns the name of this action.
 java.lang.Class<? extends ResponseEvent> getActionCompleteEventClass()
          Returns the event type that indicates that Asterisk is finished sending response events for this action.
 java.lang.String getChannel()
          Returns the name of the channel to execute the AGI command on.
 java.lang.String getCommand()
          Returns the AGI command to execute.
 java.lang.String getCommandId()
          Returns the command id to track execution progress.
 void setChannel(java.lang.String channel)
          Sets the name of the channel to execute the AGI command on.
 void setCommand(java.lang.String command)
          Sets the AGI command to execute.
 void setCommandId(java.lang.String commandId)
          Sets the command id to track execution progress.
 
Methods inherited from class org.asteriskjava.manager.action.AbstractManagerAction
getActionId, setActionId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.asteriskjava.manager.action.ManagerAction
getActionId, setActionId
 

Constructor Detail

AgiAction

public AgiAction()
Creates a new empty AgiAction.


AgiAction

public AgiAction(java.lang.String channel,
                 java.lang.String command)
Creates a new AgiAction with channel and command.

Parameters:
channel - the name of the channel to execute the AGI command on.
command - the AGI command to execute.

AgiAction

public AgiAction(java.lang.String channel,
                 java.lang.String command,
                 java.lang.String commandId)
Creates a new AgiAction with channel, command and commandId.

Parameters:
channel - the name of the channel to execute the AGI command on.
command - the AGI command to execute.
commandId - the command id to track execution progress.
Method Detail

getAction

public java.lang.String getAction()
Returns the name of this action.

Specified by:
getAction in interface ManagerAction
Specified by:
getAction in class AbstractManagerAction

getActionCompleteEventClass

public java.lang.Class<? extends ResponseEvent> getActionCompleteEventClass()
Description copied from interface: EventGeneratingAction
Returns the event type that indicates that Asterisk is finished sending response events for this action.

Specified by:
getActionCompleteEventClass in interface EventGeneratingAction
Returns:
a Class that is an instance of ResponseEvent.
See Also:
ResponseEvent

getChannel

public java.lang.String getChannel()
Returns the name of the channel to execute the AGI command on.

Returns:
the name of the channel to execute the AGI command on.

setChannel

public void setChannel(java.lang.String channel)
Sets the name of the channel to execute the AGI command on.

The channel must be running the Async AGI application "AGI(agi:async)".

This property is required.

Parameters:
channel - the name of the channel to execute the AGI command on.

getCommand

public java.lang.String getCommand()
Returns the AGI command to execute.

Returns:
the AGI command to execute.

setCommand

public void setCommand(java.lang.String command)
Sets the AGI command to execute.

This property is required.

Parameters:
command - the AGI command to execute.

getCommandId

public java.lang.String getCommandId()
Returns the command id to track execution progress.

Returns:
the command id to track execution progress.

setCommandId

public void setCommandId(java.lang.String commandId)
Sets the command id to track execution progress.

This value will be sent back in the CommandID header of AsyncAGI exec event notifications.

Parameters:
commandId - the command id to track execution progress.

Asterisk-Java

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