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="Apple-tab-span" style="white-space:pre">        </span>r = a + b</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>session:streamFile("finally-I-did-this.wav"); </div>
<div>elseif op == "-" then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>r = a - b</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>session:streamFile("It-was-vry-difficult.wav"); </div>
<div>elseif op == "*" then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>r = a*b</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>session:streamFile("just-kidding.wav"); </div>
<div>elseif op == "/" then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>r = a/b</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>session:streamFile("only-took-5-hrs-for-this.wav"); </div>
<div>else</div><div><span class="Apple-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. </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-family:'times new roman','new york',times,serif;font-size:15px"><<a href="mailto:saami_mh@ymail.com" target="_blank">saami_mh@ymail.com</a>></span><font face="times new roman, new york, times, serif"><span style="font-size:15px"> wrote:</span></font></div>
<div class="gmail_quote"><blockquote class="gmail_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-family:'times new roman','new york',times,serif;font-size:12pt">and it working correctly,</div>
<div style="font-family:'times new roman','new york',times,serif;font-size:12pt">**now i want to use lua command -not freeswitch command -in lua </div><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">
for example run:</div><div style="font-family:'times new roman','new york',times,serif;font-size:12pt"><br></div><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">
op='+'</div><div style="font-family:'times new roman','new york',times,serif;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 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 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></blockquote></div><br></div>