<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>hi&nbsp;</span><span style="font-family: Arial; font-size: 13px; ">Avi,</span></div><div><span style="font-family: Arial; font-size: 13px; ">thanks so much,solved problem...</span></div><div><br></div>  <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Avi Marcus &lt;avi@avimarcus.net&gt;<br> <b><span style="font-weight: bold;">To:</span></b> FreeSWITCH Users Help &lt;freeswitch-users@lists.freeswitch.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, May 31, 2012 10:45 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Freeswitch-users]
 how to take the result of running lua script on dialplan of freeswitch?<br> </font> </div> <br>
<div id="yiv213520592"><div dir="ltr">Set a channel variable in Lua:&nbsp;<div>http://wiki.freeswitch.org/wiki/Lua#session:setVariable<br clear="all"><div dir="ltr"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; "><span style="font-size:small;"><br>

</span></span></div><div dir="ltr"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; "><span style="font-size:small;">-Avi</span></span></div>
<br><br><div class="yiv213520592gmail_quote">On Thu, May 31, 2012 at 7:59 AM, Samira Mh <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:saami_mh@ymail.com" target="_blank" href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>&gt;</span> wrote:<br><blockquote class="yiv213520592gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size:12pt;">hi guys,</div><div><div><span style="">&lt;include&gt;</span></div>

<div><span style="">&nbsp;&lt;extension name="welcome_ivr"&gt;</span></div><div><span style="">&nbsp; &lt;condition field="destination_number" expression="^samira$"&gt;</span></div>

<div><span style="">&nbsp; &nbsp;&lt;action application="lua" data="welcome.lua"/&gt;</span></div><div><span style="">&nbsp; &lt;/condition&gt;</span></div>

<div><span style="">&nbsp;&lt;/extension&gt;</span></div><div><span style="">&lt;/include&gt;</span></div>

<div style="font-size:12pt;"><br></div></div><div style="font-size:12pt;">i have created lua script like this:</div>

<div><div><span style="">/usr/local/freeswitch/script/</span><span style="">welcome.lua</span></div>

<div><span style=""><br></span></div><div><span style="">#!/usr/bin/lua</span></div>
<div>
<span style=""><br></span></div><div><span style="">local sf = string.format</span></div>

<div><span style=""><br></span></div><div><span style="">function binary_op(a, b, callback)</span></div>

<div><span style="">&nbsp; &nbsp; &nbsp; &nbsp; return callback(a, b);</span></div><div><span style="">end</span></div>

<div><span style=""><br></span></div><div><span style="">function &nbsp;plus(a, b) return a + b end</span></div>

<div><span style="">function &nbsp;minus(a, b) return a - b end</span></div><div><span style="">function &nbsp;times(a, b)
 return a * b end</span></div><div><span style=""><br></span></div><div><span style="">print(sf("Plus : %d", binary_op(5, 5, plus)));</span></div>

<div><span style="">print(sf("Minus: %d", binary_op(5, 5, minus)));</span></div><div><span style="">print(sf("Times: %d", binary_op(5, 5, times)));</span></div>

<div style="font-size:12pt;"><br></div><div style="font-size:12pt;">the result of running that is 3 number,</div>

<div style="font-size:12pt;">but how can i get the 3 number in dialplan of &nbsp;freeswitch so that use the result of this number on it
 ?</div><div style="font-size:12pt;">thanks so much</div><div style="font-size:12pt;">

<br></div></div></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a rel="nofollow" ymailto="mailto:consulting@freeswitch.org" target="_blank" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
http://www.freeswitchsolutions.com<br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
http://www.cudatel.com<br>
<br>
Official FreeSWITCH Sites<br>
http://www.freeswitch.org<br>
http://wiki.freeswitch.org<br>
http://www.cluecon.com<br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a rel="nofollow" ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>
UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>
</div><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br><a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org"
 href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><br><br> </div> </div>  </div></body></html>