Click or drag to resize
CommandResponse Class
Corresponds to a CommandAction.
Asterisk's handling of the command action is generelly quite hairy. It sends a "Response: Follows" line followed by the raw output of the command including empty lines. At the end of the command output a line containing "--END COMMAND--" is sent. The reader parses this response into a CommandResponse object to hide these details.
Inheritance Hierarchy

Namespace: AsterNET.Manager.Response
Assembly: AsterNET (in AsterNET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class CommandResponse : ManagerResponse

The CommandResponse type exposes the following members.

Constructors
  NameDescription
Public methodCommandResponse
Initializes a new instance of the CommandResponse class
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAttribute
Returns the value of the attribute with the given key.
This is particulary important when a response contains special attributes that are dependent on the action that has been sent.
An example of this is the response to the GetVarAction. It contains the value of the channel variable as an attribute stored under the key of the variable name.
Example:
                    GetVarAction action = new GetVarAction();
                    action.setChannel("SIP/1310-22c3");
                    action.setVariable("ALERT_INFO");
                    ManagerResponse response = connection.SendAction(action);
                    String alertInfo = response.getAttribute("ALERT_INFO");
                
As all attributes are internally stored in lower case the key is automatically converted to lower case before lookup.
(Inherited from ManagerResponse.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsSuccess
Return true if Response is success
(Inherited from ManagerResponse.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodParse
Unknown properties parser
(Inherited from ManagerResponse.)
Public methodParseSpecial
Unknown properties parser
(Inherited from ManagerResponse.)
Public methodToString (Inherited from ManagerResponse.)
Top
Fields
  NameDescription
Protected fieldattributes (Inherited from ManagerResponse.)
Protected fieldresult
Top
Properties
  NameDescription
Public propertyActionId
Get/Set the action id received with this response referencing the action that generated this response.
(Inherited from ManagerResponse.)
Public propertyAttributes
Store all unknown (without setter) keys from manager event.
Use in default Parse method Parse(String, String).
(Inherited from ManagerResponse.)
Public propertyDateReceived
Get/Set the point in time this response was received from the asterisk server.
(Inherited from ManagerResponse.)
Public propertyMessage
Get/Set the message received with this response.
The content depends on the action that generated this response.
(Inherited from ManagerResponse.)
Public propertyPrivilege
Get/Set the AMI authorization class of this event.
This is one or more of system, call, log, verbose, command, agent or user. Multiple privileges are separated by comma.
Note: This property is not available from Asterisk 1.0 servers.
(Inherited from ManagerResponse.)
Public propertyResponse
Get/Set the value of the "Response:" line.
This typically a String like "Success" or "Error" but depends on the action that generated this response.
(Inherited from ManagerResponse.)
Public propertyResult
Get/Set a List containing strings representing the lines returned by the CLI command.
Public propertyServer
Specify a server to which to send your commands (x.x.x.x or hostname).
This should match the server name specified in your config file's "host" entry. If you do not specify a server, the proxy will pick the first one it finds -- fine in single-server configurations.
(Inherited from ManagerResponse.)
Public propertyUniqueId
Get/Set the unique id received with this response.
The unique id is used to keep track of channels created by the action sent, for example an OriginateAction.
(Inherited from ManagerResponse.)
Top
See Also