mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-04 10:43:49 +00:00
Merge pull request #1079 from moteus/temp_dir
Fix. Use `temp_dir` variable instead of hard coded `/tmp`
This commit is contained in:
@@ -589,7 +589,7 @@
|
||||
max_len_seconds = 5;
|
||||
silence_threshold = "500";
|
||||
silence_secs = "3";
|
||||
session:recordFile("/tmp/conference-"..uuid..".wav", max_len_seconds, silence_threshold, silence_secs);
|
||||
session:recordFile(temp_dir:gsub("\\","/") .. "/conference-"..uuid..".wav", max_len_seconds, silence_threshold, silence_secs);
|
||||
end
|
||||
|
||||
--play a message that the conference is being a recorded
|
||||
@@ -678,7 +678,7 @@
|
||||
--announce the caller
|
||||
if (announce == "true") then
|
||||
--announce the caller - play the recording
|
||||
cmd = "conference "..meeting_uuid.."-"..domain_name.." play /tmp/conference-"..uuid..".wav";
|
||||
cmd = "conference "..meeting_uuid.."-"..domain_name.." play " .. temp_dir:gsub("\\", "/") .. "/conference-"..uuid..".wav";
|
||||
--freeswitch.consoleLog("notice", "[conference center] ".. cmd .."\n");
|
||||
response = api:executeString(cmd);
|
||||
--play has entered the conference
|
||||
|
||||
@@ -142,11 +142,12 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
temp_dir = "";
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
if (not temp_dir) or (#temp_dir == 0) then
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
|
||||
--send the xml to the console
|
||||
if (debug["xml_string"]) then
|
||||
local file = assert(io.open("/tmp/callcenter.conf.xml", "w"));
|
||||
local file = assert(io.open(temp_dir .. "/callcenter.conf.xml", "w"));
|
||||
file:write(XML_STRING);
|
||||
file:close();
|
||||
end
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
table.insert(xml, [[ <param name="caller-id-name" value="$${outbound_caller_name}"/>]]);
|
||||
table.insert(xml, [[ <param name="caller-id-number" value="$${outbound_caller_id}"/>]]);
|
||||
table.insert(xml, [[ <param name="comfort-noise" value="true"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="/tmp/test.wav"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="]] .. temp_dir:gsub("\\","/") .. [[/test.wav"/>]]);
|
||||
table.insert(xml, [[ </profile>]]);
|
||||
|
||||
table.insert(xml, [[ <profile name="wideband">]]);
|
||||
@@ -131,7 +131,7 @@
|
||||
table.insert(xml, [[ <param name="caller-id-name" value="$${outbound_caller_name}"/>]]);
|
||||
table.insert(xml, [[ <param name="caller-id-number" value="$${outbound_caller_id}"/>]]);
|
||||
table.insert(xml, [[ <param name="comfort-noise" value="true"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="/tmp/test.wav"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="]] .. temp_dir:gsub("\\","/") .. [[/test.wav"/>]]);
|
||||
table.insert(xml, [[ </profile>]]);
|
||||
|
||||
table.insert(xml, [[ <profile name="ultrawideband">]]);
|
||||
@@ -159,7 +159,7 @@
|
||||
table.insert(xml, [[ <param name="caller-id-name" value="$${outbound_caller_name}"/>]]);
|
||||
table.insert(xml, [[ <param name="caller-id-number" value="$${outbound_caller_id}"/>]]);
|
||||
table.insert(xml, [[ <param name="comfort-noise" value="true"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="/tmp/test.wav"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="]] .. temp_dir:gsub("\\","/") .. [[/test.wav"/>]]);
|
||||
table.insert(xml, [[ </profile>]]);
|
||||
|
||||
table.insert(xml, [[ <profile name="cdquality">]]);
|
||||
@@ -187,7 +187,7 @@
|
||||
table.insert(xml, [[ <param name="caller-id-name" value="$${outbound_caller_name}"/>]]);
|
||||
table.insert(xml, [[ <param name="caller-id-number" value="$${outbound_caller_id}"/>]]);
|
||||
table.insert(xml, [[ <param name="comfort-noise" value="true"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="/tmp/test.wav"/>]]);
|
||||
table.insert(xml, [[ <param name="auto-record" value="]] .. temp_dir:gsub("\\","/") .. [[/test.wav"/>]]);
|
||||
table.insert(xml, [[ </profile>]]);
|
||||
|
||||
table.insert(xml, [[ <profile name="sla">]]);
|
||||
@@ -261,7 +261,7 @@
|
||||
|
||||
--send the xml to the console
|
||||
if (debug["xml_string"]) then
|
||||
local file = assert(io.open("/tmp/conference.conf.xml", "w"));
|
||||
local file = assert(io.open(temp_dir .."/conference.conf.xml", "w"));
|
||||
file:write(XML_STRING);
|
||||
file:close();
|
||||
end
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
|
||||
--send the xml to the console
|
||||
if (debug["xml_string"]) then
|
||||
local file = assert(io.open("/tmp/sofia.conf.xml", "w"));
|
||||
local file = assert(io.open(temp_dir .. "/sofia.conf.xml", "w"));
|
||||
file:write(XML_STRING);
|
||||
file:close();
|
||||
end
|
||||
|
||||
@@ -495,7 +495,7 @@
|
||||
|
||||
--send the xml to the console
|
||||
if (debug["xml_string"]) then
|
||||
local file = assert(io.open("/tmp/" .. user .. "@" .. domain_name .. ".xml", "w"));
|
||||
local file = assert(io.open(temp_dir .. "/" .. user .. "@" .. domain_name .. ".xml", "w"));
|
||||
file:write(XML_STRING);
|
||||
file:close();
|
||||
end
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
|
||||
--send the xml to the console
|
||||
if (debug["xml_string"]) then
|
||||
local file = assert(io.open("/tmp/xml_handler-" .. language .. ".xml", "w"));
|
||||
local file = assert(io.open(temp_dir .. "/xml_handler-" .. language .. ".xml", "w"));
|
||||
file:write(XML_STRING);
|
||||
file:close();
|
||||
end
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
--if the screen file is found then set confirm to true
|
||||
if (domain_name ~= nil) then
|
||||
call_screen_file = "/tmp/" .. domain_name .. "-" .. caller_id_number .. "." .. record_ext;
|
||||
call_screen_file = temp_dir .. "/" .. domain_name .. "-" .. caller_id_number .. "." .. record_ext;
|
||||
if (file_exists(call_screen_file)) then
|
||||
confirm = "true";
|
||||
end
|
||||
@@ -83,7 +83,7 @@
|
||||
digit = '';
|
||||
if (file_exists(call_screen_file)) then
|
||||
max_tries = "1";
|
||||
digit = session:playAndGetDigits(min_digits, max_digits, max_tries, "500", "#", call_screen_file, "", "\\d+");
|
||||
digit = session:playAndGetDigits(min_digits, max_digits, max_tries, "500", "#", call_screen_file:gsub("\\","/"), "", "\\d+");
|
||||
end
|
||||
if (string.len(digit) == 0) then
|
||||
max_tries = "3";
|
||||
|
||||
@@ -68,11 +68,12 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
temp_dir = "";
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
if (not temp_dir) or (#temp_dir == 0) then
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -72,11 +72,12 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
temp_dir = "";
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
if (not temp_dir) or (#temp_dir == 0) then
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,11 +44,13 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
temp_dir = "";
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
|
||||
if (not temp_dir) or (#temp_dir == 0) then
|
||||
if (settings['server'] ~= nil) then
|
||||
if (settings['server']['temp'] ~= nil) then
|
||||
if (settings['server']['temp']['dir'] ~= nil) then
|
||||
temp_dir = settings['server']['temp']['dir'];
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user