I had assumed every incoming call was on its own thread and that each had its own lua instance. Is there a global lock happening here? Below is the runCommand call and the two start and stop methods that are getting called in my script when the call begins and ends (notice they even talk to different hosts, so its not the web server hanging). I have put in debugging statements and its definitely hanging trying to call io.popen and not on the f:read. I noticed on the mod_python page (http://wiki.freeswitch.org/wiki/Mod_python#Known_Bugs) that it had read issues that were fixed in 12958, could this be related? I'm on svn trunk version 16272 on 32bit debian etch.
function runCommand(command)
local f = io.popen(command) -- runs command
local l = f:read("*a") -- read output of command
f:close()
return l
end
function notifyStart(id)
local url = "http://host1/start?id=" .. id
local wget = "/usr/bin/wget " .. url local out = runCommand(wget)
return out;
end
function notifyStop(id)
local url = "http://host2/start?id=" .. id
local wget = "/usr/bin/wget " .. url local out = runCommand(wget)
return out;
end