[asterisk-users] Generate Random Numbers in dialplan

Alexander Lopez Alex.Lopez at OpSys.com
Fri Oct 13 20:14:28 MST 2006


You may need to wrap it in an AGI.

Like so:
Createrandnum.agi:

#!/bin/sh
RANDNUM=`echo $RANDOM$RANDOM | cut -c1-5'` echo "SET VARIABLE
asteriskrandom $RANDNUM \"\"\n"

Call it with:

Exten => s,1,AGI(createrandom)


your should then have the variable ${ASTERISKRANDOM} in your channel

snip..


More information about the asterisk-users mailing list