<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>We are running on Debian Jessie.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Srigo</div><div><br>On 24 Jan 2017, at 14:36, Chris Young &lt;<a href="mailto:Chris.Young@enghouse.com">Chris.Young@enghouse.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
@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:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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]-->


<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">It's very strange. Anyway, thank you for trying and for confirming my dialplan.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Out of interest, which platform are you running FreeSWITCH on?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>KSrigo<br>
<b>Sent:</b> 24 January 2017 13:26<br>
<b>To:</b> FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
<b>Subject:</b> Re: [Freeswitch-users] Random number generation<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">Then I have no idea why it’s not working for you. I even tried your dialplan its working fine:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Dialplan:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">&lt;!--TEST START--&gt;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">&lt;extension</span><span style="font-family:Courier;color:#00A500"> name="call_duration" continue="true"</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;condition</span><span style="font-family:Courier;color:#00A500"> field="destination_number" expression="^call_duration$" break="never"</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="set" data="call_length=${expr(randomize(</span><span style="font-family:Courier;color:#B12512">&amp;x);</span><span style="font-family:Courier;color:#00A500">ceil(random(29999,45000,&amp;x)))}"
 inline="true"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="log" data="INFO Random value is ${call_length}"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;/condition&gt;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">&lt;/extension&gt;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">&lt;extension</span><span style="font-family:Courier;color:#00A500"> name="transfer_request"</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;condition</span><span style="font-family:Courier;color:#00A500"> field="destination_number" expression="^\*(85)$"</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="pre_answer"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="answer"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="execute_extension" data="call_duration XML from-core"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="log" data="INFO Call from ${caller_id_number} to ${destination_number} will last for ${call_length}ms"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="execute_extension" data="call_duration XML from-core"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="log" data="INFO Call from ${caller_id_number} to ${destination_number} will last for ${call_length}ms"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="sleep" data="${call_length}"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;action</span><span style="font-family:Courier;color:#00A500"> application="hangup" data="NORMAL_CLEARING"/</span><span style="font-family:Courier;color:#01A3AF">&gt;</span><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D">&nbsp; &nbsp; &nbsp; &nbsp;
