mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
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:
@@ -1,14 +1,15 @@
|
||||
|
||||
--add the mkdir function
|
||||
function mkdir(dir)
|
||||
dir = dir:gsub([[\]], "/");
|
||||
if (package.config:sub(1,1) == "/") then
|
||||
--unix
|
||||
cmd = [[mkdir -p "]] .. dir .. [["]];
|
||||
elseif (package.config:sub(1,1) == [[\]]) then
|
||||
--windows
|
||||
cmd = [[mkdir "]] .. dir .. [["]];
|
||||
end
|
||||
os.execute(cmd);
|
||||
return cmd;
|
||||
end
|
||||
function mkdir(dir)
|
||||
api = freeswitch.API();
|
||||
dir = dir:gsub([[\]], "/");
|
||||
if (package.config:sub(1,1) == "/") then
|
||||
--unix
|
||||
cmd = [[mkdir -p "]] .. dir .. [["]];
|
||||
elseif (package.config:sub(1,1) == [[\]]) then
|
||||
--windows
|
||||
cmd = [[mkdir "]] .. dir .. [["]];
|
||||
end
|
||||
-- os.execute(cmd);
|
||||
api:executeString("system " .. cmd );
|
||||
return cmd;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user