From 911bbe32b9084cec623f37a67d9a2fa0b39ea29b Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 18 Apr 2015 18:42:39 +0000 Subject: [PATCH] After saving the base64 remove the file. --- .../install/scripts/app/voicemail/index.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/install/scripts/app/voicemail/index.lua b/resources/install/scripts/app/voicemail/index.lua index 823a7520b0..9310af8201 100644 --- a/resources/install/scripts/app/voicemail/index.lua +++ b/resources/install/scripts/app/voicemail/index.lua @@ -317,11 +317,15 @@ --base64 encode the file if (file_exists(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext)) then - local f = io.open(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, "rb"); - local file_content = f:read("*all"); - f:close(); - message_base64 = base64.encode(file_content); - --freeswitch.consoleLog("notice", "[voicemail] ".. message_base64 .. "\n"); + --get the base + local f = io.open(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, "rb"); + local file_content = f:read("*all"); + f:close(); + message_base64 = base64.encode(file_content); + --freeswitch.consoleLog("notice", "[voicemail] ".. message_base64 .. "\n"); + + --delete the file + os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext); end end @@ -506,4 +510,4 @@ --uuid_video_refresh --uuid_video_refresh,,Send video refresh.,mod_commands - --may be used to clear video buffer before using record_fsv \ No newline at end of file + --may be used to clear video buffer before using record_fsv