login | register
Tue 30 of Sep, 2008 [23:40 UTC]

voip-info.org

Asterisk cmd SetVar

Created by: oej,Last modification on Mon 17 of Oct, 2005 [21:38 UTC] by g

Synopsis

Set variable to value

Deprecated: This command will be considered obsolete starting in asterisk 1.2. Use Set instead.

Description

 Setvar(variablename=value)

Sets a variable variablename to value.
  • Note: Variable names are not case sensitive.

Example

 Setvar(numTries=4)

Using a variable is nice, because all channels get their own variable space, so there's no chance of collisions between different calls, and the variable is automatically trashed when the channel is hungup.

Try using the variable in your dialplan:

 Playback(${variablename})
 SayDigits(${variablename})

See also


Comments