Thats a very good question, let me show you how you can do it.

session:answer();
session:streamFile("blah.wav");
op='+'
if op == "+" then
r = a + b
session:streamFile("finally-I-did-this.wav"); 
elseif op == "-" then
r = a - b
session:streamFile("It-was-vry-difficult.wav");  
elseif op == "*" then
r = a*b
session:streamFile("just-kidding.wav");  
elseif op == "/" then
r = a/b
session:streamFile("only-took-5-hrs-for-this.wav");  
else
error("invalid operation")
end
session:hangup();


But whatever you want to do if it requires you to include some header/library on top don't forget to add it. 


Regards,
Sammy Go.


On Tue, May 29, 2012 at 2:38 PM, Samira Mh <saami_mh@ymail.com> wrote:
i have created the file named "helloworld.lua" like this:
session:answer();
session:streamFile("blah.wav");
session:hangup();
and it working correctly,
**now i want to use lua command -not freeswitch command -in lua 
for example run:

op='+'
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
but how can do that?
thanks alot

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org