Update recordings.lua (#3941)

Keep recording descriptions when overwriting a slot.
This commit is contained in:
konradSC
2018-12-10 11:30:02 -05:00
committed by FusionPBX
parent 2f9185fa09
commit 50e5cc7949

View File

@@ -156,6 +156,14 @@
session:execute("record", "'"..recordings_dir.."/"..recording_name.."' 10800 500 500");
end
--get the description of the previous recording
sql = "SELECT recording_description FROM v_recordings ";
sql = sql .. "where domain_uuid = :domain_uuid ";
sql = sql .. "and recording_filename = :recording_name ";
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 ";
@@ -172,6 +180,7 @@
table.insert(array, "recording_uuid, ");
table.insert(array, "domain_uuid, ");
table.insert(array, "recording_filename, ");
table.insert(array, "recording_description, ");
if (storage_type == "base64") then
table.insert(array, "recording_base64, ");
end
@@ -182,6 +191,7 @@
table.insert(array, ":recording_uuid, ");
table.insert(array, ":domain_uuid, ");
table.insert(array, ":recording_name, ");
table.insert(array, ":recording_description, ");
if (storage_type == "base64") then
table.insert(array, ":recording_base64, ");
end
@@ -193,6 +203,7 @@
recording_uuid = recording_uuid;
domain_uuid = domain_uuid;
recording_name = recording_name;
recording_description = recording_description;
recording_base64 = recording_base64;
};