mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-21 18:36:31 +00:00
Add ring group call screening
This commit is contained in:
@@ -16,14 +16,14 @@
|
||||
--
|
||||
-- The Initial Developer of the Original Code is
|
||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||
-- Copyright (C) 2010-2015
|
||||
-- Copyright (C) 2010-2024
|
||||
-- the Initial Developer. All Rights Reserved.
|
||||
--
|
||||
-- Contributor(s):
|
||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||
|
||||
--include config.lua
|
||||
require "resources.functions.config";
|
||||
require "resources.functions.config";
|
||||
|
||||
--set variables
|
||||
digit_timeout = "5000";
|
||||
@@ -40,7 +40,7 @@
|
||||
--session:sleep(1000);
|
||||
|
||||
--get the variables
|
||||
uuid = session:getVariable("uuid");
|
||||
call_uuid = session:getVariable("call_uuid");
|
||||
domain_name = session:getVariable("domain_name");
|
||||
context = session:getVariable("context");
|
||||
sounds_dir = session:getVariable("sounds_dir");
|
||||
@@ -64,12 +64,32 @@
|
||||
if (not default_dialect) then default_dialect = 'us'; end
|
||||
if (not default_voice) then default_voice = 'callie'; end
|
||||
|
||||
--create the settings object
|
||||
--local Settings = require "resources.functions.lazy_settings";
|
||||
--local settings = Settings.new(dbh, domain_name, domain_uuid);
|
||||
|
||||
--get the recordings dir
|
||||
--recordings_dir = settings:get('switch', 'recordings', 'dir');
|
||||
|
||||
--set the default record extension
|
||||
if (record_ext == nil) then
|
||||
record_ext = 'wav';
|
||||
end
|
||||
|
||||
--prepare the recording path
|
||||
record_path = recordings_dir .. "/" .. domain_name .. "/archive/" .. os.date("%Y/%b/%d");
|
||||
record_path = record_path:gsub("\\", "/");
|
||||
|
||||
--if the screen file is found then set confirm to true
|
||||
if (domain_name ~= nil) then
|
||||
if (file_exists(temp_dir .. "/" .. domain_name .. "-" .. caller_id_number .. "." .. record_ext)) then
|
||||
call_screen_file = temp_dir .. "/" .. domain_name .. "-" .. caller_id_number .. "." .. record_ext;
|
||||
confirm = "true";
|
||||
end
|
||||
if (file_exists(record_path.."/call_screen."..call_uuid .."."..record_ext)) then
|
||||
call_screen_file = record_path.."/call_screen."..call_uuid .."."..record_ext;
|
||||
confirm = "true";
|
||||
end
|
||||
end
|
||||
|
||||
--confirm the calls
|
||||
|
||||
Reference in New Issue
Block a user