Merge remote-tracking branch 'upstream/master' into ivr_menu
This commit is contained in:
@@ -364,8 +364,8 @@ else {
|
|||||||
if (count($result) > 0) {
|
if (count($result) > 0) {
|
||||||
echo "<optgroup label='Phrases'>\n";
|
echo "<optgroup label='Phrases'>\n";
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
$selected = ($conference_center_greeting == "phrase:".$row["phrase_name"].".".$domain_uuid) ? true : false;
|
$selected = ($conference_center_greeting == "phrase:".$row["phrase_uuid"]) ? true : false;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' ".(($selected) ? "selected='selected'" : null).">".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."' ".(($selected) ? "selected='selected'" : null).">".$row["phrase_name"]."</option>\n";
|
||||||
if ($selected) { $tmp_selected = true; }
|
if ($selected) { $tmp_selected = true; }
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|||||||
@@ -744,8 +744,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (count($result) > 0) {
|
if (count($result) > 0) {
|
||||||
echo "<optgroup label='Phrases'>\n";
|
echo "<optgroup label='Phrases'>\n";
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
$selected = ($fax_send_greeting == "phrase:".$row["phrase_name"].".".$domain_uuid) ? true : false;
|
$selected = ($fax_send_greeting == "phrase:".$row["phrase_uuid"]) ? true : false;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' ".(($selected) ? "selected='selected'" : null).">".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."' ".(($selected) ? "selected='selected'" : null).">".$row["phrase_name"]."</option>\n";
|
||||||
if ($selected) { $tmp_selected = true; }
|
if ($selected) { $tmp_selected = true; }
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
*/
|
*/
|
||||||
//select
|
//select
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected && strlen($ivr_menu_greet_long) > 0) {
|
||||||
echo "<optgroup label='Selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_long)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_long)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||||
@@ -560,12 +560,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (count($result) > 0) {
|
if (count($result) > 0) {
|
||||||
echo "<optgroup label='Phrases'>\n";
|
echo "<optgroup label='Phrases'>\n";
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
if ($ivr_menu_greet_short == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
if ($ivr_menu_greet_short == "phrase:".$row["phrase_uuid"]) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."'>".$row["phrase_name"]."</option>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</optgroup>\n";
|
echo "</optgroup>\n";
|
||||||
@@ -899,12 +899,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (count($result) > 0) {
|
if (count($result) > 0) {
|
||||||
echo "<optgroup label='Phrases'>\n";
|
echo "<optgroup label='Phrases'>\n";
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_uuid"]) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."'>".$row["phrase_name"]."</option>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
@@ -933,7 +933,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
}
|
}
|
||||||
//select
|
//select
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected && strlen($ivr_menu_invalid_sound) > 0) {
|
||||||
echo "<optgroup label='Selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_invalid_sound)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_invalid_sound)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
||||||
@@ -995,12 +995,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (count($result) > 0) {
|
if (count($result) > 0) {
|
||||||
echo "<optgroup label='Phrases'>\n";
|
echo "<optgroup label='Phrases'>\n";
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
if ($ivr_menu_exit_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
if ($ivr_menu_exit_sound == "phrase:".$row["phrase_uuid"]) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
echo " <option value='phrase:".$row["phrase_uuid"]."'>".$row["phrase_name"]."</option>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
@@ -1029,7 +1029,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
}
|
}
|
||||||
//select
|
//select
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected && strlen($ivr_menu_exit_sound) > 0) {
|
||||||
echo "<optgroup label='Selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_exit_sound)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_exit_sound)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
require "resources.functions.base64";
|
require "resources.functions.base64";
|
||||||
|
|
||||||
--set the voicemail message path
|
--set the voicemail message path
|
||||||
|
mkdir(voicemail_dir.."/"..voicemail_id);
|
||||||
message_location = voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext;
|
message_location = voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext;
|
||||||
|
|
||||||
--save the recording to the file system
|
--save the recording to the file system
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
require "resources.functions.base64";
|
require "resources.functions.base64";
|
||||||
|
|
||||||
--set the voicemail message path
|
--set the voicemail message path
|
||||||
|
mkdir(voicemail_dir.."/"..voicemail_id);
|
||||||
greeting_location = voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"; --vm_message_ext;
|
greeting_location = voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"; --vm_message_ext;
|
||||||
|
|
||||||
--if not found, save greeting to local file system
|
--if not found, save greeting to local file system
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
-- notice, this list of conditions and the following disclaimer in the
|
-- notice, this list of conditions and the following disclaimer in the
|
||||||
-- documentation and/or other materials provided with the distribution.
|
-- 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
|
-- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- Part of FusionPBX
|
-- 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.
|
-- All rights reserved.
|
||||||
--
|
--
|
||||||
-- Redistribution and use in source and binary forms, with or without
|
-- 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
|
-- notice, this list of conditions and the following disclaimer in the
|
||||||
-- documentation and/or other materials provided with the distribution.
|
-- 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
|
-- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||||
|
|||||||
@@ -108,8 +108,12 @@
|
|||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
log.notice("SQL: " .. sql);
|
log.notice("SQL: " .. sql);
|
||||||
end
|
end
|
||||||
x = 0;
|
local x = 0;
|
||||||
|
local pass
|
||||||
dbh:query(sql, function(row)
|
dbh:query(sql, function(row)
|
||||||
|
--clear flag pass
|
||||||
|
pass = false
|
||||||
|
|
||||||
--get the dialplan
|
--get the dialplan
|
||||||
domain_uuid = row.domain_uuid;
|
domain_uuid = row.domain_uuid;
|
||||||
dialplan_uuid = row.dialplan_uuid;
|
dialplan_uuid = row.dialplan_uuid;
|
||||||
@@ -281,8 +285,26 @@
|
|||||||
|
|
||||||
--increment the x
|
--increment the x
|
||||||
x = x + 1;
|
x = x + 1;
|
||||||
|
|
||||||
|
--set flag pass
|
||||||
|
pass = true
|
||||||
end);
|
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
|
--close the extension tag if it was left open
|
||||||
if (dialplan_tag_status == "open") then
|
if (dialplan_tag_status == "open") then
|
||||||
table.insert(xml, [[ </condition>]]);
|
table.insert(xml, [[ </condition>]]);
|
||||||
|
|||||||
@@ -183,6 +183,9 @@
|
|||||||
status = dbh:query(sql, function(row)
|
status = dbh:query(sql, function(row)
|
||||||
--add functions
|
--add functions
|
||||||
require "resources.functions.base64";
|
require "resources.functions.base64";
|
||||||
|
--make sure the recordings directory exists
|
||||||
|
require "resources.functions.mkdir";
|
||||||
|
mkdir(recordings_dir.."/"..domain_name);
|
||||||
--add the path to filename
|
--add the path to filename
|
||||||
ivr_menu_greet_long = recordings_dir.."/"..domain_name.."/"..greet_long_file_name;
|
ivr_menu_greet_long = recordings_dir.."/"..domain_name.."/"..greet_long_file_name;
|
||||||
ivr_menu_greet_long_is_base64 = true;
|
ivr_menu_greet_long_is_base64 = true;
|
||||||
|
|||||||
@@ -9,11 +9,15 @@
|
|||||||
require "resources.functions.trim";
|
require "resources.functions.trim";
|
||||||
|
|
||||||
local api = api
|
local api = api
|
||||||
if (not api) and freeswitch then api = freeswitch.API() else
|
if not api then
|
||||||
api = {}
|
if freeswitch then
|
||||||
function api:execute()
|
api = freeswitch.API()
|
||||||
return '-ERR UNSUPPORTTED'
|
else
|
||||||
end
|
api = {}
|
||||||
|
function api:execute()
|
||||||
|
return '-ERR UNSUPPORTTED'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function send_event(action, key)
|
local function send_event(action, key)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ local function tracef(type, name, level, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local LEVELS = {
|
local LEVELS = {
|
||||||
'error',
|
'err',
|
||||||
'warning',
|
'warning',
|
||||||
'notice',
|
'notice',
|
||||||
'info',
|
'info',
|
||||||
|
|||||||
@@ -54,9 +54,7 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
--set the recordings directory
|
--set the recordings directory
|
||||||
if (domain_count > 1) then
|
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||||
recordings_dir = recordings_dir .. "/"..domain_name;
|
|
||||||
end
|
|
||||||
|
|
||||||
--check if a file exists
|
--check if a file exists
|
||||||
require "resources.functions.file_exists";
|
require "resources.functions.file_exists";
|
||||||
@@ -139,6 +137,7 @@
|
|||||||
end
|
end
|
||||||
session:setInputCallback("on_dtmf", "");
|
session:setInputCallback("on_dtmf", "");
|
||||||
session:streamFile(file_name);
|
session:streamFile(file_name);
|
||||||
|
session:unsetInputCallback();
|
||||||
end
|
end
|
||||||
|
|
||||||
--if base64, remove temp file (increases responsiveness when files remain local)
|
--if base64, remove temp file (increases responsiveness when files remain local)
|
||||||
|
|||||||
@@ -467,9 +467,13 @@ function save_module_xml() {
|
|||||||
function save_var_xml() {
|
function save_var_xml() {
|
||||||
global $config, $db, $domain_uuid;
|
global $config, $db, $domain_uuid;
|
||||||
|
|
||||||
|
//open the vars.xml file
|
||||||
$fout = fopen($_SESSION['switch']['conf']['dir']."/vars.xml","w");
|
$fout = fopen($_SESSION['switch']['conf']['dir']."/vars.xml","w");
|
||||||
$xml = '';
|
|
||||||
|
|
||||||
|
//get the hostname
|
||||||
|
$hostname = trim(event_socket_request_cmd('api switchname'));
|
||||||
|
|
||||||
|
//build the xml
|
||||||
$sql = "select * from v_vars ";
|
$sql = "select * from v_vars ";
|
||||||
$sql .= "where var_enabled = 'true' ";
|
$sql .= "where var_enabled = 'true' ";
|
||||||
$sql .= "order by var_cat, var_order asc ";
|
$sql .= "order by var_cat, var_order asc ";
|
||||||
@@ -477,6 +481,7 @@ function save_var_xml() {
|
|||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$prev_var_cat = '';
|
$prev_var_cat = '';
|
||||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
$xml = '';
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
if ($row['var_cat'] != 'Provision') {
|
if ($row['var_cat'] != 'Provision') {
|
||||||
if ($prev_var_cat != $row['var_cat']) {
|
if ($prev_var_cat != $row['var_cat']) {
|
||||||
@@ -487,7 +492,7 @@ function save_var_xml() {
|
|||||||
}
|
}
|
||||||
if (strlen($row['var_hostname']) == 0) {
|
if (strlen($row['var_hostname']) == 0) {
|
||||||
$xml .= "<X-PRE-PROCESS cmd=\"set\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
$xml .= "<X-PRE-PROCESS cmd=\"set\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
||||||
} elseif ($row['var_hostname'] == system('hostname')) {
|
} elseif ($row['var_hostname'] == $hostname) {
|
||||||
$xml .= "<X-PRE-PROCESS cmd=\"set\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
$xml .= "<X-PRE-PROCESS cmd=\"set\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<YealinkIPPhoneDirectory>
|
||||||
|
{assign var=x value=1}
|
||||||
|
{foreach $extensions as $row}
|
||||||
|
<DirectoryEntry>
|
||||||
|
{if $row.directory_full_name != ""}
|
||||||
|
<Name>{$row.directory_full_name}</Name>
|
||||||
|
{else}
|
||||||
|
<Name>{$row.effective_caller_id_name}</Name>
|
||||||
|
{/if}
|
||||||
|
{if $row.number_alias != ""}
|
||||||
|
<Telephone>{$row.number_alias}</Telephone>
|
||||||
|
{else}
|
||||||
|
<Telephone>{$row.extension}</Telephone>
|
||||||
|
{/if}
|
||||||
|
</DirectoryEntry>
|
||||||
|
{assign var=x value=$x+1}
|
||||||
|
{/foreach}
|
||||||
|
</YealinkIPPhoneDirectory>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user