Voicemail to email send the email in the send_email.lua rather than with email.lua. So that the delete doesn't occur until after email is sent.
This commit is contained in:
parent
6b48f88955
commit
d283075d64
|
|
@ -143,26 +143,24 @@
|
||||||
body = body:gsub(" ", " ");
|
body = body:gsub(" ", " ");
|
||||||
body = body:gsub("\n", "");
|
body = body:gsub("\n", "");
|
||||||
body = body:gsub("\n", "");
|
body = body:gsub("\n", "");
|
||||||
body = body:gsub("'", "'");
|
|
||||||
body = body:gsub([["]], """);
|
|
||||||
body = trim(body);
|
body = trim(body);
|
||||||
|
|
||||||
--send the email
|
--send the email
|
||||||
file = voicemail_dir.."/"..id.."/msg_"..uuid.."."..vm_message_ext;
|
file = voicemail_dir.."/"..id.."/msg_"..uuid.."."..vm_message_ext;
|
||||||
if (voicemail_file == "attach") then
|
if (voicemail_file == "attach") then
|
||||||
if (voicemail_local_after_email == "false") then
|
freeswitch.email("",
|
||||||
delete = "true";
|
"",
|
||||||
|
"To: "..voicemail_mail_to.."\nFrom: "..voicemail_mail_to.."\nX-Headers: "..headers.."\nSubject: "..subject,
|
||||||
|
body,
|
||||||
|
file
|
||||||
|
);
|
||||||
else
|
else
|
||||||
delete = "false";
|
freeswitch.email("",
|
||||||
|
"",
|
||||||
|
"To: "..voicemail_mail_to.."\nFrom: "..voicemail_mail_to.."\nX-Headers: "..headers.."\nSubject: "..subject,
|
||||||
|
body
|
||||||
|
);
|
||||||
end
|
end
|
||||||
cmd = "luarun email.lua "..voicemail_mail_to.." "..voicemail_mail_to.." "..headers.." '"..subject.."' '"..body.."' '"..file.."' "..delete;
|
|
||||||
else
|
|
||||||
cmd = "luarun email.lua "..voicemail_mail_to.." "..voicemail_mail_to.." "..headers.." '"..subject.."' '"..body.."'";
|
|
||||||
end
|
|
||||||
if (debug["info"]) then
|
|
||||||
freeswitch.consoleLog("notice", "[voicemail] cmd: " .. cmd .. "\n");
|
|
||||||
end
|
|
||||||
result = api:executeString(cmd);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--whether to keep the voicemail message and details local after email
|
--whether to keep the voicemail message and details local after email
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue