login | register
Tue 02 of Dec, 2008 [13:22 UTC]

voip-info.org

Discuss [1] History

Asterisk func rand

Created by: murf,Last modification on Mon 29 of Jan, 2007 [14:50 UTC] by dayssincethedoor

Synopsis:

 Choose a random number in a range

Description:

 RAND(min,max)
 
Choose a random number between min and max.  Min defaults to 0, if not
specified, while max defaults to RAND_MAX (2147483647 on many systems).
 

Notes


  • *CLI> show function RAND

  • This functions is only availible in 1.4 and later.

Return value

Returns the resulting number.

Example

exten => s,1,Set(junky=${RAND(1,8)});
    - Sets junky to a random number between 1 and 8, inclusive.

See also



Comments

Comments Filter
222

333Version of Asterisk

by pjchilds, Tuesday 16 of May, 2006 [22:59:32 UTC]
This function is not currently in 1.2 SVN (or any released stable versions of asterisk as of 1.2.7.1).