login | register
Fri 10 of Oct, 2008 [23:25 UTC]

voip-info.org

Discuss [0] History

Asterisk cmd Random

Created by: Corydon76,Last modification on Fri 12 of Oct, 2007 [12:13 UTC] by chandave

Synopsis

 Random goto

Description

 Random(probability:label)

Based upon a probability of 1-100 (percentage likeliness), goto the label specified. A probability of 1 will take the branch about 1% of the time; 5, 5%, 10, 10%, etc. A probability of 100 (or above) will always branch and is equivalent to Goto(label). A label is a a) priority, but it can also be b) an extension plus priority, or c) a context plus extension plus priority.

Example

  ; Monitors a call 10% of the time
  exten => s,1,Random(90:s,3)
  exten => s,2,Monitor(gsm,/var/spool/asterisk/monitor/${EXTEN}-${TIMESTAMP},m)
  exten => s,3,Dial(SIP/8000)


See also



Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Comments