</span><span style="font-family:Courier;color:#01A3AF">&lt;/condition&gt;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">&lt;/extension&gt;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#4C2F2D"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">&lt;!--TEST END--&gt;<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Output:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#00A500">2017-01-24 13:22:23.616006 [INFO] mod_dialplan_xml.c:637 Processing 33170567631 &lt;33170567631&gt;-&gt;call_duration in context from-core<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;unloop] continue=false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (PASS) [unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [unloop] ${sip_looped_call}() =~ /^true$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;outside_call] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Absolute Condition [outside_call]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action set(outside_call=true)&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action export(RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)})&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;call_duration] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (PASS) [call_duration] destination_number(call_duration) =~ /^call_duration$/ break=never<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action set(call_length=${expr(randomize(&amp;x);ceil(random(29999,45000,&amp;x)))}) INLINE<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> set(call_length=35719)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] mod_dptools.c:1519 SET
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> [call_length]=[35719]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action log(INFO Random value is ${call_length})&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;transfer_request] continue=false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [transfer_request] destination_number(call_duration) =~ /^\*(85)$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;call_debug] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [call_debug] ${call_debug}(false) =~ /^true$/ break=never<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;homer_X_cid] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (PASS) [homer_X_cid] destination_number(call_duration) =~ /.*/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action set(sip_h_X-CID=${sip_call_id})&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;Local_Extension] continue=false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [Local_Extension] destination_number(call_duration) =~ /^\*(85)$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute set(outside_call=true)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> set(outside_call=true)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] mod_dptools.c:1519 SET
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> [outside_call]=[true]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute export(RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)})<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> export(RFC2822_DATE=Tue, 24 Jan 2017 13:22:23 +0000)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [RFC2822_DATE]=[Tue, 24 Jan 2017 13:22:23 +0000]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute log(INFO Random value is ${call_length})<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> log(INFO Random value is 35719)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><b><span style="font-family:Courier;color:#00A500">2017-01-24 13:22:23.616006 [INFO] mod_dptools.c:1713 Random value is 35719</span></b><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute set(sip_h_X-CID=${sip_call_id})<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> set(sip_h_X-CID=313438353236343134333135383733-7sj1k4kl0i83)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] mod_dptools.c:1519 SET
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> [sip_h_X-CID]=[313438353236343134333135383733-7sj1k4kl0i83]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> log(INFO Call from 33170567631 to *85 will last for 35719ms)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#00A500">2017-01-24 13:22:23.616006 [INFO] mod_dptools.c:1713 Call from 33170567631 to *85 will last for 35719ms<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> execute_extension(call_duration XML from-core)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#00A500">2017-01-24 13:22:23.616006 [INFO] mod_dialplan_xml.c:637 Processing 33170567631 &lt;33170567631&gt;-&gt;call_duration in context from-core<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;unloop] continue=false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (PASS) [unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [unloop] ${sip_looped_call}() =~ /^true$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;outside_call] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Absolute Condition [outside_call]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action set(outside_call=true)&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action export(RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)})&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;call_duration] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (PASS) [call_duration] destination_number(call_duration) =~ /^call_duration$/ break=never<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action set(call_length=${expr(randomize(&amp;x);ceil(random(29999,45000,&amp;x)))}) INLINE<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> set(call_length=33576)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] mod_dptools.c:1519 SET
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> [call_length]=[33576]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action log(INFO Random value is ${call_length})&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;transfer_request] continue=false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [transfer_request] destination_number(call_duration) =~ /^\*(85)$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;call_debug] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [call_debug] ${call_debug}(false) =~ /^true$/ break=never<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;homer_X_cid] continue=true<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (PASS) [homer_X_cid] destination_number(call_duration) =~ /.*/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Action set(sip_h_X-CID=${sip_call_id})&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> parsing [from-core-&gt;Local_Extension] continue=false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">Dialplan:
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> Regex (FAIL) [Local_Extension] destination_number(call_duration) =~ /^\*(85)$/ break=on-false<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute set(outside_call=true)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> set(outside_call=true)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] mod_dptools.c:1519 SET
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> [outside_call]=[true]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute export(RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)})<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> export(RFC2822_DATE=Tue, 24 Jan 2017 13:22:23 +0000)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [RFC2822_DATE]=[Tue, 24 Jan 2017 13:22:23 +0000]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute log(INFO Random value is ${call_length})<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> log(INFO Random value is 33576)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><b><span style="font-family:Courier;color:#00A500">2017-01-24 13:22:23.616006 [INFO] mod_dptools.c:1713 Random value is 33576</span></b><span style="font-family:Courier;color:#00A500"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#01A3AF">2017-01-24 13:22:23.616006 [NOTICE] switch_core_session.c:2895 Execute set(sip_h_X-CID=${sip_call_id})<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> set(sip_h_X-CID=313438353236343134333135383733-7sj1k4kl0i83)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">2017-01-24 13:22:23.616006 [DEBUG] mod_dptools.c:1519 SET
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> [sip_h_X-CID]=[313438353236343134333135383733-7sj1k4kl0i83]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#969600">EXECUTE
<a href="mailto:sofia/core/33170567631@sip.v.ibrowse.com">sofia/core/33170567631@sip.v.ibrowse.com</a> log(INFO Call from 33170567631 to *85 will last for 33576ms)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:#DFDBC4"><span style="font-family:Courier;color:#00A500">2017-01-24 13:22:23.616006 [INFO] mod_dptools.c:1713 Call from 33170567631 to *85 will last for 33576ms<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">srigo<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jan 24, 2017, at 2:00 PM, Chris Young &lt;<a href="mailto:Chris.Young@enghouse.com">Chris.Young@enghouse.com</a>&gt; wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">I was running an older version of FreeSWITCH (1.5.15) but I've just retried with 1.6.14 and I still get the same behaviour. I am running on Windows in case that
 makes any difference.<span class="apple-converted-space">&nbsp;</span></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">Here is my dialplan. This server is part of a test environment and what I am trying to achieve is to have a variable call duration:</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&lt;include&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extension name="persistent_agent_leg"&gt;</span><o:p></o:p></p>
</div>
<div style="margin-left:36.0pt">
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&lt;condition field="destination_number" expression="^([78]\d{3})$"&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><o:p></o:p></p>
</div>
<div style="margin-left:72.0pt">
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&lt;action application="set" data="send_silence_when_idle=400"/&gt;</span><o:p></o:p></p>
</div>
<div style="margin-left:72.0pt">
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&lt;action application="pre_answer"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="answer"/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="park"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/extension&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extension name="call_duration" continue="true"&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field="destination_number" expression="^call_duration$" break="never"&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="set" data="call_length=${expr(randomize(&amp;x);ceil(random(29999,45000,&amp;x)))}" inline="true"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/extension&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extension name="transfer_request"&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field="destination_number" expression="^([45]\d{3})$"&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="pre_answer"/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="answer"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="execute_extension" data="call_duration XML default"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="log" data="INFO Call from ${caller_id_number} to ${destination_number} will last for ${call_length}ms"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="sleep" data="${call_length}"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="hangup" data="NORMAL_CLEARING"/&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/extension&gt;&nbsp;&nbsp;&nbsp;&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&lt;/include&gt;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-top:6.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#5B9BD5">&nbsp;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span class="apple-converted-space"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>
 [<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>]<span class="apple-converted-space">&nbsp;</span><b>On Behalf Of<span class="apple-converted-space">&nbsp;</span></b>KSrigo<br>
