After saving the base64 remove the file.

This commit is contained in:
Mark Crane 2015-04-18 18:42:39 +00:00
parent 10903a7b62
commit 911bbe32b9
1 changed files with 10 additions and 6 deletions

View File

@ -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,<uuid>,Send video refresh.,mod_commands
--may be used to clear video buffer before using record_fsv
--may be used to clear video buffer before using record_fsv