Make voicemail.lua use the new email.lua.
This commit is contained in:
parent
1e0634ab85
commit
1485437ba8
|
|
@ -768,27 +768,29 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
--send the email
|
--send the email
|
||||||
message = [[<font face=arial>
|
subject = [[Voicemail from ]]..caller_id_name..[[ <]]..caller_id_number..[[> ]]..message_length_formatted;
|
||||||
<b>Message From "]]..caller_id_name..[[" <A HREF="tel:]]..caller_id_number..[[">]]..caller_id_number..[[</A></b><br>
|
local message = {}
|
||||||
<hr noshade size=1>
|
table.insert(message, [[<font face="arial">]]);
|
||||||
Created: ]]..os.date("%A, %d %b %Y %I:%M %p", start_epoch)..[[<br>
|
table.insert(message, [[<b>Message From "]]..caller_id_name..[[" <A HREF="tel:]]..caller_id_number..[[">]]..caller_id_number..[[</A></b><br>]]);
|
||||||
Duration: ]]..message_length_formatted..[[<br>
|
table.insert(message, [[<hr noshade="noshade" size="1">]]);
|
||||||
Account: ]]..voicemail_id..[[@]]..domain_name..[[<br>
|
table.insert(message, [[Created: ]]..os.date("%A, %d %b %Y %I:%M %p", start_epoch)..[[<br>]]);
|
||||||
</font>]];
|
table.insert(message, [[Duration: ]]..message_length_formatted..[[<br>]]);
|
||||||
|
table.insert(message, [[Account: ]]..voicemail_id..[[@]]..domain_name..[[<br>]]);
|
||||||
|
table.insert(message, [[</font>]]);
|
||||||
|
body = table.concat(message, "");
|
||||||
|
body = body:gsub("'", "'")
|
||||||
|
body = body:gsub([["]], """)
|
||||||
if (voicemail_attach_file == "true") then
|
if (voicemail_attach_file == "true") then
|
||||||
freeswitch.email("",
|
file = voicemail_dir.."/"..voicemail_id.."/msg_"..uuid..".wav";
|
||||||
"",
|
cmd = "luarun email.lua "..voicemail_mail_to.." "..voicemail_mail_to.." '"..subject.."' '"..body.."' '"..file.."'";
|
||||||
"To: "..voicemail_mail_to.."\nFrom: "..voicemail_mail_to.."\nSubject: Voicemail from "..caller_id_name.." <"..caller_id_number.."> "..message_length_formatted,
|
|
||||||
message,
|
|
||||||
voicemail_dir.."/"..voicemail_id.."/msg_"..uuid..".wav"
|
|
||||||
);
|
|
||||||
else
|
else
|
||||||
freeswitch.email("",
|
cmd = "luarun email.lua "..voicemail_mail_to.." "..voicemail_mail_to.." '"..subject.."' '"..body.."'";
|
||||||
"",
|
|
||||||
"To: "..voicemail_mail_to.."\nFrom: "..voicemail_mail_to.."\nSubject: Voicemail from "..caller_id_name.." <"..caller_id_number.."> "..message_length_formatted,
|
|
||||||
message
|
|
||||||
);
|
|
||||||
end
|
end
|
||||||
|
api = freeswitch.API();
|
||||||
|
if (debug["info"]) then
|
||||||
|
freeswitch.consoleLog("notice", "[voicemail] cmd: " .. cmd .. "\n");
|
||||||
|
end
|
||||||
|
result = api:executeString(cmd);
|
||||||
|
|
||||||
--emailed
|
--emailed
|
||||||
if (session:ready()) then
|
if (session:ready()) then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue