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:
parent
676ae26f91
commit
cfff4beb2b
|
|
@ -1,14 +1,15 @@
|
||||||
|
|
||||||
--add the mkdir function
|
--add the mkdir function
|
||||||
function mkdir(dir)
|
function mkdir(dir)
|
||||||
dir = dir:gsub([[\]], "/");
|
api = freeswitch.API();
|
||||||
if (package.config:sub(1,1) == "/") then
|
dir = dir:gsub([[\]], "/");
|
||||||
--unix
|
if (package.config:sub(1,1) == "/") then
|
||||||
cmd = [[mkdir -p "]] .. dir .. [["]];
|
--unix
|
||||||
elseif (package.config:sub(1,1) == [[\]]) then
|
cmd = [[mkdir -p "]] .. dir .. [["]];
|
||||||
--windows
|
elseif (package.config:sub(1,1) == [[\]]) then
|
||||||
cmd = [[mkdir "]] .. dir .. [["]];
|
--windows
|
||||||
end
|
cmd = [[mkdir "]] .. dir .. [["]];
|
||||||
os.execute(cmd);
|
end
|
||||||
return cmd;
|
-- os.execute(cmd);
|
||||||
end
|
api:executeString("system " .. cmd );
|
||||||
|
return cmd;
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue