mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-22 02:46:30 +00:00
Merge remote-tracking branch 'upstream/master' into ivr_menu
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
require "resources.functions.base64";
|
||||
|
||||
--set the voicemail message path
|
||||
mkdir(voicemail_dir.."/"..voicemail_id);
|
||||
message_location = voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext;
|
||||
|
||||
--save the recording to the file system
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
require "resources.functions.base64";
|
||||
|
||||
--set the voicemail message path
|
||||
mkdir(voicemail_dir.."/"..voicemail_id);
|
||||
greeting_location = voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"; --vm_message_ext;
|
||||
|
||||
--if not found, save greeting to local file system
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
-- notice, this list of conditions and the following disclaimer in the
|
||||
-- documentation and/or other materials provided with the distribution.
|
||||
--
|
||||
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
-- THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
-- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Part of FusionPBX
|
||||
-- Copyright (C) 2013 Mark J Crane <markjcrane@fusionpbx.com>
|
||||
-- Copyright (C) 2013-2015 Mark J Crane <markjcrane@fusionpbx.com>
|
||||
-- All rights reserved.
|
||||
--
|
||||
-- Redistribution and use in source and binary forms, with or without
|
||||
@@ -12,7 +12,7 @@
|
||||
-- notice, this list of conditions and the following disclaimer in the
|
||||
-- documentation and/or other materials provided with the distribution.
|
||||
--
|
||||
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
-- THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
-- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
@@ -79,7 +79,7 @@
|
||||
--delete the greeting (retain local for better responsiveness)
|
||||
--os.remove(real_file);
|
||||
end
|
||||
|
||||
|
||||
--if base64, encode file
|
||||
if (storage_type == "base64") then
|
||||
--include the base64 function
|
||||
@@ -90,7 +90,7 @@
|
||||
f:close();
|
||||
greeting_base64 = base64.encode(file_content);
|
||||
end
|
||||
|
||||
|
||||
--delete the previous recording
|
||||
sql = "delete from v_voicemail_greetings ";
|
||||
sql = sql .. "where domain_uuid = '".. domain_uuid .. "' ";
|
||||
@@ -144,7 +144,7 @@
|
||||
else
|
||||
dbh:query(sql);
|
||||
end
|
||||
|
||||
|
||||
--use the new greeting
|
||||
local array = {}
|
||||
table.insert(array, "update v_voicemails ");
|
||||
@@ -153,7 +153,7 @@
|
||||
table.insert(array, "and voicemail_id = '".. voicemail_id .."' ");
|
||||
sql = table.concat(array, "\n");
|
||||
dbh:query(sql);
|
||||
|
||||
|
||||
advanced();
|
||||
end
|
||||
if (type == "name") then
|
||||
|
||||
@@ -108,8 +108,12 @@
|
||||
if (debug["sql"]) then
|
||||
log.notice("SQL: " .. sql);
|
||||
end
|
||||
x = 0;
|
||||
local x = 0;
|
||||
local pass
|
||||
dbh:query(sql, function(row)
|
||||
--clear flag pass
|
||||
pass = false
|
||||
|
||||
--get the dialplan
|
||||
domain_uuid = row.domain_uuid;
|
||||
dialplan_uuid = row.dialplan_uuid;
|
||||
@@ -281,8 +285,26 @@
|
||||
|
||||
--increment the x
|
||||
x = x + 1;
|
||||
|
||||
--set flag pass
|
||||
pass = true
|
||||
end);
|
||||
|
||||
-- prevent partial dialplan (pass=nil may be error in sql or empty resultset)
|
||||
if pass == false then
|
||||
log.errf('context: %s, extension: %s, type: %s, data: %s ',
|
||||
call_context,
|
||||
dialplan_name or '----',
|
||||
dialplan_detail_tag or '----',
|
||||
dialplan_detail_data or '----'
|
||||
)
|
||||
|
||||
--close the database connection
|
||||
dbh:release();
|
||||
|
||||
error('error while build context: ' .. call_context)
|
||||
end
|
||||
|
||||
--close the extension tag if it was left open
|
||||
if (dialplan_tag_status == "open") then
|
||||
table.insert(xml, [[ </condition>]]);
|
||||
|
||||
@@ -183,6 +183,9 @@
|
||||
status = dbh:query(sql, function(row)
|
||||
--add functions
|
||||
require "resources.functions.base64";
|
||||
--make sure the recordings directory exists
|
||||
require "resources.functions.mkdir";
|
||||
mkdir(recordings_dir.."/"..domain_name);
|
||||
--add the path to filename
|
||||
ivr_menu_greet_long = recordings_dir.."/"..domain_name.."/"..greet_long_file_name;
|
||||
ivr_menu_greet_long_is_base64 = true;
|
||||
|
||||
@@ -9,11 +9,15 @@
|
||||
require "resources.functions.trim";
|
||||
|
||||
local api = api
|
||||
if (not api) and freeswitch then api = freeswitch.API() else
|
||||
api = {}
|
||||
function api:execute()
|
||||
return '-ERR UNSUPPORTTED'
|
||||
end
|
||||
if not api then
|
||||
if freeswitch then
|
||||
api = freeswitch.API()
|
||||
else
|
||||
api = {}
|
||||
function api:execute()
|
||||
return '-ERR UNSUPPORTTED'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function send_event(action, key)
|
||||
|
||||
@@ -42,7 +42,7 @@ local function tracef(type, name, level, ...)
|
||||
end
|
||||
|
||||
local LEVELS = {
|
||||
'error',
|
||||
'err',
|
||||
'warning',
|
||||
'notice',
|
||||
'info',
|
||||
|
||||
@@ -54,9 +54,7 @@
|
||||
end
|
||||
|
||||
--set the recordings directory
|
||||
if (domain_count > 1) then
|
||||
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||
end
|
||||
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||
|
||||
--check if a file exists
|
||||
require "resources.functions.file_exists";
|
||||
@@ -139,6 +137,7 @@
|
||||
end
|
||||
session:setInputCallback("on_dtmf", "");
|
||||
session:streamFile(file_name);
|
||||
session:unsetInputCallback();
|
||||
end
|
||||
|
||||
--if base64, remove temp file (increases responsiveness when files remain local)
|
||||
|
||||
Reference in New Issue
Block a user