From baadb2185ba97bbe2c0dc80038edae1ec558d420 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 2 Sep 2020 15:58:42 -0600 Subject: [PATCH] Transcription change how we are picking it up. --- .../app/voicemail/resources/functions/send_email.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua index 4650a8d5b1..9cea840773 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua @@ -33,6 +33,8 @@ local db = dbh or Database.new('system') local settings = Settings.new(db, domain_name, domain_uuid) local email_method = settings:get('email', 'method', 'text'); + local transcribe_enabled = settings:get('voicemail', 'transcribe_enabled', 'boolean'); + --get voicemail message details local sql = [[SELECT * FROM v_voicemails WHERE domain_uuid = :domain_uuid @@ -124,10 +126,10 @@ 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 (transcription == nil) then - sql = sql .. "AND template_subcategory = 'default' " - else + if (transcribe_enabled == 'true') then sql = sql .. "AND template_subcategory = 'transcription' " + else + sql = sql .. "AND template_subcategory = 'default' " end sql = sql .. "AND template_enabled = 'true' " sql = sql .. "ORDER BY domain_uuid DESC "