diff --git a/app/call_centers/app_defaults.php b/app/call_centers/app_defaults.php index 87b623f1e1..b25e350928 100644 --- a/app/call_centers/app_defaults.php +++ b/app/call_centers/app_defaults.php @@ -54,7 +54,7 @@ if ($domains_processed == 1) { $sql .= "'call_center', "; $sql .= "'dir', "; $sql .= "'".$_SESSION['switch']['conf']['dir']."/autoload_configs', "; - $sql .= "'true', "; + $sql .= "'false', "; $sql .= "'' "; $sql .= ")"; $db->exec(check_sql($sql)); diff --git a/app/conference_centers/conference_center_edit.php b/app/conference_centers/conference_center_edit.php index 0c1de57247..57f8ec6373 100644 --- a/app/conference_centers/conference_center_edit.php +++ b/app/conference_centers/conference_center_edit.php @@ -365,7 +365,7 @@ else { echo "\n"; foreach ($result as &$row) { $selected = ($conference_center_greeting == "phrase:".$row["phrase_name"].".".$domain_uuid) ? true : false; - echo " \n"; + echo " \n"; if ($selected) { $tmp_selected = true; } } unset ($prep_statement); diff --git a/app/extensions/app_config.php b/app/extensions/app_config.php index 292d76fb3a..e6f99a868e 100644 --- a/app/extensions/app_config.php +++ b/app/extensions/app_config.php @@ -111,6 +111,9 @@ $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_user_record"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "extension_missed_call"; //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; //$apps[$x]['permissions'][$y]['groups'][] = "admin"; diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 06edad79f4..409e58bdc5 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -1729,42 +1729,44 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; } - echo "\n"; - echo "\n"; - echo " ".$text['label-user_record']."\n"; - echo "\n"; - echo "\n"; - echo " \n"; + echo " \n"; + if ($user_record == "all") { + echo " \n"; + } + else { + echo " \n"; + } + if ($user_record == "local") { + echo " \n"; + } + else { + echo " \n"; + } + if ($user_record == "inbound") { + echo " \n"; + } + else { + echo " \n"; + } + if ($user_record == "outbound") { + echo " \n"; + } + else { + echo " \n"; + } + echo " \n"; + echo "
\n"; + echo $text['description-user_record']."\n"; + echo "\n"; + echo "\n"; } - else { - echo " \n"; - } - if ($user_record == "local") { - echo " \n"; - } - else { - echo " \n"; - } - if ($user_record == "inbound") { - echo " \n"; - } - else { - echo " \n"; - } - if ($user_record == "outbound") { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; - echo "
\n"; - echo $text['description-user_record']."\n"; - echo "\n"; - echo "\n"; if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold')) { echo "\n"; diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index f4fd232a3c..21cdd7f925 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -745,7 +745,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; foreach ($result as &$row) { $selected = ($fax_send_greeting == "phrase:".$row["phrase_name"].".".$domain_uuid) ? true : false; - echo " \n"; + echo " \n"; if ($selected) { $tmp_selected = true; } } unset ($prep_statement); diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index 2c4dcec7f5..939e725561 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -498,7 +498,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { */ //select if (if_group("superadmin")) { - if (!$tmp_selected) { + if (!$tmp_selected && strlen($ivr_menu_greet_long) > 0) { echo "\n"; if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_long)) { echo " \n"; @@ -562,10 +562,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { foreach ($result as &$row) { if ($ivr_menu_greet_short == "phrase:".$row["phrase_name"].".".$domain_uuid) { $tmp_selected = true; - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } echo "\n"; @@ -901,10 +901,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { foreach ($result as &$row) { if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) { $tmp_selected = true; - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } unset ($prep_statement); @@ -933,7 +933,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } //select if (if_group("superadmin")) { - if (!$tmp_selected) { + if (!$tmp_selected && strlen($ivr_menu_invalid_sound) > 0) { echo "\n"; if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_invalid_sound)) { echo " \n"; @@ -997,10 +997,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { foreach ($result as &$row) { if ($ivr_menu_exit_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) { $tmp_selected = true; - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } unset ($prep_statement); @@ -1029,7 +1029,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } //select if (if_group("superadmin")) { - if (!$tmp_selected) { + if (!$tmp_selected && strlen($ivr_menu_exit_sound) > 0) { echo "\n"; if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_exit_sound)) { echo " \n"; diff --git a/app/modules/app_languages.php b/app/modules/app_languages.php index 91fbde7c5b..cf89694518 100644 --- a/app/modules/app_languages.php +++ b/app/modules/app_languages.php @@ -44,6 +44,28 @@ $text['label-unload_module']['uk'] = "Вивантажити модуль"; $text['label-unload_module']['sv-se'] = "Ladda av Modul"; $text['label-unload_module']['de-at'] = "Modul deaktivieren"; +$text['label-unknown']['en-us'] = "Unknown"; +$text['label-unknown']['es-cl'] = ""; +$text['label-unknown']['pt-pt'] = ""; +$text['label-unknown']['fr-fr'] = ""; +$text['label-unknown']['pt-br'] = ""; +$text['label-unknown']['he'] = ""; +$text['label-unknown']['pl'] = ""; +$text['label-unknown']['uk'] = ""; +$text['label-unknown']['sv-se'] = ""; +$text['label-unknown']['de-at'] = ""; + +$text['label-none']['en-us'] = "None"; +$text['label-none']['es-cl'] = ""; +$text['label-none']['pt-pt'] = ""; +$text['label-none']['fr-fr'] = ""; +$text['label-none']['pt-br'] = ""; +$text['label-none']['he'] = ""; +$text['label-none']['pl'] = ""; +$text['label-none']['uk'] = ""; +$text['label-none']['sv-se'] = ""; +$text['label-none']['de-at'] = ""; + $text['label-stopped']['en-us'] = "Stopped"; $text['label-stopped']['es-cl'] = "Detenido"; $text['label-stopped']['pt-pt'] = "Parado"; @@ -220,4 +242,14 @@ $text['description-modules']['uk'] = "Модулі розширюють можл $text['description-modules']['sv-se'] = "Moduler utökar funktionerna i systemet. Använd den här sidan för att aktivera eller inaktivera moduler."; $text['description-modules']['de-at'] = "Module erweitern die Funktionalität des Systems. Benutzen Sie diese Seite um Module zu aktivieren oder zu deaktivieren."; +$text['error-event-socket']['en-us'] = "Connection to Event Socket failed."; +$text['error-event-socket']['es-cl'] = "Conexión a Socket de Eventos fallida."; +$text['error-event-socket']['pt-pt'] = "A ligação ao Event Socket falhou."; +$text['error-event-socket']['fr-fr'] = "Connexion à l'Event Socket en echec."; +$text['error-event-socket']['pt-br'] = "A conexão do evento socket falhou"; +$text['error-event-socket']['pl'] = "Połączenie do “Event Socket” nie powiodło się"; +$text['error-event-socket']['sv-se'] = "Kontakten till 'Event Socket' misslyckades."; +$text['error-event-socket']['uk'] = "Помилка підключення до сокета подій"; +$text['error-event-socket']['de-at'] = "Connection to Event Socket failed."; + ?> \ No newline at end of file diff --git a/app/modules/modules.php b/app/modules/modules.php index 47e6c37f3b..6b5317d1b1 100644 --- a/app/modules/modules.php +++ b/app/modules/modules.php @@ -67,6 +67,27 @@ if (strlen($_GET["a"]) > 0) { } } +$esl_alive = false; +if($fp){ + $esl_alive = true; + fclose($fp); +} + +//Warning if FS not start + if(!$esl_alive){ + $msg = "
".$text['error-event-socket']."
"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
".$text['label-message']."
$msg
\n"; + echo "
\n"; + } + //use the module class to get the list of modules from the db and add any missing modules $mod = new modules; $mod->db = $db; @@ -157,18 +178,24 @@ if (strlen($_GET["a"]) > 0) { echo $row["module_label"]; } echo " \n"; - if ($mod->active($row["module_name"])) { - echo " ".$text['label-running']."\n"; - echo " ".$text['label-stop']."\n"; - } - else { - if ($row['module_enabled']=="true") { - echo " ".$text['label-stopped']."\n"; + if($esl_alive) { + if ($mod->active($row["module_name"])) { + echo " ".$text['label-running']."\n"; + echo " ".$text['label-stop']."\n"; } else { - echo " ".$text['label-stopped']." ".$notice."\n"; + if ($row['module_enabled']=="true") { + echo " ".$text['label-stopped']."\n"; + } + else { + echo " ".$text['label-stopped']." ".$notice."\n"; + } + echo " ".$text['label-start']."\n"; } - echo " ".$text['label-start']."\n"; + } + else{ + echo " ".$text['label-unknown']."\n"; + echo " ".$text['label-none']."\n"; } echo " "; if ($row["module_enabled"] == "true") { diff --git a/app/music_on_hold/resources/classes/switch_music_on_hold.php b/app/music_on_hold/resources/classes/switch_music_on_hold.php index 40bc2ba8e4..7ca9ecf355 100644 --- a/app/music_on_hold/resources/classes/switch_music_on_hold.php +++ b/app/music_on_hold/resources/classes/switch_music_on_hold.php @@ -90,22 +90,23 @@ include "root.php"; } } //recordings - if($dh = opendir($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/")) { + $recordings_dir = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/"; + if($dh = opendir($recordings_dir)) { $tmp_selected = false; $files = Array(); //$select .= "\n"; while($file = readdir($dh)) { if($file != "." && $file != ".." && $file[0] != '.') { - if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) { + if(is_dir($recordings_dir . $file)) { //this is a directory } else { - if ($this->select_value == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($this->select_value) > 0) { + if ($this->select_value == $recordings_dir . $file && strlen($this->select_value) > 0) { $tmp_selected = true; - $select .= " \n"; + $select .= " \n"; } else { - $select .= " \n"; + $select .= " \n"; } } } diff --git a/app/phrases/resources/functions/save_phrases_xml.php b/app/phrases/resources/functions/save_phrases_xml.php index 6c7921d0ae..597971fedb 100644 --- a/app/phrases/resources/functions/save_phrases_xml.php +++ b/app/phrases/resources/functions/save_phrases_xml.php @@ -42,7 +42,7 @@ function save_phrases_xml() { } //build xml - $xml .= " \n"; + $xml .= " \n"; $xml .= " \n"; $xml .= " \n"; diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php index 95a3304d7f..9953fb8ba7 100644 --- a/app/provision/resources/classes/provision.php +++ b/app/provision/resources/classes/provision.php @@ -132,6 +132,12 @@ include "root.php"; case "aastra": $mac = strtoupper($mac); break; + case "cisco": + $mac = strtoupper($mac); + break; + case "linksys": + $mac = strtolower($mac); + break; case "mitel": $mac = strtoupper($mac); break; @@ -519,12 +525,12 @@ include "root.php"; $sql = "select user_uuid from v_extension_users "; $sql .= "where extension_uuid = '$extension_uuid' "; $sql .= "and domain_uuid = '$domain_uuid' "; - //echo $sql."\n"; $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); $extension_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement); foreach ($extension_users as &$row) { + //echo "user uuid: ".$row["user_uuid"]."\n"; //get the list of contacts [multiple results] $sql = "select contact_uuid from v_contact_users "; $sql .= "where user_uuid = '".$row["user_uuid"]."' "; @@ -535,7 +541,7 @@ include "root.php"; $extension_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement); foreach ($extension_users as &$row) { - $contacts[] = $row["contact_uuid"]; + $contact_uuids[] = $row["contact_uuid"]; } } } @@ -543,23 +549,23 @@ include "root.php"; //get the contacts assigned to the user //SQL 'in' with implode contacts array prevents returning duplicate contacts if (sizeof($contacts) > 0) { - $sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, "; - $sql .= "p.phone_number, p.phone_extension "; - $sql .= "from v_contacts as c, v_contact_phones as p "; - $sql .= "where c.contact_uuid in ('".implode("','",$contacts)."') "; - $sql .= "and c.contact_uuid = p.contact_uuid "; - $sql .= "and p.phone_type_voice = '1' "; - $sql .= "and c.domain_uuid = '$domain_uuid' "; - //echo $sql."\n"; - $prep_statement = $this->db->prepare(check_sql($sql)); - $prep_statement->execute(); - $directory_personal = $prep_statement->fetchAll(PDO::FETCH_NAMED); - unset($prep_statement); - //print_r($contacts); + //get the contact details + $sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, "; + $sql .= "p.phone_number, p.phone_extension "; + $sql .= "from v_contacts as c, v_contact_phones as p "; + $sql .= "where c.contact_uuid in ('".implode("','",$contact_uuids)."') "; + $sql .= "and c.contact_uuid = p.contact_uuid "; + $sql .= "and p.phone_type_voice = '1' "; + $sql .= "and c.domain_uuid = '$domain_uuid' "; + //echo $sql."\n"; + $prep_statement = $this->db->prepare(check_sql($sql)); + $prep_statement->execute(); + $user_contacts = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement); + //assign the contacts array + $view->assign("user_contacts", $user_contacts); } - //assign the contacts array - $view->assign("directory_personal", $contacts); } //get the contact extensions array and add to the template engine diff --git a/core/install/resources/classes/install_fusionpbx.php b/core/install/resources/classes/install_fusionpbx.php index c55e89fb9b..45508ab28e 100644 --- a/core/install/resources/classes/install_fusionpbx.php +++ b/core/install/resources/classes/install_fusionpbx.php @@ -173,9 +173,14 @@ include "root.php"; $tmp_config .= "\n"; $tmp_config .= " //pgsql: database connection information\n"; if ($this->global_settings->db_type() == "pgsql") { - $cmt_out = ''; - if($this->global_settings->db_host() != 'localhost') { $cmt_out = "//"; } - $tmp_config .= " $cmt_out\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n"; + $db_host = $this->global_settings->db_host(); + //Unix Socket - if localhost or 127.0.0.1 we want it to default to a Unix Socket. + //$comment_out = ''; + //if ( $db_host == "localhost" or $db_host == "127.0.0.1") { + // $comment_out = "//"; + //} + //$tmp_config .= " $comment_out\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n"; + $tmp_config .= " \$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n"; $tmp_config .= " \$db_port = '".$this->global_settings->db_port()."';\n"; $tmp_config .= " \$db_name = '".$this->global_settings->db_name()."';\n"; $tmp_config .= " \$db_username = '".$this->global_settings->db_username()."';\n"; diff --git a/resources/install/scripts/app/ring_groups/index.lua b/resources/install/scripts/app/ring_groups/index.lua index bf4d2a193f..dc6ac4eaa6 100644 --- a/resources/install/scripts/app/ring_groups/index.lua +++ b/resources/install/scripts/app/ring_groups/index.lua @@ -39,6 +39,7 @@ local log = require "resources.functions.log".ring_group require "resources.functions.base64"; require "resources.functions.file_exists"; require "resources.functions.channel_utils" + require "resources.functions.format_ringback" --get the variables domain_name = session:getVariable("domain_name"); @@ -321,27 +322,7 @@ local log = require "resources.functions.log".ring_group domain_name = row.domain_name; --set ringback - if (ring_group_ringback == "${uk-ring}") then - ring_group_ringback = "tone_stream://%(400,200,400,450);%(400,2200,400,450);loops=-1"; - end - if (ring_group_ringback == "${us-ring}") then - ring_group_ringback = "tone_stream://%(2000,4000,440.0,480.0);loops=-1"; - end - if (ring_group_ringback == "${pt-ring}") then - ring_group_ringback = "tone_stream://%(1000,5000,400.0,0.0);loops=-1"; - end - if (ring_group_ringback == "${fr-ring}") then - ring_group_ringback = "tone_stream://%(1500,3500,440.0,0.0);loops=-1"; - end - if (ring_group_ringback == "${rs-ring}") then - ring_group_ringback = "tone_stream://%(1000,4000,425.0,0.0);loops=-1"; - end - if (ring_group_ringback == "${it-ring}") then - ring_group_ringback = "tone_stream://%(1000,4000,425.0,0.0);loops=-1"; - end - if (ring_group_ringback == "") then - ring_group_ringback = "local_stream://default"; - end + ring_group_ringback = format_ringback(ring_group_ringback); session:setVariable("ringback", ring_group_ringback); session:setVariable("transfer_ringback", ring_group_ringback); diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua index 9806d6a76d..a7169c70ab 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua @@ -24,6 +24,9 @@ -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. +--include functions + require "resources.functions.format_ringback" + --get the cache hostname = trim(api:execute("switchname", "")); if (trim(api:execute("module_exists", "mod_memcache")) == "true") then @@ -95,25 +98,9 @@ table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); - if (string.len(queue_moh_sound) == 0) then - table.insert(xml, [[ ]]); - else - if (string.sub(queue_moh_sound, 0, 14) == 'tone_stream://' or string.sub(queue_moh_sound, 0, 2) == '${') then - --given this string --tone_stream://${us-ring};loops=-1 --return us-ring - a, b, tone_string = string.find(queue_moh_sound, ".*{(.*)}.*"); - if (tone_string ~= nil) then - tone_string = trim(api:execute("global_getvar", tone_string)); - table.insert(xml, [[ ]]); - end - elseif (string.sub(queue_moh_sound, 0, 15) == 'local_stream://') then - table.insert(xml, [[ ]]); - else - if (queue_moh_sound == nil or queue_moh_sound == "") then - queue_moh_sound = "local_stream://default"; - end - table.insert(xml, [[ ]]); - end - end + --set ringback + queue_ringback = format_ringback(queue_moh_sound); + table.insert(xml, [[ ]]); if (queue_record_template ~= nil) then table.insert(xml, [[ ]]); end diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua index 4690230fd5..df90f0206d 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua @@ -13,7 +13,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, @@ -77,7 +77,155 @@ ivr_menu_description = row["ivr_menu_description"]; end); - --recording path + --get the recordings from the database + ivr_menu_greet_long_is_base64 = false; + ivr_menu_greet_short_is_base64 = false; + ivr_menu_invalid_sound_is_base64 = false; + ivr_menu_exit_sound_is_base64 = false; + if (storage_type == "base64") then + --greet long + if (string.len(ivr_menu_greet_long) > 1) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_long)) then + sql = [[SELECT * FROM v_recordings + WHERE domain_uuid = ']]..domain_uuid..[[' + AND recording_filename = ']]..ivr_menu_greet_long..[[' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[ivr_menu] SQL: "..sql.."\n"); + end + status = dbh:query(sql, function(row) + --add functions + require "resources.functions.base64"; + --add the path to filename + ivr_menu_greet_long = recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_long; + ivr_menu_greet_long_is_base64 = true; + --save the recording to the file system + if (string.len(row["recording_base64"]) > 32) then + local file = io.open(ivr_menu_greet_long, "w"); + file:write(base64.decode(row["recording_base64"])); + file:close(); + end + end); + end + end + --greet short + if (string.len(ivr_menu_greet_short) > 1) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_short)) then + sql = [[SELECT * FROM v_recordings + WHERE domain_uuid = ']]..domain_uuid..[[' + AND recording_filename = ']]..ivr_menu_greet_short..[[' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[ivr_menu] SQL: "..sql.."\n"); + end + status = dbh:query(sql, function(row) + --add functions + require "resources.functions.base64"; + --add the path to filename + ivr_menu_greet_short = recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_short; + ivr_menu_greet_short_is_base64 = true; + --save the recording to the file system + if (string.len(row["recording_base64"]) > 32) then + local file = io.open(ivr_menu_greet_short, "w"); + file:write(base64.decode(row["recording_base64"])); + file:close(); + end + end); + end + end + --invalid sound + if (string.len(ivr_menu_invalid_sound) > 1) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_invalid_sound)) then + sql = [[SELECT * FROM v_recordings + WHERE domain_uuid = ']]..domain_uuid..[[' + AND recording_filename = ']]..ivr_menu_invalid_sound..[[' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[ivr_menu] SQL: "..sql.."\n"); + end + status = dbh:query(sql, function(row) + --add functions + require "resources.functions.base64"; + --add the path to filename + ivr_menu_invalid_sound = recordings_dir..domain_name.."/".."/"..ivr_menu_invalid_sound; + ivr_menu_invalid_sound_is_base64 = true; + --save the recording to the file system + if (string.len(row["recording_base64"]) > 32) then + local file = io.open(ivr_menu_invalid_sound, "w"); + file:write(base64.decode(row["recording_base64"])); + file:close(); + end + end); + end + end + --exit sound + if (string.len(ivr_menu_exit_sound) > 1) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_exit_sound)) then + sql = [[SELECT * FROM v_recordings + WHERE domain_uuid = ']]..domain_uuid..[[' + AND recording_filename = ']]..ivr_menu_exit_sound..[[' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[ivr_menu] SQL: "..sql.."\n"); + end + status = dbh:query(sql, function(row) + --add functions + require "resources.functions.base64"; + --add the path to filename + ivr_menu_exit_sound = recordings_dir.."/"..domain_name.."/"..ivr_menu_exit_sound; + ivr_menu_exit_sound_is_base64 = true; + --save the recording to the file system + if (string.len(row["recording_base64"]) > 32) then + local file = io.open(ivr_menu_exit_sound, "w"); + file:write(base64.decode(row["recording_base64"])); + file:close(); + end + end); + end + end + elseif (storage_type == "http_cache") then + --add the path to file name + ivr_menu_greet_long = storage_path.."/"..ivr_menu_greet_long; + ivr_menu_greet_short = storage_path.."/"..ivr_menu_greet_short; + ivr_menu_invalid_sound = storage_path.."/"..ivr_menu_invalid_sound; + ivr_menu_exit_sound = storage_path.."/"..ivr_menu_exit_sound; + end + + --greet long + if (not file_exists(ivr_menu_greet_long)) then + if (file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_long)) then + ivr_menu_greet_long = recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_long; + elseif (file_exists(sounds_dir.."/en/us/callie/8000/"..ivr_menu_greet_long)) then + ivr_menu_greet_long = sounds_dir.."/${default_language}/${default_dialect}/${default_voice}/"..ivr_menu_greet_long; + end + end + + --greet short + if (string.len(ivr_menu_greet_short) > 1) then + if (not file_exists(ivr_menu_greet_short)) then + if (file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_long)) then + ivr_menu_greet_short = recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_long; + elseif (file_exists(sounds_dir.."/en/us/callie/8000/"..ivr_menu_greet_long)) then + ivr_menu_greet_short = sounds_dir.."/${default_language}/${default_dialect}/${default_voice}/"..ivr_menu_greet_long; + end + end + else + ivr_menu_greet_short = ivr_menu_greet_long; + end + + --invalid sound + if (not file_exists(ivr_menu_invalid_sound)) then + if (file_exists(recordings_dir.."/"..domain_name.. "/"..ivr_menu_invalid_sound)) then + ivr_menu_invalid_sound = recordings_dir.."/"..domain_name.."/"..ivr_menu_invalid_sound; + elseif (file_exists(sounds_dir.."/en/us/callie/8000/"..ivr_menu_invalid_sound)) then + ivr_menu_invalid_sound = sounds_dir.."/${default_language}/${default_dialect}/${default_voice}/"..ivr_menu_invalid_sound; + end + end + + --exit sound + if (not file_exists(ivr_menu_exit_sound)) then + if (file_exists(recordings_dir.."/"..ivr_menu_exit_sound)) then + ivr_menu_exit_sound = recordings_dir.."/"..domain_name.."/"..ivr_menu_exit_sound; + elseif (file_exists(sounds_dir.."/en/us/callie/8000/"..ivr_menu_exit_sounde)) then + ivr_menu_exit_sound = sounds_dir.."/${default_language}/${default_dialect}/${default_voice}/"..ivr_menu_exit_sound; + end + end --start the xml array local xml = {} diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua b/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua index 0994e28667..1ecf561ae2 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua @@ -339,10 +339,10 @@ table.insert(xml, [[]]); table.insert(xml, [[
]]); table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); diff --git a/resources/install/scripts/directory.lua b/resources/install/scripts/directory.lua index 7232974912..f0f6ab8ac2 100644 --- a/resources/install/scripts/directory.lua +++ b/resources/install/scripts/directory.lua @@ -40,6 +40,9 @@ require "resources.functions.database_handle"; dbh = database_handle('system'); +--include functions + require "resources.functions.format_ringback" + --settings require "resources.functions.settings"; settings = settings(domain_uuid); @@ -88,40 +91,14 @@ if (not default_dialect) then default_dialect = 'us'; end if (not default_voice) then default_voice = 'callie'; end + --set ringback + directory_ringback = format_ringback(session:getVariable("ringback")); + session:setVariable("ringback", directory_ringback); + session:setVariable("transfer_ringback", directory_ringback); + --set the sounds path for the language, dialect and voice - ringback = session:getVariable("ringback"); - if (ringback) then - ringback = ringback:gsub("$", ""); - ringback = ringback:gsub("{", ""); - ringback = ringback:gsub("}", ""); - end session:setVariable("instant_ringback", "true"); session:setVariable("ignore_early_media", "true"); - if (not ringback) then - session:execute("set", "ringback=local_stream://default"); --set to ringtone - session:execute("set", "transfer_ringback=local_stream://default"); --set to ringtone - elseif (ringback == "uk-ring") then - session:setVariable("ringback", "%(400,200,400,450);%(400,2200,400,450)"); - session:setVariable("transfer_ringback", "%(400,200,400,450);%(400,2200,400,450)"); - elseif (ringback == "us-ring") then - session:setVariable("ringback", "%(2000, 4000, 440.0, 480.0)"); - session:setVariable("transfer_ringback", "%(2000, 4000, 440.0, 480.0)"); - elseif (ringback == "pt-ring") then - session:setVariable("ringback", "%(1000, 5000, 400.0, 0.0)"); - session:setVariable("transfer_ringback", "%(1000, 5000, 400.0, 0.0)"); - elseif (ringback == "fr-ring") then - session:setVariable("ringback", "%(1500, 3500, 440.0, 0.0)"); - session:setVariable("transfer_ringback", "%(1500, 3500, 440.0, 0.0)"); - elseif (ringback == "rs-ring") then - session:setVariable("ringback", "%(1000, 4000, 425.0, 0.0)"); - session:setVariable("transfer_ringback", "%(1000, 4000, 425.0, 0.0)"); - elseif (ringback == "it-ring") then - session:setVariable("ringback", "%(1000, 4000, 425.0, 0.0)"); - session:setVariable("transfer_ringback", "%(1000, 4000, 425.0, 0.0)"); - else - session:execute("set", "ringback=local_stream://default"); --set to ringtone - session:execute("set", "transfer_ringback=local_stream://default"); --set to ringtone - end --define the sounds directory sounds_dir = session:getVariable("sounds_dir"); diff --git a/resources/install/scripts/ivr_menu.lua b/resources/install/scripts/ivr_menu.lua index 24418d531e..e1154c8d61 100644 --- a/resources/install/scripts/ivr_menu.lua +++ b/resources/install/scripts/ivr_menu.lua @@ -13,7 +13,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, @@ -38,6 +38,9 @@ require "resources.functions.database_handle"; dbh = database_handle('system'); +--include functions + require "resources.functions.format_ringback" + --get the variables domain_name = session:getVariable("domain_name"); context = session:getVariable("context"); @@ -76,8 +79,6 @@ end end ---add the domain name to the recordings directory - recordings_dir = recordings_dir .. "/"..domain_name; --set default variable(s) tries = 0; @@ -135,27 +136,7 @@ end --set ringback - if (ivr_menu_ringback == "${uk-ring}") then - ivr_menu_ringback = "tone_stream://%(400,200,400,450);%(400,2200,400,450);loops=-1"; - end - if (ivr_menu_ringback == "${us-ring}") then - ivr_menu_ringback = "tone_stream://%(2000,4000,440.0,480.0);loops=-1"; - end - if (ivr_menu_ringback == "${pt-ring}") then - ivr_menu_ringback = "tone_stream://%(1000,5000,400.0,0.0);loops=-1"; - end - if (ivr_menu_ringback == "${fr-ring}") then - ivr_menu_ringback = "tone_stream://%(1500,3500,440.0,0.0);loops=-1"; - end - if (ivr_menu_ringback == "${rs-ring}") then - ivr_menu_ringback = "tone_stream://%(1000,4000,425.0,0.0);loops=-1"; - end - if (ivr_menu_ringback == "${it-ring}") then - ivr_menu_ringback = "tone_stream://%(1000,4000,425.0,0.0);loops=-1"; - end - if (ivr_menu_ringback == nil or ivr_menu_ringback == "") then - ivr_menu_ringback = "local_stream://default"; - end + ivr_menu_ringback = format_ringback(ivr_menu_ringback); session:setVariable("ringback", ivr_menu_ringback); session:setVariable("transfer_ringback", ivr_menu_ringback); @@ -202,7 +183,7 @@ if (storage_type == "base64") then --greet long if (string.len(ivr_menu_greet_long) > 1) then - if (not file_exists(recordings_dir.."/"..greet_long_file_name)) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..greet_long_file_name)) then sql = [[SELECT * FROM v_recordings WHERE domain_uuid = ']]..domain_uuid..[[' AND recording_filename = ']]..greet_long_file_name..[[' ]]; @@ -213,7 +194,7 @@ --add functions require "resources.functions.base64"; --add the path to filename - ivr_menu_greet_long = recordings_dir.."/"..greet_long_file_name; + ivr_menu_greet_long = recordings_dir.."/"..domain_name.."/"..greet_long_file_name; ivr_menu_greet_long_is_base64 = true; --save the recording to the file system if (string.len(row["recording_base64"]) > 32) then @@ -226,7 +207,7 @@ end --greet short if (string.len(ivr_menu_greet_short) > 1) then - if (not file_exists(recordings_dir.."/"..greet_short_file_name)) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..greet_short_file_name)) then sql = [[SELECT * FROM v_recordings WHERE domain_uuid = ']]..domain_uuid..[[' AND recording_filename = ']]..greet_short_file_name..[[' ]]; @@ -237,7 +218,7 @@ --add functions require "resources.functions.base64"; --add the path to filename - ivr_menu_greet_short = recordings_dir.."/"..greet_short_file_name; + ivr_menu_greet_short = recordings_dir.."/"..domain_name.."/"..greet_short_file_name; ivr_menu_greet_short_is_base64 = true; --save the recording to the file system if (string.len(row["recording_base64"]) > 32) then @@ -250,7 +231,7 @@ end --invalid sound if (string.len(ivr_menu_invalid_sound) > 1) then - if (not file_exists(recordings_dir.."/"..invalid_sound_file_name)) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..invalid_sound_file_name)) then sql = [[SELECT * FROM v_recordings WHERE domain_uuid = ']]..domain_uuid..[[' AND recording_filename = ']]..invalid_sound_file_name..[[' ]]; @@ -261,7 +242,7 @@ --add functions require "resources.functions.base64"; --add the path to filename - ivr_menu_invalid_sound = recordings_dir.."/"..invalid_sound_file_name; + ivr_menu_invalid_sound = recordings_dir.."/"..domain_name.."/"..invalid_sound_file_name; ivr_menu_invalid_sound_is_base64 = true; --save the recording to the file system if (string.len(row["recording_base64"]) > 32) then @@ -274,7 +255,7 @@ end --exit sound if (string.len(ivr_menu_exit_sound) > 1) then - if (not file_exists(recordings_dir.."/"..exit_sound_file_name)) then + if (not file_exists(recordings_dir.."/"..domain_name.."/"..exit_sound_file_name)) then sql = [[SELECT * FROM v_recordings WHERE domain_uuid = ']]..domain_uuid..[[' AND recording_filename = ']]..exit_sound_file_name..[[' ]]; @@ -285,7 +266,7 @@ --add functions require "resources.functions.base64"; --add the path to filename - ivr_menu_exit_sound = recordings_dir.."/"..exit_sound_file_name; + ivr_menu_exit_sound = recordings_dir.."/"..domain_name.."/"..exit_sound_file_name; ivr_menu_exit_sound_is_base64 = true; --save the recording to the file system if (string.len(row["recording_base64"]) > 32) then @@ -307,19 +288,19 @@ --adjust file paths --greet long if (not file_exists(ivr_menu_greet_long)) then - if (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..greet_long_file_name)) then + if (file_exists(recordings_dir.."/"..domain_name.."/"..greet_long_file_name)) then + ivr_menu_greet_long = recordings_dir.."/"..domain_name.."/"..greet_long_file_name; + elseif (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..greet_long_file_name)) then ivr_menu_greet_long = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..greet_long_file_name; - elseif (file_exists(recordings_dir.."/"..greet_long_file_name)) then - ivr_menu_greet_long = recordings_dir.."/"..greet_long_file_name; end end --greet short if (string.len(ivr_menu_greet_short) > 1) then if (not file_exists(ivr_menu_greet_short)) then - if (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..greet_short_file_name)) then + if (file_exists(recordings_dir.."/"..domain_name.."/"..greet_short_file_name)) then + ivr_menu_greet_short = recordings_dir.."/"..domain_name.."/"..greet_short_file_name; + elseif (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..greet_short_file_name)) then ivr_menu_greet_short = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..greet_short_file_name; - elseif (file_exists(recordings_dir.."/"..greet_short_file_name)) then - ivr_menu_greet_short = recordings_dir.."/"..greet_short_file_name; end end else @@ -327,18 +308,18 @@ end --invalid sound if (not file_exists(ivr_menu_invalid_sound)) then - if (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..invalid_sound_file_name)) then + if (file_exists(recordings_dir.."/"..domain_name.."/"..invalid_sound_file_name)) then + ivr_menu_invalid_sound = recordings_dir.."/"..domain_name.."/"..invalid_sound_file_name; + elseif (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..invalid_sound_file_name)) then ivr_menu_invalid_sound = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..invalid_sound_file_name; - elseif (file_exists(recordings_dir.."/"..invalid_sound_file_name)) then - ivr_menu_invalid_sound = recordings_dir.."/"..invalid_sound_file_name; end end --exit sound if (not file_exists(ivr_menu_exit_sound)) then - if (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..exit_sound_file_name)) then + if (file_exists(recordings_dir.."/"..domain_name.."/"..exit_sound_file_name)) then + ivr_menu_exit_sound = recordings_dir.."/"..domain_name.."/"..exit_sound_file_name; + elseif (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..exit_sound_file_name)) then ivr_menu_exit_sound = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..exit_sound_file_name; - elseif (file_exists(recordings_dir.."/"..exit_sound_file_name)) then - ivr_menu_exit_sound = recordings_dir.."/"..exit_sound_file_name; end end diff --git a/resources/install/scripts/resources/functions/cache.lua b/resources/install/scripts/resources/functions/cache.lua index 6d121eb995..a110927e85 100644 --- a/resources/install/scripts/resources/functions/cache.lua +++ b/resources/install/scripts/resources/functions/cache.lua @@ -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) diff --git a/resources/install/scripts/resources/functions/format_ringback.lua b/resources/install/scripts/resources/functions/format_ringback.lua new file mode 100644 index 0000000000..83dcc95547 --- /dev/null +++ b/resources/install/scripts/resources/functions/format_ringback.lua @@ -0,0 +1,26 @@ + +--add the format_ringback function + function format_ringback (ringback) + --include trim + require "resources.functions.trim"; + --prepare the api object + api = freeswitch.API(); + --handle ringback + if (ringback == nil or ringback == "") then + --get the default ring back + ringback = trim(api:execute("global_getvar", "hold_music")); + elseif (ringback:match("%${.*}")) then + --strip the ${ and } + ringback = ringback:gsub("%${", ""); + ringback = ringback:gsub("}", ""); + --get the ringback variable + ringback = trim(api:execute("global_getvar", ringback)); + --fallback to us-ring + if (ringback == "") then + ringback = trim(api:execute("global_getvar", "us-ring")); + end + --convert to tone_stream + ringback = "tone_stream://" .. ringback .. ";loops=-1"; + end + return ringback; + end \ No newline at end of file diff --git a/resources/install/scripts/streamfile.lua b/resources/install/scripts/streamfile.lua index 576fd46a29..772167210a 100644 --- a/resources/install/scripts/streamfile.lua +++ b/resources/install/scripts/streamfile.lua @@ -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) diff --git a/resources/templates/conf/autoload_configs/spandsp.conf.xml b/resources/templates/conf/autoload_configs/spandsp.conf.xml index 6f062cc731..9306c46c5c 100644 --- a/resources/templates/conf/autoload_configs/spandsp.conf.xml +++ b/resources/templates/conf/autoload_configs/spandsp.conf.xml @@ -24,7 +24,7 @@ - + diff --git a/resources/templates/provision/cisco/7940/directory_personal.xml b/resources/templates/provision/cisco/7940/directory_personal.xml index 52f1f61688..08724998ae 100644 --- a/resources/templates/provision/cisco/7940/directory_personal.xml +++ b/resources/templates/provision/cisco/7940/directory_personal.xml @@ -2,7 +2,7 @@ Personal Please choose... {assign var=x value=1} -{foreach $directory_personal as $row} +{foreach $user_contacts as $row} {if $row.contact_name_given != ""} {$row.contact_name_given} {$row.contact_name_family} @@ -18,7 +18,3 @@ {assign var=x value=$x+1} {/foreach} - - - - diff --git a/resources/templates/provision/cisco/7960/directory_personal.xml b/resources/templates/provision/cisco/7960/directory_personal.xml index 52f1f61688..08724998ae 100644 --- a/resources/templates/provision/cisco/7960/directory_personal.xml +++ b/resources/templates/provision/cisco/7960/directory_personal.xml @@ -2,7 +2,7 @@ Personal Please choose... {assign var=x value=1} -{foreach $directory_personal as $row} +{foreach $user_contacts as $row} {if $row.contact_name_given != ""} {$row.contact_name_given} {$row.contact_name_family} @@ -18,7 +18,3 @@ {assign var=x value=$x+1} {/foreach} - - - - diff --git a/resources/templates/provision/mitel/5324/MN_{$mac}.cfg b/resources/templates/provision/mitel/5324/MN_{$mac}.cfg index 032e4ac9b0..1d568b2548 100644 --- a/resources/templates/provision/mitel/5324/MN_{$mac}.cfg +++ b/resources/templates/provision/mitel/5324/MN_{$mac}.cfg @@ -266,31 +266,22 @@ 0 0 - - - - - - - - - - - - - - - - - - - - - - - - - + +{foreach $keys as $row} +{if $row.device_key_line == "1"}{$feature = "6"}{$user_id = $user_id_1}{/if} +{if $row.device_key_line == "2"}{$feature = "7"}{$user_id = $user_id_2}{/if} +{if $row.device_key_line == "3"}{$feature = "8"}{$user_id = $user_id_3}{/if} +{if $row.device_key_line == "4"}{$feature = "9"}{$user_id = $user_id_4}{/if} +{if $row.device_key_line == "5"}{$feature = "10"}{$user_id = $user_id_5}{/if} +{if $row.device_key_line == "6"}{$feature = "11"}{$user_id = $user_id_6}{/if} +{if $row.device_key_line == "7"}{$feature = "12"}{$user_id = $user_id_7}{/if} +{if $row.device_key_line == "8"}{$feature = "13"}{$user_id = $user_id_8}{/if} +{if $row.device_key_type == "6"} + +{else} + +{/if} +{/foreach} 1 diff --git a/resources/templates/provision/mitel/5330/MN_Generic.cfg b/resources/templates/provision/mitel/5330/MN_Generic.cfg new file mode 100644 index 0000000000..5a3c0ee683 --- /dev/null +++ b/resources/templates/provision/mitel/5330/MN_Generic.cfg @@ -0,0 +1,12 @@ + + 2 + {$domain_name}/app/provision + + + 2 + {$domain_name}/app/provision + + + 2 + {$domain_name}/app/provision + \ No newline at end of file diff --git a/resources/templates/provision/mitel/5330/MN_{$mac}.cfg b/resources/templates/provision/mitel/5330/MN_{$mac}.cfg new file mode 100644 index 0000000000..bd9647783d --- /dev/null +++ b/resources/templates/provision/mitel/5330/MN_{$mac}.cfg @@ -0,0 +1,356 @@ + + 1 + {if isset($mitel_tftp_config)}{$mitel_tftp_config}{else}2 + {/if}0 + 1 + 02.00.00.24 + R7.2.02.00.00.24 + 0 + 0 + 0 + 5060 + 0 + -1 + {if isset($mitel_vlan_id)}{$mitel_vlan_id}{else}-1 + {/if}sip1 + -example.com + 0 + 0 + operator@example.com + 0 + + + + + + + + 1 + 12 + 1 + 1 + 0 + 1 + + 135.199.77.12 + 135.199.77.12 + 128.138.141.172 + {$mitel_time_zone} + 2 + 120 + + 0.0.0.0 + 5060 + 5 + 20 + 0 + 0 + 101 + 0 + 0 + + 0 + 0 + 10 + + 1 + 60 + 0 + + ****** + 0 + 0 + 0 + 0 + admin + Administrator + 510731ac096ebcb3989fb1ed5b7075bb + 0 + + 0 + + 0 + 0 + 4 + + 0 + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 80 + 443 + 1 + 4 + 1 + 0 + 0 + + 0 + 213.192.59.75 + + 0 + 20000 + 20998 + 0 + 0 + 3 + 0 + en_US + US + 1 + 3 + 2 + 1 + 11 + 1 + 1 + 2 + 201 + {$domain_name}/app/provision + + 1 + + 0 + 3 + 0 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + +{foreach $keys as $row} +{if $row.device_key_line == "1"}{$feature = "6"}{$user_id = $user_id_1}{/if} +{if $row.device_key_line == "2"}{$feature = "7"}{$user_id = $user_id_2}{/if} +{if $row.device_key_line == "3"}{$feature = "8"}{$user_id = $user_id_3}{/if} +{if $row.device_key_line == "4"}{$feature = "9"}{$user_id = $user_id_4}{/if} +{if $row.device_key_line == "5"}{$feature = "10"}{$user_id = $user_id_5}{/if} +{if $row.device_key_line == "6"}{$feature = "11"}{$user_id = $user_id_6}{/if} +{if $row.device_key_line == "7"}{$feature = "12"}{$user_id = $user_id_7}{/if} +{if $row.device_key_line == "8"}{$feature = "13"}{$user_id = $user_id_8}{/if} +{if $row.device_key_type == "6"} + +{else} + +{/if} +{/foreach} + + + 1 + 1 + 1 + 1 + 1 + 0 + ****** + 1440 + 1 + 1440 + 23 + 59 + 1 + + 5d41402abc4b2a76b9719d911017c592 + + + sip + {$voicemail_number} + 1 + + 90 + + {foreach $lines as $row} + + + {/foreach} + + + + + 7.2 + \ No newline at end of file diff --git a/resources/templates/provision/mitel/5340/MN_{$mac}.cfg b/resources/templates/provision/mitel/5340/MN_{$mac}.cfg index 0cc9e1d55b..1d568b2548 100644 --- a/resources/templates/provision/mitel/5340/MN_{$mac}.cfg +++ b/resources/templates/provision/mitel/5340/MN_{$mac}.cfg @@ -1,4 +1,4 @@ - + 1 {if isset($mitel_tftp_config)}{$mitel_tftp_config}{else}2 {/if}0 @@ -266,31 +266,22 @@ 0 0 - - - - - - - - - - - - - - - - - - - - - - - - - + +{foreach $keys as $row} +{if $row.device_key_line == "1"}{$feature = "6"}{$user_id = $user_id_1}{/if} +{if $row.device_key_line == "2"}{$feature = "7"}{$user_id = $user_id_2}{/if} +{if $row.device_key_line == "3"}{$feature = "8"}{$user_id = $user_id_3}{/if} +{if $row.device_key_line == "4"}{$feature = "9"}{$user_id = $user_id_4}{/if} +{if $row.device_key_line == "5"}{$feature = "10"}{$user_id = $user_id_5}{/if} +{if $row.device_key_line == "6"}{$feature = "11"}{$user_id = $user_id_6}{/if} +{if $row.device_key_line == "7"}{$feature = "12"}{$user_id = $user_id_7}{/if} +{if $row.device_key_line == "8"}{$feature = "13"}{$user_id = $user_id_8}{/if} +{if $row.device_key_type == "6"} + +{else} + +{/if} +{/foreach} 1 diff --git a/resources/templates/provision/polycom/4.x/{$mac}.cfg b/resources/templates/provision/polycom/4.x/{$mac}.cfg index c8f8e4a624..5501ca8a29 100644 --- a/resources/templates/provision/polycom/4.x/{$mac}.cfg +++ b/resources/templates/provision/polycom/4.x/{$mac}.cfg @@ -49,7 +49,7 @@ tcpIpApp.sntp.daylightSavings.stop.dayOfWeek.lastInMonth="0" />