mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
MWI improvements for voicemail.
This commit is contained in:
@@ -85,13 +85,15 @@
|
||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
||||
end
|
||||
status = dbh:query(sql, function(row)
|
||||
--send the message waiting event
|
||||
local event = freeswitch.Event("message_waiting");
|
||||
if (row["new_messages"] == "0") then
|
||||
--send the message waiting event
|
||||
local event = freeswitch.Event("message_waiting");
|
||||
event:addHeader("MWI-Messages-Waiting", "no");
|
||||
event:addHeader("MWI-Message-Account", "sip:"..voicemail_id.."@"..domain_name);
|
||||
event:fire();
|
||||
else
|
||||
event:addHeader("MWI-Messages-Waiting", "yes");
|
||||
end
|
||||
event:addHeader("MWI-Message-Account", "sip:"..voicemail_id.."@"..domain_name);
|
||||
event:fire();
|
||||
end);
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
--send the message waiting event
|
||||
local event = freeswitch.Event("message_waiting");
|
||||
if (row["message_count"] == "0") then
|
||||
--freeswitch.consoleLog("notice", "[voicemail] mailbox: "..voicemail_id.."@"..domain_name.." messages: " .. row["message_count"] .. " no messages\n");
|
||||
event:addHeader("MWI-Messages-Waiting", "no");
|
||||
else
|
||||
event:addHeader("MWI-Messages-Waiting", "yes");
|
||||
|
||||
@@ -36,14 +36,7 @@
|
||||
debug["info"] = false;
|
||||
|
||||
--connect to the database
|
||||
--ODBC - data source name
|
||||
if (dsn_name) then
|
||||
dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password);
|
||||
end
|
||||
--FreeSWITCH core db handler
|
||||
if (db_type == "sqlite") then
|
||||
dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name);
|
||||
end
|
||||
dbh = freeswitch.Dbh(database["system"]);
|
||||
|
||||
--used to stop the lua service
|
||||
local file = assert(io.open(tmp_file, "w"));
|
||||
|
||||
Reference in New Issue
Block a user