Summary:ASTERISK-21178: Improve documentation for manager command Getvar, Setvar
Reporter:Rusty Newton (rnewton)Labels:
Date Opened:2013-02-27 14:58:27.000-0600Date Closed:2014-08-04 14:45:22
Status:Closed/CompleteComponents:Core/ManagerInterface Documentation
Versions: 11.2.1 Frequency of
Description:Manager help text for command "Getvar" needs additional clarification on whether and how it accepts expressions and function calls.

14:40 <ra21vi> newtonr: :) I am using GetVar in AGI, and it returns val already set
14:40 <ra21vi> in AMI do getvar process any expression before returning the result?
14:43 <newtonr> ra21vi: yeah it should
14:47 <newtonr> ra21vi: but not sure about AGI, I don't use it much
14:47 <coreyf1513> ra21vi: no, in AMI getvar does not accept an expression as input, it accepts a variable name or a function call, so SHA1(junk) works for getvar, not ${SHA1(junk)}
14:48 -!- nickfennell [~nickfenne@unaffiliated/nickfennell] has joined #asterisk
14:49 <coreyf1513> oops, looks like it does process expressions but it expects the result of those expressions to be a variable name or function call

Current text is:

Action: Getvar
[ActionID:] <value>
[Channel:] <value>
Variable: <value>

Gets a channel variable.

Get the value of a global or local channel variable.
NOTE: If a channel name is not provided then the variable is global.

   ActionID for this transaction. Will be returned.
   Channel to read variable from.
   Variable name.

[See Also]
Not available

Setvar needs the same.
Comments:By: Rusty Newton (rnewton) 2013-02-27 15:12:18.810-0600

I propose the description read something like:

Returns the value of a channel variable (global or local) or an expression where the
result of its evaluation is either a variable name or function call.

NOTE: If a channel name is not provided then the variable is global.

For Setvar, replace "Returns" with "Sets" ?

By: Rusty Newton (rnewton) 2014-07-25 09:21:15.845-0500