From 7c18a6585d1fdde7d9ae76e8ff5f4603163bb31d Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Mon, 17 Aug 2015 16:46:53 +0400 Subject: [PATCH 1/8] Fix. Eavesdrop by operator_panel with extension with number-aliases --- app/operator_panel/index_inc.php | 13 +++++++++---- .../resources/functions/get_call_activity.php | 2 ++ resources/switch.php | 5 +++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/operator_panel/index_inc.php b/app/operator_panel/index_inc.php index a1579b9ec1..e28c3f4425 100644 --- a/app/operator_panel/index_inc.php +++ b/app/operator_panel/index_inc.php @@ -100,7 +100,7 @@ echo " "; if (permission_exists('operator_panel_eavesdrop')) { echo " "; if (sizeof($_SESSION['user']['extensions']) > 1) { - echo " "; + echo " "; echo " "; echo " \n"; } else if (sizeof($_SESSION['user']['extensions']) == 1) { - echo " "; + echo " "; } echo " "; } @@ -219,7 +219,12 @@ foreach ($activity as $extension => $ext) { $call_identifier = $ext['variable_bridge_uuid']; } else { - $call_identifier = $ext['call_uuid']; // transfer all other call types + if( $ext['call_uuid'] ) { + $call_identifier = $ext['call_uuid']; // transfer all other call types + } + else { + $call_identifier = $ext['uuid']; // e.g. voice menus + } } //determine extension draggable state @@ -328,7 +333,7 @@ foreach ($activity as $extension => $ext) { } //eavesdrop if (permission_exists('operator_panel_eavesdrop') && $ext_state == 'active' && sizeof($_SESSION['user']['extensions']) > 0 && !in_array($extension, $_SESSION['user']['extensions'])) { - $block .= ""; + $block .= ""; } //kill if (permission_exists('operator_panel_kill') || in_array($extension, $_SESSION['user']['extensions'])) { diff --git a/app/operator_panel/resources/functions/get_call_activity.php b/app/operator_panel/resources/functions/get_call_activity.php index 3490a159dd..fd3b224ca1 100644 --- a/app/operator_panel/resources/functions/get_call_activity.php +++ b/app/operator_panel/resources/functions/get_call_activity.php @@ -85,6 +85,7 @@ function get_call_activity() { $array[$x]["call_uuid"] = null; $array[$x]["sent_callee_name"] = null; $array[$x]["sent_callee_num"] = null; + $array[$x]["destination"] = null; //add the active call details $found = false; @@ -134,6 +135,7 @@ function get_call_activity() { $array[$x]["call_uuid"] = $field['call_uuid']; $array[$x]["sent_callee_name"] = $field['sent_callee_name']; $array[$x]["sent_callee_num"] = $field['sent_callee_num']; + $array[$x]["destination"] = $user; //calculate and set the call length $call_length_seconds = time() - $array[$x]["created_epoch"]; diff --git a/resources/switch.php b/resources/switch.php index 9ee5d78901..753639d677 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -83,8 +83,13 @@ function load_extensions() { if (count($result) > 0) { $x = 0; foreach($result as $row) { + $destination = $row['extension']; + if (strlen($row['number_alias']) > 0) { + $destination = $row['number_alias']; + } $_SESSION['user']['extension'][$x]['user'] = $row['extension']; $_SESSION['user']['extension'][$x]['number_alias'] = $row['number_alias']; + $_SESSION['user']['extension'][$x]['destination'] = $destination; $_SESSION['user']['extension'][$x]['extension_uuid'] = $row['extension_uuid']; $_SESSION['user']['extension'][$x]['outbound_caller_id_name'] = $row['outbound_caller_id_name']; $_SESSION['user']['extension'][$x]['outbound_caller_id_number'] = $row['outbound_caller_id_number']; From 6a93e34dabc8af63f1e81e4734a4c84b50165636 Mon Sep 17 00:00:00 2001 From: koldoa Date: Mon, 17 Aug 2015 16:27:37 +0200 Subject: [PATCH 2/8] New key type for aastra devices --- app/devices/app_languages.php | 26 ++++++++++++++++++++++++++ app/devices/device_edit.php | 7 ++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php index caa5dc1b5c..97e94503b8 100644 --- a/app/devices/app_languages.php +++ b/app/devices/app_languages.php @@ -1689,6 +1689,32 @@ $text['label-blf']['de-at'] = "BLF"; $text['label-blf']['ar-eg'] = ""; $text['label-blf']['he'] = ""; +$text['label-callers']['en-us'] = "Callers"; +$text['label-callers']['es-cl'] = "Llaamadas"; +$text['label-callers']['pt-pt'] = ""; +$text['label-callers']['fr-fr'] = ""; +$text['label-callers']['pt-br'] = ""; +$text['label-callers']['pl'] = "BLF Xfer "; +$text['label-callers']['uk'] = ""; +$text['label-callers']['sv-se'] = ""; +$text['label-callers']['ro'] = ""; +$text['label-callers']['de-at'] = ""; +$text['label-callers']['ar-eg'] = ""; +$text['label-callers']['he'] = ""; + +$text['label-xfer']['en-us'] = "Xfer"; +$text['label-xfer']['es-cl'] = "Xfer"; +$text['label-xfer']['pt-pt'] = ""; +$text['label-xfer']['fr-fr'] = ""; +$text['label-xfer']['pt-br'] = ""; +$text['label-xfer']['pl'] = "Xfer "; +$text['label-xfer']['uk'] = ""; +$text['label-xfer']['sv-se'] = ""; +$text['label-xfer']['ro'] = ""; +$text['label-xfer']['de-at'] = ""; +$text['label-xfer']['ar-eg'] = ""; +$text['label-xfer']['he'] = ""; + $text['label-automata']['en-us'] = "automata"; $text['label-automata']['es-cl'] = "automata"; $text['label-automata']['pt-pt'] = "automata"; diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 7b363d6013..f484d7494a 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -880,16 +880,21 @@ require_once "resources/require.php"; if (strtolower($device_vendor) == "aastra" || strlen($device_vendor) == 0 || strlen($device_username) > 0) { echo ""; ?> - + + + + + "; } } if (strtolower($device_vendor) == "cisco" || strlen($device_vendor) == 0 || strlen($device_username) > 0) { echo ""; ?> + Date: Mon, 17 Aug 2015 16:29:55 +0200 Subject: [PATCH 3/8] New key type for aastra devices --- app/devices/app_languages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php index 97e94503b8..75ecf92aa3 100644 --- a/app/devices/app_languages.php +++ b/app/devices/app_languages.php @@ -1694,7 +1694,7 @@ $text['label-callers']['es-cl'] = "Llaamadas"; $text['label-callers']['pt-pt'] = ""; $text['label-callers']['fr-fr'] = ""; $text['label-callers']['pt-br'] = ""; -$text['label-callers']['pl'] = "BLF Xfer "; +$text['label-callers']['pl'] = ""; $text['label-callers']['uk'] = ""; $text['label-callers']['sv-se'] = ""; $text['label-callers']['ro'] = ""; From aa647adde382b07759b771424b07c8957c7c7bbd Mon Sep 17 00:00:00 2001 From: koldoa Date: Mon, 17 Aug 2015 16:31:46 +0200 Subject: [PATCH 4/8] View current logged members per fifo queue --- app/fifo_list/fifo_interactive_inc.php | 48 ++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/app/fifo_list/fifo_interactive_inc.php b/app/fifo_list/fifo_interactive_inc.php index 114140ea6d..0761c53436 100644 --- a/app/fifo_list/fifo_interactive_inc.php +++ b/app/fifo_list/fifo_interactive_inc.php @@ -188,5 +188,53 @@ else { if ($c==0) { $c=1; } else { $c=0; } } echo "\n"; + + + //Current logged members + //set the alternating row styles + $c = 0; + $row_style["0"] = "row_style0"; + $row_style["1"] = "row_style1"; + + //response div tag + echo "
\n"; + echo "
\n"; + echo "

Logged in agents

\n"; + + + //show the content + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + //print_r($xml->fifo->outbound->member[0]); + //print_r($xml->fifo->outbound->member[1]); + + + foreach ($xml->fifo->outbound->member as $row) { + + + + $username=explode("@",$row); + $username=explode("/",$username[0]); + $username=$username[1]; + + $fifo_duration_formatted=$row["logged-on-since"]; + $fifo_total_inbound_calls=$row["outbound-call-total-count"]; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($c==0) { $c=1; } else { $c=0; } + } + echo "
".$text['label-username']."Total inbound callsLogged on since
$username  $fifo_total_inbound_calls  $fifo_duration_formatted  
\n"; } ?> From 8442ea979e4f43708ad73bb4c807ba7f816bd694 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 18 Aug 2015 15:38:41 +0400 Subject: [PATCH 5/8] Change. Use bind_bind_digit instead of bind_meta_app. Change. Allow transfer and turn on recordings only for authorized users. Fix. Use record_ext in recording in ring_group. This allow configure other dtmf sequence like `*#` and `##` --- app/devices/device_edit.php | 2 +- .../conf/dialplan/999_local_extension.xml | 27 +++++++++++++------ .../install/scripts/app/ring_groups/index.lua | 27 +++++++++++++------ 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index f484d7494a..90a31a0c4c 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -880,7 +880,7 @@ require_once "resources/require.php"; if (strtolower($device_vendor) == "aastra" || strlen($device_vendor) == 0 || strlen($device_username) > 0) { echo ""; ?> - + 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 bfe432fd99..b16cc3c5b7 100644 --- a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml +++ b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml @@ -2,14 +2,25 @@ - - + - - - - - + + + + + + + + + + + + + + + + + @@ -31,7 +42,7 @@ - + diff --git a/resources/install/scripts/app/ring_groups/index.lua b/resources/install/scripts/app/ring_groups/index.lua index 336f5ace28..4f6b59f1c4 100644 --- a/resources/install/scripts/app/ring_groups/index.lua +++ b/resources/install/scripts/app/ring_groups/index.lua @@ -69,9 +69,8 @@ if (not default_voice) then default_voice = 'callie'; end --get record_ext - if (session:getVariable("record_ext")) then - record_ext = session:getVariable("record_ext"); - else + record_ext = session:getVariable("record_ext"); + if (not record_ext) then record_ext = "wav"; end @@ -491,11 +490,23 @@ session:execute("set", "hangup_after_bridge=true"); session:execute("set", "continue_on_fail=true"); - --set bind meta app - session:execute("bind_meta_app", "1 ab s execute_extension::dx XML "..context); - session:execute("bind_meta_app", "2 ab s record_session::"..recordings_dir.."/archive/"..os.date("%Y").."/"..os.date("%m").."/"..os.date("%d").."}/"..uuid..".wav"); - session:execute("bind_meta_app", "3 ab s execute_extension::cf XML "..context); - session:execute("bind_meta_app", "4 ab s execute_extension::att_xfer XML "..context); + local bind_target = 'peer' + if session:getVariable("sip_authorized") == "true" then + bind_target = 'both' + end + + --set bind digit action + local record_file = recordings_dir.."/archive/"..os.date("%Y").."/"..os.date("%m").."/"..os.date("%d").."}/"..uuid..".".record_ext + local bindings = { + "local,*1,exec:execute_extension,dx XML " .. context, + "local,*2,exec:record_session," .. record_file, + "local,*3,exec:execute_extension,cf XML " .. context, + "local,*4,exec:execute_extension,att_xfer XML " .. context, + } + for _, str in ipairs(bindings) do + session:execute("bind_digit_action", str .. "," .. bind_target) + end + session:execute("digit_action_set_realm", "local") --if the user is busy rollover to the next destination if (ring_group_strategy == "rollover") then From b0ce96ee03094caf79b720911221083064a68b6b Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 18 Aug 2015 15:42:14 +0400 Subject: [PATCH 6/8] Fix. Set voicemail ID. --- .../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 b16cc3c5b7..70a92f6f99 100644 --- a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml +++ b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml @@ -42,7 +42,7 @@ - + From 42a15cab448348956b180efe751affd2955332ca Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 18 Aug 2015 15:49:56 +0400 Subject: [PATCH 7/8] Fix. Concatenate record extension --- resources/install/scripts/app/ring_groups/index.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/install/scripts/app/ring_groups/index.lua b/resources/install/scripts/app/ring_groups/index.lua index 4f6b59f1c4..9eccc2545d 100644 --- a/resources/install/scripts/app/ring_groups/index.lua +++ b/resources/install/scripts/app/ring_groups/index.lua @@ -496,7 +496,7 @@ end --set bind digit action - local record_file = recordings_dir.."/archive/"..os.date("%Y").."/"..os.date("%m").."/"..os.date("%d").."}/"..uuid..".".record_ext + local record_file = recordings_dir.."/archive/"..os.date("%Y").."/"..os.date("%m").."/"..os.date("%d").."}/"..uuid.."."..record_ext local bindings = { "local,*1,exec:execute_extension,dx XML " .. context, "local,*2,exec:record_session," .. record_file, From 72cb20f6c4d44bcb6f73790a97349984b6900093 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Wed, 19 Aug 2015 10:06:22 +0400 Subject: [PATCH 8/8] Revert. Both legs can control of call. --- .../switch/conf/dialplan/999_local_extension.xml | 3 ++- resources/install/scripts/app/ring_groups/index.lua | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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 70a92f6f99..e383b8dabb 100644 --- a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml +++ b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml @@ -9,7 +9,8 @@ - + + diff --git a/resources/install/scripts/app/ring_groups/index.lua b/resources/install/scripts/app/ring_groups/index.lua index 9eccc2545d..fed00574a0 100644 --- a/resources/install/scripts/app/ring_groups/index.lua +++ b/resources/install/scripts/app/ring_groups/index.lua @@ -490,10 +490,10 @@ session:execute("set", "hangup_after_bridge=true"); session:execute("set", "continue_on_fail=true"); - local bind_target = 'peer' - if session:getVariable("sip_authorized") == "true" then - bind_target = 'both' - end + local bind_target = 'both' + -- if session:getVariable("sip_authorized") ~= "true" then + -- bind_target = 'peer' + -- end --set bind digit action local record_file = recordings_dir.."/archive/"..os.date("%Y").."/"..os.date("%m").."/"..os.date("%d").."}/"..uuid.."."..record_ext