FAX sure domain_uuid is set at the right time.
This commit is contained in:
parent
b3d2ee88c4
commit
bb4bab2fa8
|
|
@ -54,6 +54,19 @@
|
||||||
return c;
|
return c;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- set channel variables to lua variables
|
||||||
|
domain_uuid = env:getHeader("domain_uuid");
|
||||||
|
domain_name = env:getHeader("domain_name");
|
||||||
|
|
||||||
|
--get the domain_uuid using the domain name required for multi-tenant
|
||||||
|
if (domain_name ~= nil) then
|
||||||
|
sql = "SELECT domain_uuid FROM v_domains ";
|
||||||
|
sql = sql .. "WHERE domain_name = '" .. domain_name .. "' ";
|
||||||
|
status = dbh:query(sql, function(rows)
|
||||||
|
domain_uuid = rows["domain_uuid"];
|
||||||
|
end);
|
||||||
|
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);
|
||||||
|
|
@ -93,8 +106,6 @@
|
||||||
--variable_fax_transfer_rate: 14400
|
--variable_fax_transfer_rate: 14400
|
||||||
|
|
||||||
-- set channel variables to lua variables
|
-- set channel variables to lua variables
|
||||||
domain_uuid = env:getHeader("domain_uuid");
|
|
||||||
domain_name = env:getHeader("domain_name");
|
|
||||||
fax_uuid = env:getHeader("fax_uuid");
|
fax_uuid = env:getHeader("fax_uuid");
|
||||||
uuid = env:getHeader("uuid");
|
uuid = env:getHeader("uuid");
|
||||||
fax_success = env:getHeader("fax_success");
|
fax_success = env:getHeader("fax_success");
|
||||||
|
|
|
||||||
|
|
@ -59,27 +59,6 @@
|
||||||
return c;
|
return c;
|
||||||
end
|
end
|
||||||
|
|
||||||
--settings
|
|
||||||
dofile(scripts_dir.."/resources/functions/settings.lua");
|
|
||||||
settings = settings(domain_uuid);
|
|
||||||
storage_type = "";
|
|
||||||
storage_path = "";
|
|
||||||
if (settings['fax'] ~= nil) then
|
|
||||||
if (settings['fax']['storage_type'] ~= nil) then
|
|
||||||
if (settings['fax']['storage_type']['text'] ~= nil) then
|
|
||||||
storage_type = settings['fax']['storage_type']['text'];
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if (settings['fax']['storage_path'] ~= nil) then
|
|
||||||
if (settings['fax']['storage_path']['text'] ~= nil) then
|
|
||||||
storage_path = settings['fax']['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
|
|
||||||
|
|
||||||
-- show all channel variables
|
-- show all channel variables
|
||||||
--dat = env:serialize()
|
--dat = env:serialize()
|
||||||
--freeswitch.consoleLog("INFO","info:\n" .. dat .. "\n")
|
--freeswitch.consoleLog("INFO","info:\n" .. dat .. "\n")
|
||||||
|
|
@ -159,6 +138,27 @@
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--settings
|
||||||
|
dofile(scripts_dir.."/resources/functions/settings.lua");
|
||||||
|
settings = settings(domain_uuid);
|
||||||
|
storage_type = "";
|
||||||
|
storage_path = "";
|
||||||
|
if (settings['fax'] ~= nil) then
|
||||||
|
if (settings['fax']['storage_type'] ~= nil) then
|
||||||
|
if (settings['fax']['storage_type']['text'] ~= nil) then
|
||||||
|
storage_type = settings['fax']['storage_type']['text'];
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if (settings['fax']['storage_path'] ~= nil) then
|
||||||
|
if (settings['fax']['storage_path']['text'] ~= nil) then
|
||||||
|
storage_path = settings['fax']['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
|
||||||
|
|
||||||
--be sure accountcode is not empty
|
--be sure accountcode is not empty
|
||||||
if (accountcode == nil) then
|
if (accountcode == nil) then
|
||||||
accountcode = domain_name;
|
accountcode = domain_name;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue