[asterisk-users] Re: Generate Random Numbers in dialplan

Naija Man voip4naija at gmail.com
Sat Oct 14 16:57:17 MST 2006


>
> ---------- Forwarded message ----------
> From: "Alexander Lopez" <Alex.Lopez at OpSys.com>
> To: "Asterisk Users Mailing List - Non-Commercial Discussion" <
> asterisk-users at lists.digium.com>
> Date: Sat, 14 Oct 2006 13:04:08 -0400
> Subject: RE: [asterisk-users] Re: Generate Random Numbers in dialplan
> Use the AGI I sent. It looks like the email did not put a <CR>
> correctly.
>
> Run it from the commandline and see if you get output.


The AGI works ok for me. You have to insert a carriage return before the
second "echo". You also have to remove the single quote inserted after the
5.

from -5'` to  -5`

See corrected script below.


#!/bin/sh

RANDNUM=`echo $RANDOM$RANDOM | cut -c1-5`

echo "SET VARIABLE asteriskrandom $RANDNUM \"\"\n"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20061014/7858a665/attachment.htm


More information about the asterisk-users mailing list