From 5754994e6cc0cd5bdcb12b24e7c80c2d8e7b7302 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 1 Apr 2015 08:11:44 +0000 Subject: [PATCH] When a new greeting is created set it as the greeting id. --- .../voicemail/resources/functions/record_greeting.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/install/scripts/app/voicemail/resources/functions/record_greeting.lua b/resources/install/scripts/app/voicemail/resources/functions/record_greeting.lua index 59cd303fe0..43b9bdefdb 100644 --- a/resources/install/scripts/app/voicemail/resources/functions/record_greeting.lua +++ b/resources/install/scripts/app/voicemail/resources/functions/record_greeting.lua @@ -144,6 +144,15 @@ end + --use the new greeting + local array = {} + table.insert(array, "update v_voicemails "); + table.insert(array, "set greeting_id = '".. greeting_id .."' "); + table.insert(array, "where domain_uuid = '".. domain_uuid .."' "); + table.insert(array, "and voicemail_id = '".. voicemail_id .."' "); + sql = table.concat(array, "\n"); + dbh:query(sql); + --play the greeting --if (session:ready()) then -- if (file_exists(voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav")) then