Asterisk Manager API Action: GetVar
Action: Getvar
Parameters: Channel, Variable, ActionID
ActionID is an optional parameter for message matching.
Example :
SEND:
ACTION: GetVar
Channel: SIP/5060-44d225d0
Variable: extension
RECEIVE:
Response: Success
extension: 17065551419
RECEIVE ON ERROR:
Response: Error
Message: No such channel
RECEIVE IF CHAN, BUT NO VAR:
Response: Success
varname: (null)
NOTE : Will not work for built-in variables like LANGUAGE !
ATTENTION: ASTERISK RELEASE 1.2
In the version 1.2, the behavious has been changed for the following:
(the result is always in the “Value” field)
RECEIVE:
Response: Success
Value: 17065551419