Update recordings.lua

This commit is contained in:
FusionPBX
2019-08-17 14:18:25 -06:00
committed by GitHub
parent 032d365fb5
commit 8354f2409b

View File

@@ -107,6 +107,12 @@
recording_name = session:getVariable("recording_name");
record_ext = session:getVariable("record_ext");
domain_name = session:getVariable("domain_name");
time_limit_secs = session:getVariable("time_limit_secs");
silence_thresh = session:getVariable("silence_thresh");
silence_hits = session:getVariable("silence_hits");
if (not time_limit_secs) then time_limit_secs = '10800'; end
if (not default_dialect) then default_dialect = '200'; end
if (not default_voice) then default_voice = '10'; end
--select the recording number and set the recording name
if (recording_id == nil) then
@@ -156,8 +162,8 @@
session:execute("record", storage_path .."/"..recording_name);
else
freeswitch.consoleLog("notice", "[recordings] ".. storage_type .. " ".. recordings_dir .."\n");
-- syntax is session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs);
session:execute("record", "'"..recordings_dir.."/"..recording_name.."' 10800 500 500");
-- record,Record File,<path> [<time_limit_secs>] [<silence_thresh>] [<silence_hits>]
session:execute("record", "'"..recordings_dir.."/"..recording_name.."' "..time_limit_secs.." "..silence_thresh.." "..silence_hits.."");
end
--get the description of the previous recording
@@ -167,7 +173,7 @@
sql = sql .. "limit 1";
local params = {domain_uuid = domain_uuid, recording_name = recording_name};
local recording_description = dbh:first_value(sql, params) or ''
--delete the previous recording
sql = "delete from v_recordings ";
sql = sql .. "where domain_uuid = :domain_uuid ";
@@ -184,7 +190,7 @@
table.insert(array, "recording_uuid, ");
table.insert(array, "domain_uuid, ");
table.insert(array, "recording_filename, ");
table.insert(array, "recording_description, ");
table.insert(array, "recording_description, ");
if (storage_type == "base64") then
table.insert(array, "recording_base64, ");
end
@@ -195,7 +201,7 @@
table.insert(array, ":recording_uuid, ");
table.insert(array, ":domain_uuid, ");
table.insert(array, ":recording_name, ");
table.insert(array, ":recording_description, ");
table.insert(array, ":recording_description, ");
if (storage_type == "base64") then
table.insert(array, ":recording_base64, ");
end
@@ -287,7 +293,7 @@ if ( session:ready() ) then
--if a recording directory is specified, use that instead
if (storage_path ~= nil and string.len(storage_path) > 0) then recordings_dir = storage_path; end
--set the sounds path for the language, dialect and voice
default_language = session:getVariable("default_language");
default_dialect = session:getVariable("default_dialect");