1) console: Wiki says you need two args -- freeswitch.consoleLog("info", "lua rocks\n"); 2) lua does typing, and the callerID will be a string. So you want to do: if (callerID == "1234567890") then -Avi On Tue, Dec 10, 2013 at 6:14 PM, Joli Martinez <mrjoli021@gmail.com> wrote:
Hello,
I am writing a Lua script that will get the callerId info. I need 1 to be able to get the callerID and also to print any messages to the FS_CLI for debugging purpose. By itself the session:execute does transfer to the correct conference, but it does not work with the callerID. And the consoleLog doesnt work it give me an error on the screen.
#!/usr/bin/lua
session:answer();
callerID = session:getVariable("caller_id_number");
freeswitch.consoleLog("Hello World"); --session:execute("conference","4567"); --while (session:ready() == true) do --session:setAutoHangup(false);
if (callerID == 1234567890) then session:execute("conference","4567"); --else -- session:execute("transfer","7890"); end -- end
_________________________________________________________________________ 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
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