<b>Sent:</b><span class="apple-converted-space">&nbsp;</span>24 January 2017 10:37<br>
<b>To:</b><span class="apple-converted-space">&nbsp;</span>FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
<b>Subject:</b><span class="apple-converted-space">&nbsp;</span>Re: [Freeswitch-users] Random number generation</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Yes “from-core" was my context for the test. You have to update according your config. Could you tell me your freeswitch version?<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Mine is:&nbsp;FreeSWITCH Version 1.6.8-15-99de0ad~64bit. The config I gave you works fine on it.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Could you post your dialplan ?<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Here is the whole dial plan I used for the test:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&lt;include&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &lt;context name="from-core"&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;extension name="random_number_gen" continue="true"&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &lt;condition field="destination_number" expression="^random_number_gen$" break="never"&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- generate random number between 1 and 100 --&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="set" data="rand_val=${expr(randomize(&amp;x);ceil(random(0,100,&amp;x)))}" inline="true"/&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="log" data="INFO Random value is ${rand_val}"/&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &lt;/condition&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;/extension&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;extension name="Local_Extension"&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &lt;condition field="destination_number" expression="^\*(85)$"&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--test 1--&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="execute_extension" data="random_number_gen XML from-core"/&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--test 2--&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="execute_extension" data="random_number_gen XML from-core"/&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="hangup"/&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &lt;/condition&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;/extension&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp; &lt;/context&gt;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&lt;include&gt;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Srigo<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">On Jan 24, 2017, at 10:52 AM, Chris Young &lt;<a href="mailto:Chris.Young@enghouse.com"><span style="color:purple">Chris.Young@enghouse.com</span></a>&gt; wrote:<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">Hi Srigo,</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">Thanks for your help. Unfortunately, I still see the same value getting generated each time the extension gets executed e.g.</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 51a7a226-27e6-4fe3-979b-0b0bb28253d9 2017-01-24 09:49:21.504783 [INFO] mod_dptools.c:1628 Random value is 1</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">70aae2dc-cee6-4a3c-805f-5655abd7e6e6 2017-01-24 09:49:21.965642 [INFO] mod_dptools.c:1628 Random value is 1</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">92e81c00-0ff0-4ddc-819f-019c145f39be 2017-01-24 09:49:22.444287 [INFO] mod_dptools.c:1628 Random value is 1</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">I take it that from-core is some context you've defined in your environment rather than anything special, as it didn't work when I used that (so I changed it
 to 'default')?</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">Regards,</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">Chris</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
</div>
</div>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<div>
<div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span class="apple-converted-space"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org"><span style="color:purple">freeswitch-users-bounces@lists.freeswitch.org</span></a><span class="apple-converted-space">&nbsp;</span>[<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org"><span style="color:purple">mailto:freeswitch-users-bounces@lists.freeswitch.org</span></a>]<span class="apple-converted-space">&nbsp;</span><b>On
 Behalf Of<span class="apple-converted-space">&nbsp;</span></b>KSrigo<br>
