From 7b9038fc0bb17ad9eec99a447c1a9409e3d461ca Mon Sep 17 00:00:00 2001 From: Matthew Vale Date: Mon, 7 Dec 2015 17:32:20 +0000 Subject: [PATCH 1/8] changed label to text[*] --- app/system/app_languages.php | 10 ++++++++++ app/system/system.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/system/app_languages.php b/app/system/app_languages.php index f7a67d4e6c..f0c4985ccb 100644 --- a/app/system/app_languages.php +++ b/app/system/app_languages.php @@ -80,6 +80,16 @@ $text['label-os']['sv-se'] = "Operativsystem"; $text['label-os']['uk'] = "Операційна система "; $text['label-os']['de-at'] = "Betriebssystem"; +$text['label-version']['en-us'] = "Version"; +$text['label-version']['es-cl'] = ""; +$text['label-version']['pt-pt'] = ""; +$text['label-version']['fr-fr'] = ""; +$text['label-version']['pt-br'] = ""; +$text['label-version']['pl'] = ""; +$text['label-version']['sv-se'] = ""; +$text['label-version']['uk'] = ""; +$text['label-version']['de-at'] = ""; + $text['label-git_info']['en-us'] = "Git Information"; $text['label-git_info']['es-cl'] = ""; $text['label-git_info']['pt-pt'] = ""; diff --git a/app/system/system.php b/app/system/system.php index 59a42528b7..510f1aa4eb 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -78,7 +78,7 @@ $document['title'] = $text['title-sys-status']; if (permission_exists('system_view_info')) { echo "\n"; echo " \n"; - echo " Version\n"; + echo " ".$text['label-version']."\n"; echo " \n"; echo " \n"; echo " ".software_version()."\n"; From 47d8040fed7b4d248f4c15d25e7ddb87f2cdcd51 Mon Sep 17 00:00:00 2001 From: Matthew Vale Date: Mon, 7 Dec 2015 17:37:41 +0000 Subject: [PATCH 2/8] use $git_path to determine if it is a git install --- app/system/system.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/app/system/system.php b/app/system/system.php index 510f1aa4eb..84fa5e9ac6 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -86,22 +86,24 @@ $document['title'] = $text['title-sys-status']; echo "\n"; $git_path = normalize_path_to_os($_SERVER["DOCUMENT_ROOT"]."/.git"); - $git_branch = shell_exec('git --git-dir='.$git_path.' name-rev --name-only HEAD'); - rtrim($git_branch); - $git_commit = shell_exec('git --git-dir='.$git_path.' rev-parse HEAD'); - rtrim($git_commit); - $git_origin = shell_exec('git --git-dir='.$git_path.' config --get remote.origin.url'); - rtrim($git_commit); - echo "\n"; - echo " \n"; - echo " ".$text['label-git_info']."\n"; - echo " \n"; - echo " \n"; - echo " ".$text['label-git_branch']." ".$git_branch."
\n"; - echo " ".$text['label-git_commit']." ".$git_commit."
\n"; - echo " ".$text['label-git_origin']." ".$git_origin."
\n"; - echo " \n"; - echo "\n"; + if(file_exists($git_path)){ + $git_branch = shell_exec('git --git-dir='.$git_path.' name-rev --name-only HEAD'); + rtrim($git_branch); + $git_commit = shell_exec('git --git-dir='.$git_path.' rev-parse HEAD'); + rtrim($git_commit); + $git_origin = shell_exec('git --git-dir='.$git_path.' config --get remote.origin.url'); + rtrim($git_commit); + echo "\n"; + echo " \n"; + echo " ".$text['label-git_info']."\n"; + echo " \n"; + echo " \n"; + echo " ".$text['label-git_branch']." ".$git_branch."
\n"; + echo " ".$text['label-git_commit']." ".$git_commit."
\n"; + echo " ".$text['label-git_origin']." ".$git_origin."
\n"; + echo " \n"; + echo "\n"; + } echo "\n"; From cabf031cc031534165c3b31e6c931e9d29023a0b Mon Sep 17 00:00:00 2001 From: Matthew Vale Date: Mon, 7 Dec 2015 21:19:59 +0000 Subject: [PATCH 4/8] Fixed temp_dir not getting set correctly this would have also affected backup_dir --- core/install/resources/classes/global_settings.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/install/resources/classes/global_settings.php b/core/install/resources/classes/global_settings.php index 251153e5d2..8d10cfd716 100644 --- a/core/install/resources/classes/global_settings.php +++ b/core/install/resources/classes/global_settings.php @@ -142,17 +142,21 @@ require_once "root.php"; throw new Exception("No detect_switch was passed to me but \$_SESSION['switch'] is empty!"); } foreach ($this->_switch_dirs as $dir){ + $category = 'switch'; $session_var; preg_match( '/^switch_(.*)_dir$/', $dir, $session_var); $dir = "_$dir"; if($session_var[1] == 'script'){ $session_var[1] = 'scripts'; } - $this->$dir = $_SESSION['switch'][$session_var[1]]['dir']; + if($session_var[1] == 'temp'){ $category = 'server'; } + $this->$dir = $_SESSION[$category][$session_var[1]]['dir']; } foreach ($this->_switch_vdirs as $vdir){ + $category = 'switch'; $session_var; preg_match( '/^switch_(.*)_vdir$/', $vdir, $session_var); $vdir = "_$vdir"; - $this->$vdir = $_SESSION['switch'][$session_var[1]]['dir']; + if($session_var[1] == 'backup'){ $category = 'server'; } + $this->$vdir = $_SESSION[$category][$session_var[1]]['dir']; } $this->_switch_event_host = $_SESSION['event_socket_ip_address']; $this->_switch_event_port = $_SESSION['event_socket_port']; From 595609e2671528b4cfa2f09ae5bfa51501fb9e84 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 7 Dec 2015 16:30:03 -0700 Subject: [PATCH 5/8] Prevent the conference alone sound from playing twice. --- resources/install/scripts/app/conference_center/index.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/install/scripts/app/conference_center/index.lua b/resources/install/scripts/app/conference_center/index.lua index e9adc15b7e..08d43c42a6 100644 --- a/resources/install/scripts/app/conference_center/index.lua +++ b/resources/install/scripts/app/conference_center/index.lua @@ -150,9 +150,6 @@ --recording = session:getVariable("recording"); domain_name = session:getVariable("domain_name"); - --add the domain name to the recordings directory - recordings_dir = recordings_dir .. "/"..domain_name; - --set the end epoch end_epoch = os.time(); @@ -710,7 +707,7 @@ --there is one other member in this conference session:execute("playback", sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/conference/conf-one_other_member_conference.wav"); elseif (member_count == "0") then - session:execute("playback", sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/conference/conf-alone.wav"); + --conference profile defines the alone sound file else --say the count session:execute("say", default_language.." number pronounced "..member_count); From f77cadfbe68fcf2aab73cac757230b1d3d5ab25b Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 7 Dec 2015 18:02:56 -0700 Subject: [PATCH 6/8] Fix the call center agent contact string include the domain by adding the sip_invite_domain with the domain name. --- app/call_centers/call_center_agent_edit.php | 35 ++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/app/call_centers/call_center_agent_edit.php b/app/call_centers/call_center_agent_edit.php index e72dc42c19..34002e36ac 100644 --- a/app/call_centers/call_center_agent_edit.php +++ b/app/call_centers/call_center_agent_edit.php @@ -129,48 +129,47 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //get and then set the complete agent_contact with the call_timeout and when necessary confirm //if you change this variable, also change resources/switch.php - $tmp_confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout=".$agent_call_timeout; + $confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout=".$agent_call_timeout; if(strstr($agent_contact, '}') === FALSE) { //not found if(stristr($agent_contact, 'sofia/gateway') === FALSE) { //add the call_timeout - $tmp_agent_contact = "{call_timeout=".$agent_call_timeout."}".$agent_contact; + $agent_contact = "{call_timeout=".$agent_call_timeout.",sip_invite_domain=".$_SESSION['domain_name']."}".$agent_contact; } else { //add the call_timeout and confirm - $tmp_agent_contact = $tmp_first.',call_timeout='.$agent_call_timeout.$tmp_last; - $tmp_agent_contact = "{".$tmp_confirm.",call_timeout=".$agent_call_timeout."}".$agent_contact; - echo "\n\n".$tmp_agent_contact."\n\n"; + $agent_contact = $first.',call_timeout='.$agent_call_timeout.$last; + $agent_contact = "{".$confirm.",call_timeout=".$agent_call_timeout.",sip_invite_domain=".$_SESSION['domain_name']."}".$agent_contact; + echo "\n\n".$agent_contact."\n\n"; } } else { //found if(stristr($agent_contact, 'sofia/gateway') === FALSE) { //not found + $position = strrpos($agent_contact, "}"); + $first = substr($agent_contact, 0, $position); + $last = substr($agent_contact, $position); if(stristr($agent_contact, 'call_timeout') === FALSE) { - //add the call_timeout - $tmp_pos = strrpos($agent_contact, "}"); - $tmp_first = substr($agent_contact, 0, $tmp_pos); - $tmp_last = substr($agent_contact, $tmp_pos); - $tmp_agent_contact = $tmp_first.',call_timeout='.$agent_call_timeout.$tmp_last; + $call_timeout = ',call_timeout='.$agent_call_timeout; } else { - //the string has the call timeout - $tmp_agent_contact = $agent_contact; + $call_timeout = ''; } + $agent_contact = $first.',sip_invite_domain='.$_SESSION['domain_name'].$call_timeout.$last; } else { //found - $tmp_pos = strrpos($agent_contact, "}"); - $tmp_first = substr($agent_contact, 0, $tmp_pos); - $tmp_last = substr($agent_contact, $tmp_pos); + $position = strrpos($agent_contact, "}"); + $first = substr($agent_contact, 0, $position); + $last = substr($agent_contact, $position); if(stristr($agent_contact, 'call_timeout') === FALSE) { //add the call_timeout and confirm - $tmp_agent_contact = $tmp_first.','.$tmp_confirm.',call_timeout='.$agent_call_timeout.$tmp_last; + $agent_contact = $first.','.$confirm.',sip_invite_domain='.$_SESSION['domain_name'].'call_timeout='.$agent_call_timeout.$last; } else { //add confirm - $tmp_agent_contact = $tmp_first.','.$tmp_confirm.$tmp_last; + $agent_contact = $first.',sip_invite_domain='.$_SESSION['domain_name'].','.$confirm.$last; } } } @@ -193,7 +192,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $response = event_socket_request($fp, $cmd); usleep(200); //agent set contact - $cmd = "api callcenter_config agent set contact ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$tmp_agent_contact; + $cmd = "api callcenter_config agent set contact ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$agent_contact; $response = event_socket_request($fp, $cmd); usleep(200); //agent set status From 92083dea750cf582516de355a6d3b8747146e84b Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 7 Dec 2015 21:45:24 -0700 Subject: [PATCH 7/8] Add ^.*$| to local_extension to support dialing non numeric usernames. --- .../resources/switch/conf/dialplan/999_local_extension.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml index a53fda713e..f0ba159730 100644 --- a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml +++ b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml @@ -1,6 +1,6 @@ - + From c675f2b9b3ec3bc1873468c2fd5df52a28b572a8 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 7 Dec 2015 22:09:27 -0700 Subject: [PATCH 8/8] Add user_exists condition to local_extension to compensate for the fact we allow dialing an extension based on a non numeric username. --- .../resources/switch/conf/dialplan/999_local_extension.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml index f0ba159730..10c28b8df0 100644 --- a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml +++ b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml @@ -1,5 +1,6 @@ +