<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">---------- Forwarded message ----------<br>From: "Alexander Lopez" <<a href="mailto:Alex.Lopez@OpSys.com">
Alex.Lopez@OpSys.com</a>><br>To: "Asterisk Users Mailing List - Non-Commercial Discussion" <<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>><br>Date: Sat, 14 Oct 2006 13:04:08 -0400
<br>Subject: RE: [asterisk-users] Re: Generate Random Numbers in dialplan<br>Use the AGI I sent. It looks like the email did not put a <CR><br>correctly.<br><br>Run it from the commandline and see if you get output.
</blockquote><div><br>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. <br><br>from<tt><tt> -5'` to -5`<br><br>
</tt></tt>See corrected script below.<br><br><br></div>#!/bin/sh<br><br>RANDNUM=`echo $RANDOM$RANDOM | cut -c1-5`<br><br>echo "SET VARIABLE asteriskrandom $RANDNUM \"\"\n"<br><br></div>