From f52787c8825c5dd7c90d3c2b2c24aac138d8be6f Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 21 Dec 2019 23:26:58 -0700 Subject: [PATCH] Update fax_retry.lua --- resources/install/scripts/fax_retry.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/resources/install/scripts/fax_retry.lua b/resources/install/scripts/fax_retry.lua index b582b24a76..85680a77d6 100644 --- a/resources/install/scripts/fax_retry.lua +++ b/resources/install/scripts/fax_retry.lua @@ -331,13 +331,12 @@ sql = sql .. " OR template_subcategory = 'fail_invalid' "; sql = sql .. ") " sql = sql .. "AND template_enabled = 'true' " - sql = sql .. "ORDER BY domain_uuid DESC " local params = {domain_uuid = domain_uuid, template_language = default_language.."-"..default_dialect}; if (debug["sql"]) then freeswitch.consoleLog("notice", "[fax] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); end dbh:query(sql, params, function(row) - if (template_subcategory == 'success_default') then + if (row["template_subcategory"] == 'success_default') then email_subject_success_default = row["template_subject"]; email_body_success_default = row["template_body"]; @@ -346,7 +345,7 @@ email_body_success_default = email_body_success_default:gsub("${number_dialed}", number_dialed); email_body_success_default = email_body_success_default:gsub("${fax_busy_attempts}", fax_busy_attempts); end - if (template_subcategory == 'fail_default') then + if (row["template_subcategory"] == 'fail_default') then email_subject_fail_default = row["template_subject"]; email_body_fail_default = row["template_body"]; @@ -355,7 +354,7 @@ email_body_fail_default = email_body_fail_default:gsub("${number_dialed}", number_dialed); email_body_fail_default = email_body_fail_default:gsub("${fax_busy_attempts}", fax_busy_attempts); end - if (template_subcategory == 'fail_busy') then + if (row["template_subcategory"] == 'fail_busy') then email_subject_fail_busy = row["template_subject"]; email_body_fail_busy = row["template_body"]; @@ -364,12 +363,12 @@ email_body_fail_busy = email_body_fail_busy:gsub("${number_dialed}", number_dialed); email_body_fail_busy = email_body_fail_busy:gsub("${fax_busy_attempts}", fax_busy_attempts); end - if (template_subcategory == 'fail_invalid') then + if (row["template_subcategory"] == 'fail_invalid') then email_subject_fail_invalid = row["template_subject"]; email_body_fail_invalid = row["template_body"]; email_subject_fail_invalid = email_subject_fail_invalid:gsub("${number_dialed}", number_dialed); - email_subject_fail_invalid = email_subject_success_default:gsub("${fax_busy_attempts}", fax_busy_attempts); + email_subject_fail_invalid = email_subject_fail_invalid:gsub("${fax_busy_attempts}", fax_busy_attempts); email_body_fail_invalid = email_body_fail_invalid:gsub("${number_dialed}", number_dialed); email_body_fail_invalid = email_body_fail_invalid:gsub("${fax_busy_attempts}", fax_busy_attempts); end