Simplify voicemail transcription

This is done by deprecating default setting voicemail transcribe_enabled.

Instead control this with the voicemail_transcription_enabled permission  and per voicemail.
This commit is contained in:
FusionPBX
2024-09-09 12:58:36 -06:00
committed by GitHub
parent 259ac1212d
commit 214a24bc39
5 changed files with 8 additions and 23 deletions

View File

@@ -567,7 +567,7 @@
if (storage_type == "base64") then
table.insert(sql, "message_base64, ");
end
if (transcribe_enabled == "true") and (voicemail_transcription_enabled == "true") then
if (voicemail_transcription_enabled == "true") then
table.insert(sql, "message_transcription, ");
end
table.insert(sql, "message_length ");
@@ -585,7 +585,7 @@
if (storage_type == "base64") then
table.insert(sql, ":message_base64, ");
end
if (transcribe_enabled == "true") and (voicemail_transcription_enabled == "true") then
if (voicemail_transcription_enabled == "true") then
table.insert(sql, ":transcription, ");
end
table.insert(sql, ":message_length ");

View File

@@ -30,9 +30,8 @@
--define a function to send email
function send_email(id, uuid)
local db = dbh or Database.new('system')
local settings = Settings.new(db, domain_name, domain_uuid)
local transcribe_enabled = settings:get('voicemail', 'transcribe_enabled', 'boolean');
local db = dbh or Database.new('system');
local settings = Settings.new(db, domain_name, domain_uuid);
local http_protocol = settings:get('domain', 'http_protocol', 'text') or "https";
local email_queue_enabled = "true";
@@ -185,7 +184,7 @@
sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) ";
sql = sql .. "AND template_language = :template_language ";
sql = sql .. "AND template_category = 'voicemail' "
if (transcribe_enabled == 'true' and voicemail_transcription_enabled == 'true') then
if (voicemail_transcription_enabled == 'true') then
sql = sql .. "AND template_subcategory = 'transcription' "
else
sql = sql .. "AND template_subcategory = 'default' "