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
@@ -317,11 +317,15 @@
--base64 encode the file --base64 encode the file
if (file_exists(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext)) then if (file_exists(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext)) then
--get the base
local f = io.open(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, "rb"); local f = io.open(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, "rb");
local file_content = f:read("*all"); local file_content = f:read("*all");
f:close(); f:close();
message_base64 = base64.encode(file_content); message_base64 = base64.encode(file_content);
--freeswitch.consoleLog("notice", "[voicemail] ".. message_base64 .. "\n"); --freeswitch.consoleLog("notice", "[voicemail] ".. message_base64 .. "\n");
--delete the file
os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext);
end end
end end