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
local f = io.open(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, "rb"); --get the base
local file_content = f:read("*all"); local f = io.open(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, "rb");
f:close(); local file_content = f:read("*all");
message_base64 = base64.encode(file_content); f:close();
--freeswitch.consoleLog("notice", "[voicemail] ".. message_base64 .. "\n"); 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
end end