Add voicemail storage path variables.
This commit is contained in:
@@ -122,6 +122,19 @@
|
|||||||
domain_uuid = string.lower(domain_uuid);
|
domain_uuid = string.lower(domain_uuid);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--if voicemail_id is non numeric then get the number-alias
|
||||||
|
if (voicemail_id ~= nil) then
|
||||||
|
if tonumber(voicemail_id) == nil then
|
||||||
|
voicemail_id = api:execute("user_data", voicemail_id .. "@" .. domain_name .. " attr number-alias");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--set the voicemail_dir
|
||||||
|
voicemail_dir = voicemail_dir.."/default/"..domain_name;
|
||||||
|
if (debug["info"]) then
|
||||||
|
freeswitch.consoleLog("notice", "[voicemail] voicemail_dir: " .. voicemail_dir .. "\n");
|
||||||
|
end
|
||||||
|
|
||||||
--settings
|
--settings
|
||||||
dofile(scripts_dir.."/resources/functions/settings.lua");
|
dofile(scripts_dir.."/resources/functions/settings.lua");
|
||||||
settings = settings(domain_uuid);
|
settings = settings(domain_uuid);
|
||||||
@@ -136,6 +149,9 @@
|
|||||||
if (settings['voicemail']['storage_path'] ~= nil) then
|
if (settings['voicemail']['storage_path'] ~= nil) then
|
||||||
if (settings['voicemail']['storage_path']['text'] ~= nil) then
|
if (settings['voicemail']['storage_path']['text'] ~= nil) then
|
||||||
storage_path = settings['voicemail']['storage_path']['text'];
|
storage_path = settings['voicemail']['storage_path']['text'];
|
||||||
|
storage_path = storage_path:gsub("${domain_name}", domain_name);
|
||||||
|
storage_path = storage_path:gsub("${voicemail_id}", voicemail_id);
|
||||||
|
storage_path = storage_path:gsub("${voicemail_dir}", voicemail_dir);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -148,19 +164,6 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--if voicemail_id is non numeric then get the number-alias
|
|
||||||
if (voicemail_id ~= nil) then
|
|
||||||
if tonumber(voicemail_id) == nil then
|
|
||||||
voicemail_id = api:execute("user_data", voicemail_id .. "@" .. domain_name .. " attr number-alias");
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--set the voicemail_dir
|
|
||||||
voicemail_dir = voicemail_dir.."/default/"..domain_name;
|
|
||||||
if (debug["info"]) then
|
|
||||||
freeswitch.consoleLog("notice", "[voicemail] voicemail_dir: " .. voicemail_dir .. "\n");
|
|
||||||
end
|
|
||||||
|
|
||||||
--get the voicemail settings
|
--get the voicemail settings
|
||||||
if (voicemail_id ~= nil) then
|
if (voicemail_id ~= nil) then
|
||||||
if (session:ready()) then
|
if (session:ready()) then
|
||||||
|
|||||||
@@ -128,6 +128,7 @@
|
|||||||
end
|
end
|
||||||
elseif (storage_type == "http_cache") then
|
elseif (storage_type == "http_cache") then
|
||||||
freeswitch.consoleLog("notice", "[voicemail] ".. storage_type .. " ".. storage_path .."\n");
|
freeswitch.consoleLog("notice", "[voicemail] ".. storage_type .. " ".. storage_path .."\n");
|
||||||
|
storage_path = storage_path:gsub("${domain_name}", domain_name);
|
||||||
session:execute("record", storage_path .."/"..recording_name);
|
session:execute("record", storage_path .."/"..recording_name);
|
||||||
else
|
else
|
||||||
--prepare to record the greeting
|
--prepare to record the greeting
|
||||||
@@ -140,7 +141,6 @@
|
|||||||
result = session:recordFile(voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", max_len_seconds, silence_threshold, silence_seconds);
|
result = session:recordFile(voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", max_len_seconds, silence_threshold, silence_seconds);
|
||||||
--session:execute("record", voicemail_dir.."/"..uuid.." 180 200");
|
--session:execute("record", voicemail_dir.."/"..uuid.." 180 200");
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--use the new greeting
|
--use the new greeting
|
||||||
|
|||||||
Reference in New Issue
Block a user