public class AsyncAgiEvent extends ResponseEvent
AgiAction
has finished.res/res_agi.c
.
AgiAction
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
SUB_EVENT_END |
static String |
SUB_EVENT_EXEC |
static String |
SUB_EVENT_START |
actionId
callerIdName, callerIdNum, channelState, channelStateDesc, connectedLineName, connectedLineNum, context, exten, priority
source
Constructor and Description |
---|
AsyncAgiEvent(Object source)
Creates a new AsyncAgiEvent.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
decodeEnv()
Decodes the AGI environment and returns a list of lines.
|
List<String> |
decodeResult()
Decodes the result.
|
String |
getChannel()
Returns the name of the channel this event occurred on.
|
String |
getCommandId()
Returns the command id of the corresponding
AgiAction . |
String |
getEnv()
Returns the raw AGI environment similar to the AGI request for FastAGI.
|
String |
getResult()
Returns the raw result of a command execution in response to the corresponding
AgiAction . |
String |
getSubEvent()
Returns the sub event type.
|
String |
getUniqueId() |
boolean |
isEnd()
Checks is this an end sub event.
|
boolean |
isExec()
Checks is this an exec sub event.
|
boolean |
isStart()
Checks is this a start sub event.
|
protected boolean |
isSubEvent(String subEvent) |
void |
setChannel(String channel)
Sets the name of the channel this event occurred on.
|
void |
setCommandId(String commandId)
Sets the command id.
|
void |
setEnv(String env)
Sets the AGI environment.
|
void |
setResult(String result)
Sets the raw result.
|
void |
setSubEvent(String subEvent)
Sets the sub event type.
|
void |
setUniqueId(String uniqueId) |
getActionId, getInternalActionId, setActionId, setInternalActionId
appendPropertyIfNotNull, getCallerIdName, getCallerIdNum, getChannelState, getChannelStateDesc, getConnectedLineName, getConnectedLineNum, getContext, getDateReceived, getExten, getFile, getFunc, getLine, getPriority, getPrivilege, getSequenceNumber, getServer, getSystemName, getTimestamp, setCallerIdName, setCallerIdNum, setChannelState, setChannelStateDesc, setConnectedLineName, setConnectedLineNum, setContext, setDateReceived, setExten, setFile, setFunc, setLine, setPriority, setPrivilege, setSequenceNumber, setServer, setSystemName, setTimestamp, toString
getSource
public static final String SUB_EVENT_START
public static final String SUB_EVENT_EXEC
public static final String SUB_EVENT_END
public AsyncAgiEvent(Object source)
source
- public String getUniqueId()
public void setUniqueId(String uniqueId)
public String getChannel()
public void setChannel(String channel)
channel
- the name of the channel this event occurred on.public String getSubEvent()
public void setSubEvent(String subEvent)
subEvent
- the sub event type.public String getCommandId()
AgiAction
.This property is only available for the "Exec" sub event.
AgiAction.setCommandId(String)
public void setCommandId(String commandId)
commandId
- the command id.public String getResult()
AgiAction
.This property is only available for the "Exec" sub event.
The result is URL encoded and ends with a newline ("\n").
Example:
200%20result%3d0
public void setResult(String result)
result
- the URL encoded result.public String getEnv()
This property is only available for the "Start" sub event.
The environment is passed in multiple lines (separated by "\n"). Each line is URL encoded and contains a key and a value. The environment ends with two newline characters ("\n\n").
Example:
... agi_channel%3a%20IAX2%2fpbx0-1 agi_language%3a%20de agi_type%3a%20IAX2 agi_uniqueid%3a%201201838738.19 agi_version%3a%201.6.0-beta1 ...
public void setEnv(String env)
env
- the URL encoded AGI environment.public boolean isStart()
true
if this is a "Start" sub event, false
otherwise.public boolean isExec()
true
if this is an "Exec" sub event, false
otherwise.public boolean isEnd()
true
if this is an "End" sub event, false
otherwise.protected boolean isSubEvent(String subEvent)
Copyright © 2004–2020. All rights reserved.