<b>Sent:</b><span class="apple-converted-space">&nbsp;</span>24 January 2017 09:14<br>
<b>To:</b><span class="apple-converted-space">&nbsp;</span>FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org"><span style="color:purple">freeswitch-users@lists.freeswitch.org</span></a>&gt;<br>
<b>Subject:</b><span class="apple-converted-space">&nbsp;</span>Re: [Freeswitch-users] Random number generation</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Hi Chris,<o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">I’m not sure if I understood exactly your needs. This is how I use randomize function:<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Define Random Number Generator extension:<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">&lt;extension name="random_number_gen" continue="true"&gt;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp; &lt;condition field="destination_number" expression="^random_number_gen$" break="never"&gt;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;!-- generate random number between 1 and 100 --&gt;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;action application="set" data="rand_val=${expr(randomize(&amp;x);ceil(random(0,100,&amp;x)))}" inline="true"/&gt;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;action application="log" data="INFO Random value is ${rand_val}"/&gt;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp; &lt;/condition&gt;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&lt;/extension&gt;<o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">then call it in your diaplan each time you need to get a random number set:<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">&lt;action application="execute_extension" data="random_number_gen XML from-core"/&gt;<o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Srigo<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal">On Jan 24, 2017, at 9:51 AM, Chris Young &lt;<a href="mailto:Chris.Young@enghouse.com"><span style="color:purple">Chris.Young@enghouse.com</span></a>&gt; wrote:<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">Hello all,</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">On the wiki, there is an example of using mod_expr to generate a random number:</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- generate random number between 1 and 100 --&gt;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="set" data="rand_val=${expr(randomize(&amp;x);ceil(random(0,100,&amp;x)))}"/&gt;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="log" data="INFO Random value is ${rand_val}"/&gt;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">This works well the first time but if the same dialplan instructions are executed subsequently, the same number is produced each time.</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">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?</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">Many thanks,</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">Chris</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:#00559A">Chris&nbsp;Young</span><span class="apple-converted-space"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><br>
<span style="color:dodgerblue">Software Engineer</span><span style="color:#00A0DC"><br>
&lt;image001.png&gt;<br>
</span><span style="color:#00559A">t:</span>&nbsp;&nbsp;<span style="color:dodgerblue">+44 118 943 9249</span><span style="color:#00559A"><br>
e:</span>&nbsp;<span class="apple-converted-space">&nbsp;</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 class="apple-converted-space">&nbsp;</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>
&lt;image002.png&gt;</span></span><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-top:6.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#A6A6A6">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><o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif">_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<span class="apple-converted-space">&nbsp;</span><br>
</span><a href="mailto:consulting@freeswitch.org"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">consulting@freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.freeswitchsolutions.com/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">http://www.freeswitchsolutions.com</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
<br>
Official FreeSWITCH Sites<br>
</span><a href="http://www.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">http://www.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://confluence.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">http://confluence.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.cluecon.com/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">http://www.cluecon.com</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
<br>
FreeSWITCH-users mailing list<br>
</span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">FreeSWITCH-users@lists.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
UNSUBSCRIBE:http://</span><a href="http://lists.freeswitch.org/mailman/options/freeswitch-users"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">lists.freeswitch.org/mailman/options/freeswitch-users</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#954F72">http://www.freeswitch.org</span></a><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif">_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<span class="apple-converted-space">&nbsp;</span><br>
</span><a href="mailto:consulting@freeswitch.org"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">consulting@freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.freeswitchsolutions.com/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.freeswitchsolutions.com</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
<br>
Official FreeSWITCH Sites<br>
</span><a href="http://www.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://confluence.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://confluence.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.cluecon.com/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.cluecon.com</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
<br>
FreeSWITCH-users mailing list<br>
</span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">FreeSWITCH-users@lists.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
UNSUBSCRIBE:http://</span><a href="http://lists.freeswitch.org/mailman/options/freeswitch-users"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">lists.freeswitch.org/mailman/options/freeswitch-users</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.freeswitch.org</span></a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif">_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<span class="apple-converted-space">&nbsp;</span><br>
</span><a href="mailto:consulting@freeswitch.org"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">consulting@freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.freeswitchsolutions.com/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.freeswitchsolutions.com</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
<br>
Official FreeSWITCH Sites<br>
</span><a href="http://www.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://confluence.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://confluence.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.cluecon.com/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.cluecon.com</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
<br>
FreeSWITCH-users mailing list<br>
</span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">FreeSWITCH-users@lists.freeswitch.org</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
UNSUBSCRIBE:http://</span><a href="http://lists.freeswitch.org/mailman/options/freeswitch-users"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">lists.freeswitch.org/mailman/options/freeswitch-users</span></a><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif"><br>
</span><a href="http://www.freeswitch.org/"><span style="font-size:9.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:purple">http://www.freeswitch.org</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>


</div></blockquote><blockquote type="cite"><div><span>_________________________________________________________________________</span><br><span>Professional FreeSWITCH Consulting Services: </span><br><span><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a></span><br><span><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a></span><br><span></span><br><span>Official FreeSWITCH Sites</span><br><span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span><br><span><a href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a></span><br><span><a href="http://www.cluecon.com">http://www.cluecon.com</a></span><br><span></span><br><span>FreeSWITCH-users mailing list</span><br><span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a></span><br><span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br><span>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br><span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span></div></blockquote></body></html>