From: SamyGo <govoiper@gmail.com>
To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org>
Sent: Tuesday, May 29, 2012 2:24 PM
Subject: Re: [Freeswitch-users] how to run Lua commands in freeswitch?
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.
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")
endbut 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
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.orghttp://www.freeswitchsolutions.comFreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.comOfficial FreeSWITCH Sites
http://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.comJoin Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-usersUNSUBSCRIBE:
http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org