[Freeswitch-users] Problem Verifying an existing file with lua

Thomas Hoellriegel admin at blindi.net
Mon Nov 7 02:51:14 MSK 2011


Hi Sammy,
I become no output true or false.
My Script is now:
function file_exists(fname)
local f = io.open(fname, "r")
if (f and f:read()) then return true end
end
if ( session:ready() ) then
session:answer( );
datei = session:getVariable("call_screen_filename");
if (file_exists(datei..extension.**.".wav")) then
session:setVariable("fileex", "true");
session:setVariable(fileex, true)
returns true;
else
session:setVariable("fileex", "false");
returns false;
end
end

The variable fileex is emty.
The variable:
call_screen_filename
will not be changed after to execute these script.

I like to setup a callscreening.
if the name exists, transfer to the given extension.
If the name don.t exists, start the recording and transwer the call.

Thanks.




---------------
Du kannst mich jederzeit kostenlos per Festnetz erreichen unter:
http://www.blindi.net/callback
homepage: http://www.blindi.net
blinde-misc mailingliste für blinde. anmeldung unter:
http://www.blindi.net/mailman/listinfo/blinde-misc


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list