[Freeswitch-users] memory leak

Benedikt Fraunhofer fraunhofer.lists.freeswitch-001 at traced.net
Fri Sep 4 07:32:53 PDT 2009


2009/9/4 Rupa Schomaker <rupa at rupa.com>:
> Worst offenders (leakers over 100K).  The last one is the worst (672M)
> -- looks like a lua script.  What are you doing in lua again?

i feel kinda dumb to double post, but here it is again :)

the setup is the same as in http://jira.freeswitch.org/browse/MODSOFIA-22

one is

-----

local reason = session:getVariable("originate_disposition");

session:setAutoHangup(false);


if(reason) then
   if(reason == "NO_ANSWER") then
 -- nothing
   end
   if(reason == "USER_BUSY") then
       -- nothing
   end
end

freeswitch.consoleLog(...

------
anotherone is
----
local sess = "nil";
if(argv[1]) then
   sess=argv[1];
end
freeswitch.consoleLog(...
api = freeswitch.API();
local res = api:execute("sched_api" ...
freeswitch.consoleLog(...

----

and the scheduled script does
---
function log(msg)
   freeswitch.consoleLog("notice", "c2c-hangup-timeout.lua: " .. msg .. "\n");
end


local sess = argv[1];
if(sess)
then
   freeswitch.consoleLog("INFO", "hangup-timeout.lua for uuid " ..
sess .. "\n");

   api = freeswitch.API();
   local stillValid = api:execute("uuid_getvar", sess .. "
Dummy-DoesChannelExists");
   if(stillValid:sub(1,4) == "-ERR")
   then
       log("session uuid " .. sess .. " disappeared (nothing bad)");
   else
       -- this is important!!! Otherwise the aleg get's just hung up!
       api:execute("uuid_media", sess);
       api:execute("uuid_transfer", sess .. " -both timeout");
   end
else -- /if(sess)
   log("called with nil session?");
end -- /if(sess)

---

at least there's no fancy db-connection-thingi which could make
debugging harder :)

Cheers
  Beni.




More information about the FreeSWITCH-users mailing list