Merge branch 'master' into show_channels
This commit is contained in:
commit
fb3fb16002
|
|
@ -82,7 +82,7 @@ else {
|
|||
echo "<th>".$text['label-description']."</th>\n";
|
||||
echo "<td class='list_control_icons'>";
|
||||
if (permission_exists('extension_add')) {
|
||||
echo "<a href='/app/extensions/extension_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
echo "<a href='".PROJECT_PATH."/app/extensions/extension_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
|
@ -92,7 +92,7 @@ else {
|
|||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
if (permission_exists('extension_edit')) {
|
||||
echo "<a href='/app/extensions/extension_edit.php?id=".$row['extension_uuid']."'>".$row['extension']."</a>";
|
||||
echo "<a href='".PROJECT_PATH."/app/extensions/extension_edit.php?id=".$row['extension_uuid']."'>".$row['extension']."</a>";
|
||||
}
|
||||
else {
|
||||
echo $row['extension'];
|
||||
|
|
@ -102,10 +102,10 @@ else {
|
|||
echo " <td valign='top' class='row_stylebg'>".$row['description']." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('extension_edit')) {
|
||||
echo "<a href='/app/extensions/extension_edit.php?id=".$row['extension_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
echo "<a href='".PROJECT_PATH."/app/extensions/extension_edit.php?id=".$row['extension_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
}
|
||||
if (permission_exists('extension_delete')) {
|
||||
echo "<a href='/app/extensions/extension_delete.php?id=".$row['extension_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
echo "<a href='".PROJECT_PATH."/app/extensions/extension_delete.php?id=".$row['extension_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
|
@ -116,4 +116,4 @@ else {
|
|||
|
||||
echo "</table>";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -214,15 +214,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$dialplan["dialplan_description"] = ($dialplan_description != '') ? $dialplan_description : $destination_description;
|
||||
$dialplan_detail_order = 10;
|
||||
|
||||
//add the public condition
|
||||
$y = 0;
|
||||
$dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "context";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "public";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order;
|
||||
$y++;
|
||||
|
||||
//increment the dialplan detail order
|
||||
$dialplan_detail_order = $dialplan_detail_order + 10;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<action application="set" data="caller_id_name=Page" />
|
||||
<action application="set" data="caller_id_number=" />
|
||||
<action application="set" data="pin_number={v_pin_number}" />
|
||||
<action application="set" data="extension_list=101-103,105" />
|
||||
<action application="set" data="destinations=101-103,105" />
|
||||
<action application="set" data="moderator=false" />
|
||||
<action application="set" data="mute=true" />
|
||||
<action application="set" data="set api_hangup_hook=conference page-${destination_number} kick all" />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<context name="{v_context}">
|
||||
<extension name="page-extension" number="*8[ext]" continue="false" app_uuid="1b224444-de8b-448d-b2d1-19feaac3effa">
|
||||
<condition field="destination_number" expression="^\*8(\d{2,7})$">
|
||||
<action application="set" data="extension_list=$1"/>
|
||||
<action application="set" data="destinations=$1"/>
|
||||
<action application="set" data="pin_number={v_pin_number}"/>
|
||||
<action application="set" data="mute=true"/>
|
||||
<action application="set" data="moderator=false" />
|
||||
|
|
|
|||
|
|
@ -184,33 +184,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//add condition public context
|
||||
$dialplan_detail_uuid = uuid();
|
||||
$sql = "insert into v_dialplan_details ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "dialplan_uuid, ";
|
||||
$sql .= "dialplan_detail_uuid, ";
|
||||
$sql .= "dialplan_detail_tag, ";
|
||||
$sql .= "dialplan_detail_type, ";
|
||||
$sql .= "dialplan_detail_data, ";
|
||||
$sql .= "dialplan_detail_group, ";
|
||||
$sql .= "dialplan_detail_order ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$dialplan_uuid', ";
|
||||
$sql .= "'$dialplan_detail_uuid', ";
|
||||
$sql .= "'condition', ";
|
||||
$sql .= "'context', ";
|
||||
$sql .= "'public', ";
|
||||
$sql .= "'0', ";
|
||||
$sql .= "'10' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//add condition 1
|
||||
$dialplan_detail_uuid = uuid();
|
||||
$sql = "insert into v_dialplan_details ";
|
||||
|
|
|
|||
|
|
@ -583,6 +583,28 @@ $text['label-alternate-destination']['uk'] = "";
|
|||
$text['label-alternate-destination']['de-at'] = "Alternatives Ziel";
|
||||
$text['label-alternate-destination']['he'] = "";
|
||||
|
||||
$text['label-group']['en-us'] = "Group";
|
||||
$text['label-group']['es-cl'] = "Grupo";
|
||||
$text['label-group']['pt-pt'] = "";
|
||||
$text['label-group']['fr-fr'] = "";
|
||||
$text['label-group']['pt-br'] = "";
|
||||
$text['label-group']['pl'] = "";
|
||||
$text['label-group']['sv-se'] = "";
|
||||
$text['label-group']['uk'] = "";
|
||||
$text['label-group']['de-at'] = "";
|
||||
$text['label-group']['he'] = "";
|
||||
|
||||
$text['label-destination']['en-us'] = "Destination";
|
||||
$text['label-destination']['es-cl'] = "Destino";
|
||||
$text['label-destination']['pt-pt'] = "Destino";
|
||||
$text['label-destination']['fr-fr'] = "Destination";
|
||||
$text['label-destination']['pt-br'] = "";
|
||||
$text['label-destination']['pl'] = "Destynacja";
|
||||
$text['label-destination']['sv-se'] = "Destination";
|
||||
$text['label-destination']['uk'] = "";
|
||||
$text['label-destination']['de-at'] = "Ziel";
|
||||
$text['label-destination']['he'] = "";
|
||||
|
||||
$text['header-time_conditions']['en-us'] = "Time Conditions";
|
||||
$text['header-time_conditions']['es-cl'] = "Condiciones de Tiempo";
|
||||
$text['header-time_conditions']['pt-pt'] = "Condições Temporais";
|
||||
|
|
|
|||
|
|
@ -248,7 +248,14 @@ require_once "resources/header.php";
|
|||
$is_preset = (in_array($group_id, $_REQUEST['preset'])) ? true : false;
|
||||
|
||||
//set group and order number
|
||||
$dialplan_detail_group = $group_id;
|
||||
|
||||
$dialplan_detail_group_user = check_str($_POST["group_$group_id"]);
|
||||
if($dialplan_detail_group_user!='') {
|
||||
$dialplan_detail_group = $dialplan_detail_group_user;
|
||||
} else {
|
||||
$dialplan_detail_group = $group_id;
|
||||
}
|
||||
|
||||
$dialplan_detail_order = 0;
|
||||
|
||||
foreach ($conditions as $cond_num => $cond_var) {
|
||||
|
|
@ -836,7 +843,7 @@ function add_custom_condition($destination, $group_id, $dialplan_action = '') {
|
|||
echo " ".$text['label-settings'];
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <table border='0' cellpadding='2' cellspacing='0' style='margin: -2px;'>\n";
|
||||
echo " <table border='0' cellpadding='0' cellspacing='0' style='margin: -2px;'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable' style='width: 108px;'>".$text['label-condition']."</td>\n";
|
||||
echo " <td class='vtable' style='width: 125px;'>".$text['label-condition_value']."</td>\n";
|
||||
|
|
@ -846,11 +853,16 @@ function add_custom_condition($destination, $group_id, $dialplan_action = '') {
|
|||
echo " <tr>";
|
||||
echo " <td colspan='4' style='white-space: nowrap;' id='group_".$group_id."'></td>";
|
||||
echo " </tr>";
|
||||
echo " </tr>";
|
||||
echo " <td colspan='2' class='vtable' style='width: 108px;'>".$text['label-destination']."</td>\n";
|
||||
echo " <td colspan='2' class='vtable'>".$text['label-group']."</td>\n";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td colspan='4' style='padding-top: 10px;'>";
|
||||
echo " <td colspan='2' style='padding-top: 3px;'>";
|
||||
//$destination = new destinations;
|
||||
echo $destination->select('dialplan', 'dialplan_action['.$group_id.']', $dialplan_action);
|
||||
echo " </td>";
|
||||
echo " <td colspan='2' style='padding-top: 3px;'><input class='formfld' type='text' name='group_".$group_id."' id='group_".$group_id."' maxlength='255' value=\"".$group_id."\"></td>\n";
|
||||
echo " </tr>";
|
||||
echo " </table>";
|
||||
echo " <br />";
|
||||
|
|
@ -1092,4 +1104,4 @@ echo "<br />";
|
|||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -73,6 +73,7 @@
|
|||
skip_instructions = session:getVariable("skip_instructions");
|
||||
skip_greeting = session:getVariable("skip_greeting");
|
||||
vm_message_ext = session:getVariable("vm_message_ext");
|
||||
vm_say_caller_id_number = session:getVariable("vm_say_caller_id_number");
|
||||
vm_disk_quota = session:getVariable("vm-disk-quota");
|
||||
if (not vm_disk_quota) then
|
||||
vm_disk_quota = session:getVariable("vm_disk_quota");
|
||||
|
|
|
|||
|
|
@ -42,14 +42,23 @@
|
|||
end
|
||||
--say the message number
|
||||
if (session:ready()) then
|
||||
if (string.len(dtmf_digits) == 0) then
|
||||
if (string.len(dtmf_digits) == 0) then
|
||||
dtmf_digits = macro(session, "message_number", 1, 100, '');
|
||||
end
|
||||
end
|
||||
--say the number
|
||||
if (session:ready()) then
|
||||
if (string.len(dtmf_digits) == 0) then
|
||||
session:say(message_number, default_language, "NUMBER", "pronounced");
|
||||
session:say(message_number, default_language, "number", "pronounced");
|
||||
end
|
||||
end
|
||||
--say the caller id number
|
||||
if (session:ready() and caller_id_number ~= nil) then
|
||||
if (vm_say_caller_id_number ~= nil) then
|
||||
if (vm_say_caller_id_number == "true") then
|
||||
session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-message_from.wav");
|
||||
session:say(caller_id_number, default_language, "name_spelled", "iterated");
|
||||
end
|
||||
end
|
||||
end
|
||||
--say the message date
|
||||
|
|
@ -58,10 +67,9 @@
|
|||
if (current_time_zone ~= nil) then
|
||||
session:execute("set", "timezone="..current_time_zone.."");
|
||||
end
|
||||
session:say(created_epoch, default_language, "CURRENT_DATE_TIME", "pronounced");
|
||||
session:say(created_epoch, default_language, "current_date_time", "pronounced");
|
||||
end
|
||||
end
|
||||
|
||||
--get the recordings from the database
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemail_messages
|
||||
|
|
|
|||
|
|
@ -0,0 +1,108 @@
|
|||
require 'resources.config'
|
||||
require 'resources.functions.file_exists'
|
||||
require 'resources.functions.database_handle'
|
||||
|
||||
local unpack = unpack or table.unpack
|
||||
|
||||
local Database = {} do
|
||||
|
||||
Database.__index = Database
|
||||
|
||||
function Database.new(name)
|
||||
local dbh = assert(name)
|
||||
if type(name) == 'string' then
|
||||
if name == 'switch' and file_exists(database_dir.."/core.db") then
|
||||
dbh = freeswitch.Dbh("sqlite://"..database_dir.."/core.db")
|
||||
else
|
||||
dbh = database_handle(name)
|
||||
end
|
||||
end
|
||||
assert(dbh:connected())
|
||||
|
||||
local self = setmetatable({
|
||||
_dbh = dbh;
|
||||
}, Database)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function Database:query(sql, fn)
|
||||
return self._dbh:query(sql, fn)
|
||||
end
|
||||
|
||||
function Database:first_row(sql)
|
||||
local result
|
||||
local ok, err = self:query(sql, function(row)
|
||||
result = row
|
||||
return 1
|
||||
end)
|
||||
if not ok then return nil, err end
|
||||
return result
|
||||
end
|
||||
|
||||
function Database:first_value(sql)
|
||||
local result, err = self:first_row(sql)
|
||||
if not result then return nil, err end
|
||||
local k, v = next(result)
|
||||
return v
|
||||
end
|
||||
|
||||
function Database:first(sql, ...)
|
||||
local result, err = self:first_row(sql)
|
||||
if not result then return nil, err end
|
||||
local t, n = {}, select('#', ...)
|
||||
for i = 1, n do
|
||||
t[i] = result[(select(i, ...))]
|
||||
end
|
||||
return unpack(t, 1, n)
|
||||
end
|
||||
|
||||
function Database:fetch_all(sql)
|
||||
local result = {}
|
||||
local ok, err = self:query(sql, function(row)
|
||||
result[#result + 1] = row
|
||||
end)
|
||||
if not ok then return nil, err end
|
||||
return result
|
||||
end
|
||||
|
||||
function Database:release(sql)
|
||||
if self._dbh then
|
||||
self._dbh:release()
|
||||
self._dbh = nil
|
||||
end
|
||||
end
|
||||
|
||||
function Database:connected(sql)
|
||||
return self._dbh and self._dbh:connected()
|
||||
end
|
||||
|
||||
function Database.__self_test__(name)
|
||||
local db = Database.new(name or 'system')
|
||||
assert(db:connected())
|
||||
|
||||
assert("1" == db:first_value("select 1 as v"))
|
||||
|
||||
local t = assert(db:first_row("select 1 as v"))
|
||||
assert(t.v == "1")
|
||||
|
||||
t = assert(db:fetch_all("select 1 as v union all select 2 as v"))
|
||||
assert(#t == 2)
|
||||
assert(t[1].v == "1")
|
||||
assert(t[2].v == "2")
|
||||
|
||||
local a, b = assert(db:first("select 1 as b, 2 as a", 'a', 'b'))
|
||||
assert(a == "2")
|
||||
assert(b == "1")
|
||||
|
||||
-- assert(nil == db:first_value("some non sql query"))
|
||||
|
||||
db:release()
|
||||
assert(not db:connected())
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Database.__self_test__()
|
||||
|
||||
return Database
|
||||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
|
|
@ -924,8 +924,8 @@ account.2.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
@ -2399,8 +2399,8 @@ account.5.xsi.port =
|
|||
#Configure the time zone and time zone name. The time zone ranges from -11 to +12, the default value is +8.
|
||||
#local_time.time_zone = +8
|
||||
#local_time.time_zone_name = China(Beijing)
|
||||
local_time.time_zone = ${time_zone}
|
||||
local_time.time_zone_name = ${time_zone_name}
|
||||
local_time.time_zone = {$time_zone}
|
||||
local_time.time_zone_name = {$time_zone_name}
|
||||
|
||||
|
||||
#######################################################################################
|
||||
|
|
|
|||
Loading…
Reference in New Issue