<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>hi SamyGo,</span></div><div><span>thanks for your help,</span></div><div>it is kind of you to answer my questions,but i have one question again.</div><div>i am going to put the result of "select query" on the text file &nbsp;and insert the result in array &nbsp;on lua how can i do that ?</div><div>is it possible to use lua commands directly?</div><div>i know how to connect to database ,but i don't know how to put the select query result in array or text file and match the number i want on the array or text file?</div><div><span><br></span></div><div><span><br></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> SamyGo &lt;govoiper@gmail.com&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> Tuesday, May 29, 2012 2:24 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Freeswitch-users] how to run Lua commands in freeswitch?<br> </font> </div> <br>
<div id="yiv1270980062">Thats a very good question, let me show you how you can do it.<div><br><div><font face="courier new, monospace"><div>session:answer();</div><div>session:streamFile("blah.wav");</div><div>op='+'</div><div>
if op == "+" then</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>r = a + b</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>session:streamFile("finally-I-did-this.wav");&nbsp;</div>
<div>elseif op == "-" then</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>r = a - b</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>session:streamFile("It-was-vry-difficult.wav"); &nbsp;</div>
<div>elseif op == "*" then</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>r = a*b</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>session:streamFile("just-kidding.wav"); &nbsp;</div>
<div>elseif op == "/" then</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>r = a/b</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>session:streamFile("only-took-5-hrs-for-this.wav"); &nbsp;</div>
<div>else</div><div><span class="yiv1270980062Apple-tab-span" style="white-space:pre;">        </span>error("invalid operation")</div><div>end</div><div>session:hangup();</div><div><br></div><div><br></div></font></div><div><font face="times new roman, new york, times, serif"><span style="font-size:15px;">But whatever you want to do if it requires you to include some header/library on top don't forget to add it.&nbsp;</span></font></div>
<div><font face="times new roman, new york, times, serif"><span style="font-size:15px;"><br></span></font></div><div><font face="times new roman, new york, times, serif"><span style="font-size:15px;"><br></span></font></div>
<div><font face="times new roman, new york, times, serif"><span style="font-size:15px;">Regards,</span></font></div><div><font face="times new roman, new york, times, serif"><span style="font-size:15px;">Sammy Go.</span></font></div>
<div><font face="times new roman, new york, times, serif"><span style="font-size:15px;"><br></span></font></div><div><font face="times new roman, new york, times, serif"><span style="font-size:15px;"><br></span></font></div>
<div><font face="times new roman, new york, times, serif"><span style="font-size:15px;">On Tue, May 29, 2012 at 2:38 PM, Samira Mh </span></font><span dir="ltr" style="font-size:15px;">&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><font face="times new roman, new york, times, serif"><span style="font-size:15px;"> wrote:</span></font></div>
<div class="yiv1270980062gmail_quote"><blockquote class="yiv1270980062gmail_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><div><font face="'times new roman', 'new york', times, serif">i have created the file named "helloworld.lua" like this:</font></div>
<div><font face="'times new roman', 'new york', times, serif">session:answer();</font></div><div><font face="'times new roman', 'new york', times, serif">session:streamFile("blah.wav");</font></div>
<div><font face="'times new roman', 'new york', times, serif">session:hangup();</font></div><div style="font-size:12pt;">and it working correctly,</div>
<div style="font-size:12pt;">**now i want to use lua command -not freeswitch command -in lua&nbsp;</div><div style="font-size:12pt;">
for example run:</div><div style="font-size:12pt;"><br></div><div style="font-size:12pt;">
op='+'</div><div style="font-size:12pt;"><pre style="text-align:justify;">if op == "+" then
      r = a + b
    elseif op == "-" then
      r = a - b
    elseif op == "*" then
      r = a*b
    elseif op == "/" then
      r = a/b
    else
      error("invalid operation")
    end</pre><pre style="text-align:justify;">but how can do that?</pre><pre style="text-align:justify;">thanks alot</pre></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><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>