[asterisk-users] Generate Random Numbers in dialplan

Jon Weisman jweisman at ibell.net
Fri Oct 13 21:16:49 MST 2006


keeps returning 0



----- Original Message ----- 
From: "Alexander Lopez" <Alex.Lopez at OpSys.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" 
<asterisk-users at lists.digium.com>
Sent: Friday, October 13, 2006 11:14 PM
Subject: RE: [asterisk-users] Generate Random Numbers in dialplan



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..
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users 




More information about the asterisk-users mailing list