Use Freeswitch for mkdir (#3049)

This change reduces  the strain on the system by running the OS command through Freeswitch rather than directly from Lua. When running directly from Lua it causes RTP jitter in a high capacity system.
This commit is contained in:
konradSC
2018-05-04 13:32:36 -06:00
committed by FusionPBX
parent 676ae26f91
commit cfff4beb2b
@@ -1,6 +1,6 @@
--add the mkdir function --add the mkdir function
function mkdir(dir) function mkdir(dir)
api = freeswitch.API();
dir = dir:gsub([[\]], "/"); dir = dir:gsub([[\]], "/");
if (package.config:sub(1,1) == "/") then if (package.config:sub(1,1) == "/") then
--unix --unix
@@ -9,6 +9,7 @@
--windows --windows
cmd = [[mkdir "]] .. dir .. [["]]; cmd = [[mkdir "]] .. dir .. [["]];
end end
os.execute(cmd); -- os.execute(cmd);
api:executeString("system " .. cmd );
return cmd; return cmd;
end end