From 76e6b5924b1b3fa89436f4a8a36fbaeaa45d6c18 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 15 Jun 2023 17:23:25 -0600 Subject: [PATCH] Initialize recording_description and recording_base64 as a string This prevents an error inserting a null description and fixes the insert SQL command to fix the insert. --- app/scripts/resources/scripts/recordings.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/scripts/resources/scripts/recordings.lua b/app/scripts/resources/scripts/recordings.lua index aa4049a2bb..9104ed2be1 100644 --- a/app/scripts/resources/scripts/recordings.lua +++ b/app/scripts/resources/scripts/recordings.lua @@ -32,6 +32,8 @@ recording_number = ""; recording_id = ""; recording_prefix = ""; + recording_description = ""; + recording_base64 = ""; --include config.lua require "resources.functions.config"; @@ -204,9 +206,7 @@ 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 + table.insert(array, "recording_base64, "); table.insert(array, "recording_name "); table.insert(array, ") "); table.insert(array, "VALUES "); @@ -215,9 +215,7 @@ 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 + table.insert(array, ":recording_base64, "); table.insert(array, ":recording_name "); table.insert(array, ") "); sql = table.concat(array, "\n");