- exten => _X.,1,Set(sjs=${RAND(1,4)})
- exten => _X.,n,Noop(${sjs})
- ;取1-4之间的随机数字,后面打印出来
- 以下为官方的:
Asterisk func rand
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> core 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.
exten=>_x.,n,set(sjs=${RAND(0,9)},${RAND(0,9)},${RAND(0,9)})
exten=>_x.,n,NOOP(${sjs})
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。