<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:EN-GB;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On the wiki, there is an example of using mod_expr to generate a random number:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> <!-- generate random number between 1 and 100 --><o:p></o:p></p>
<p class="MsoNormal"> <action application="set" data="rand_val=${expr(randomize(&x);ceil(random(0,100,&x)))}"/><o:p></o:p></p>
<p class="MsoNormal"> <action application="log" data="INFO Random value is ${rand_val}"/><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This works well the first time but if the same dialplan instructions are executed subsequently, the same number is produced each time.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is this by design? Is there any other way to seed the random number generator so it will produce different results, as randomize() doesn't seem to be doing quite what I thought it would?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Many thanks,<o:p></o:p></p>
<p class="MsoNormal">Chris<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:13.5pt;color:#00559A;mso-fareast-language:EN-GB">Chris Young</span><span style="mso-fareast-language:EN-GB">
<br>
<span style="color:dodgerblue">Software Engineer</span><span style="color:#00A0DC"><br>
<img width="497" height="18" style="width:5.177in;height:.1875in" id="IMG1" src="cid:image001.png@01D2761F.02E9B4A0" alt="cid:image7482a0.PNG@dc00f514.4fb88205"><br>
</span><span style="color:#00559A">t:</span> <span style="color:dodgerblue">+44 118 943 9249</span><span style="color:#00559A"><br>
e:</span> <span style="color:dodgerblue"><a href="mailto:chris.young@enghouse.com"><span style="color:#0563C1">chris.young@enghouse.com</span></a></span><span style="color:#00559A"><br>
w:</span> <span style="color:dodgerblue"><a href="http://www.enghouseinteractive.co.uk" title="Enghouse Interactive"><span style="color:dodgerblue">www.enghouseinteractive.co.uk</span></a></span><span style="color:#00B0F0"><br>
<img border="0" width="497" height="106" style="width:5.177in;height:1.1041in" id="Picture_x0020_2" src="cid:image002.png@01D2761F.02E9B4A0" alt="cid:image6c1ba6.PNG@b8963a35.449174f5"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-top:6.0pt"><span style="color:#A6A6A6;mso-fareast-language:EN-GB">Enghouse Interactive (UK) Ltd is a company registered in England and Wales. Registered number: 04230977. Registered office: Imperium, Imperial Way, Reading,
Berkshire, RG2 0TD</span><span style="color:#5B9BD5;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>