Name
SetVar() — Sets a variable to the specified value
Synopsis
SetVar(n
=value
)
Sets the variable n
to the specified
value
. If the variable name is prefixed
with _
, single inheritance is
assumed. If the variable name is prefixed with _ _
, infinite inheritance is assumed.
Inheritance is used when you want the outgoing channel to inherit the
variable from the dialplan. Reprecated in favor of Set()
, which has the same syntax.
Variables set with this application are valid only in the
current channel. Use the SetGlobalVar()
application to set global
variables.
; set a variable called DIALTIME, then use it
exten => 123,1,SetVar(DIALTIME=20)
exten => 123,1,Dial(Zap/4/5551212,,${DIALTIME})
See Also
SetGlobalVar()
,
README.variables
Get Asterisk: The Future of Telephony now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.