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