From c2688fcf2a85946ba1d4f0d1c14bc3b8c732af39 Mon Sep 17 00:00:00 2001 From: konradSC Date: Wed, 21 Oct 2020 12:09:28 -0400 Subject: [PATCH] Check for origination_callee_id_name This was breaking when the variable wasn't set in the dialplan. Len discovered this :-) --- .../scripts/app/voicemail/resources/functions/send_email.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b7941aa6ee..7e3a95095a 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 @@ -202,7 +202,9 @@ body = body:gsub("${voicemail_name_formatted}", voicemail_name_formatted); body = body:gsub("${domain_name}", domain_name); body = body:gsub("${sip_to_user}", id); - body = body:gsub("${origination_callee_id_name}", origination_callee_id_name); + if (origination_callee_id_name ~= nil) then + body = body:gsub("${origination_callee_id_name}", origination_callee_id_name); + end body = body:gsub("${dialed_user}", id); if (voicemail_file == "attach") then body = body:gsub("${message}", text['label-attached']);