Update blf_subscribe.lua (#6482)

This commit is contained in:
levishores
2022-10-24 15:09:33 -04:00
committed by GitHub
parent bdbc1c2d4d
commit 63e6c5ab66

View File

@@ -7,6 +7,9 @@ else
service_name = proto
end
--make sure the scripts/run dir exists
mkdir(scripts_dir .. "/run");
require "resources.functions.config"
require "resources.functions.split"
require "resources.functions.trim";
@@ -22,7 +25,9 @@ local find_voicemail do
from v_voicemail_messages t1
inner join v_domains t2 on t1.domain_uuid = t2.domain_uuid
inner join v_voicemails t3 on t1.voicemail_uuid = t3.voicemail_uuid
where t2.domain_name = :domain_name and t3.voicemail_id = :extension and t1.message_status != 'saved']]
where t2.domain_name = :domain_name
and t3.voicemail_id = :extension
and (t1.message_status is null or message_status = '')]]
function find_voicemail(user)
local ext, domain_name = split_first(user, '@', true)