<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:&nbsp;&quot;Alexander Lopez&quot; &lt;<a href="mailto:Alex.Lopez@OpSys.com">
Alex.Lopez@OpSys.com</a>&gt;<br>To:&nbsp;&quot;Asterisk Users Mailing List - Non-Commercial Discussion&quot; &lt;<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>&gt;<br>Date:&nbsp;Sat, 14 Oct 2006 13:04:08 -0400
<br>Subject:&nbsp;RE: [asterisk-users] Re: Generate Random Numbers in dialplan<br>Use the AGI I sent. It looks like the email did not put a &lt;CR&gt;<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 &quot;echo&quot;. You also have to remove the single quote inserted after the 5. <br><br>from<tt><tt> -5'` to&nbsp; -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 &quot;SET VARIABLE asteriskrandom $RANDNUM \&quot;\&quot;\n&quot;<br><br></div>