-
+
diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php
index 77b8100e8a..25dbfb37fd 100644
--- a/app/dialplan_inbound/dialplan_inbound_add.php
+++ b/app/dialplan_inbound/dialplan_inbound_add.php
@@ -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 ";
diff --git a/app/time_conditions/app_languages.php b/app/time_conditions/app_languages.php
index 402e6a4027..91dbe32ace 100644
--- a/app/time_conditions/app_languages.php
+++ b/app/time_conditions/app_languages.php
@@ -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";
diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php
index 42d7b79a62..1be14bd414 100644
--- a/app/time_conditions/time_condition_edit.php
+++ b/app/time_conditions/time_condition_edit.php
@@ -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 "\n";
echo "\n";
- echo " \n";
+ echo " ";
echo " ";
@@ -1092,4 +1104,4 @@ echo " ";
//include the footer
require_once "resources/footer.php";
-?>
+?>
\ No newline at end of file
diff --git a/resources/install/scripts/app/voicemail/index.lua b/resources/install/scripts/app/voicemail/index.lua
index 056127af3b..ee9e79e5cd 100644
--- a/resources/install/scripts/app/voicemail/index.lua
+++ b/resources/install/scripts/app/voicemail/index.lua
@@ -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");
diff --git a/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua b/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua
index 26f7f8f11d..81b763f044 100644
--- a/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua
+++ b/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua
@@ -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
diff --git a/resources/install/scripts/resources/functions/database.lua b/resources/install/scripts/resources/functions/database.lua
new file mode 100644
index 0000000000..50349b1b14
--- /dev/null
+++ b/resources/install/scripts/resources/functions/database.lua
@@ -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
\ No newline at end of file
diff --git a/resources/templates/provision/yealink/cp860/{$mac}.cfg b/resources/templates/provision/yealink/cp860/{$mac}.cfg
index 6c2e6b83fd..fc799d7c1a 100644
--- a/resources/templates/provision/yealink/cp860/{$mac}.cfg
+++ b/resources/templates/provision/yealink/cp860/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t21p/{$mac}.cfg b/resources/templates/provision/yealink/t21p/{$mac}.cfg
index d07ef9cbee..8641aa3259 100644
--- a/resources/templates/provision/yealink/t21p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t21p/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t23g/{$mac}.cfg b/resources/templates/provision/yealink/t23g/{$mac}.cfg
index 968318b4d8..e09d088c44 100644
--- a/resources/templates/provision/yealink/t23g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t23g/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t23p/{$mac}.cfg b/resources/templates/provision/yealink/t23p/{$mac}.cfg
index 968318b4d8..e09d088c44 100644
--- a/resources/templates/provision/yealink/t23p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t23p/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t27p/{$mac}.cfg b/resources/templates/provision/yealink/t27p/{$mac}.cfg
index 968318b4d8..e09d088c44 100644
--- a/resources/templates/provision/yealink/t27p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t27p/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t29g/{$mac}.cfg b/resources/templates/provision/yealink/t29g/{$mac}.cfg
index 968318b4d8..e09d088c44 100644
--- a/resources/templates/provision/yealink/t29g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t29g/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t41p/{$mac}.cfg b/resources/templates/provision/yealink/t41p/{$mac}.cfg
index 968318b4d8..e09d088c44 100644
--- a/resources/templates/provision/yealink/t41p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t41p/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t42g/{$mac}.cfg b/resources/templates/provision/yealink/t42g/{$mac}.cfg
index 39e50b45ba..94d6cc28a1 100644
--- a/resources/templates/provision/yealink/t42g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t42g/{$mac}.cfg
@@ -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}
#######################################################################################
diff --git a/resources/templates/provision/yealink/t46g/{$mac}.cfg b/resources/templates/provision/yealink/t46g/{$mac}.cfg
index a34ab6f3a8..d822ba5bad 100644
--- a/resources/templates/provision/yealink/t46g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t46g/{$mac}.cfg
@@ -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}
#######################################################################################
|