diff --git a/app/calls_active/app_config.php b/app/calls_active/app_config.php index 01031de88b..3a0a9a55fa 100644 --- a/app/calls_active/app_config.php +++ b/app/calls_active/app_config.php @@ -31,25 +31,29 @@ //permission details $y=0; - $apps[$x]['permissions'][0]['name'] = "call_active_view"; - $apps[$x]['permissions'][0]['menu']['uuid'] = "eba3d07f-dd5c-6b7b-6880-493b44113ade"; - $apps[$x]['permissions'][0]['groups'][] = "superadmin"; - $apps[$x]['permissions'][0]['groups'][] = "admin"; + $apps[$x]['permissions'][$y]['name'] = "call_active_view"; + $apps[$x]['permissions'][$y]['menu']['uuid'] = "eba3d07f-dd5c-6b7b-6880-493b44113ade"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; //$y++; - //$apps[$x]['permissions'][1]['name'] = "call_active_transfer"; - //$apps[$x]['permissions'][1]['groups'][] = "superadmin"; + //$apps[$x]['permissions'][$y]['name'] = "call_active_transfer"; + //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; - $apps[$x]['permissions'][2]['name'] = "call_active_hangup"; - $apps[$x]['permissions'][2]['groups'][] = "superadmin"; - $apps[$x]['permissions'][2]['groups'][] = "admin"; - //$y++; - //$apps[$x]['permissions'][3]['name'] = "call_active_park"; - //$apps[$x]['permissions'][3]['groups'][] = "superadmin"; - //$y++; - //$apps[$x]['permissions'][4]['name'] = "call_active_rec"; - //$apps[$x]['permissions'][4]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['name'] = "call_active_eavesdrop"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; - $apps[$x]['permissions'][5]['name'] = "call_active_all"; - $apps[$x]['permissions'][5]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['name'] = "call_active_hangup"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + //$y++; + //$apps[$x]['permissions'][$y]['name'] = "call_active_park"; + //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + //$y++; + //$apps[$x]['permissions'][$y]['name'] = "call_active_rec"; + //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "call_active_all"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; ?> diff --git a/app/calls_active/app_languages.php b/app/calls_active/app_languages.php index 0d3dbab2c2..3dbcb0d714 100644 --- a/app/calls_active/app_languages.php +++ b/app/calls_active/app_languages.php @@ -600,6 +600,31 @@ $text['label-app']['zh-cn'] = "应用"; $text['label-app']['ja-jp'] = "応用"; $text['label-app']['ko-kr'] = "애플리케이션"; +$text['label-eavesdrop']['en-us'] = "Eavesdrop"; +$text['label-eavesdrop']['en-gb'] = "Eavesdrop"; +$text['label-eavesdrop']['ar-eg'] = "التنصت"; +$text['label-eavesdrop']['de-at'] = "Mithören"; +$text['label-eavesdrop']['de-ch'] = "Mithören"; +$text['label-eavesdrop']['de-de'] = "Mithören"; +$text['label-eavesdrop']['el-gr'] = "Αφουγκράζομαι"; +$text['label-eavesdrop']['es-cl'] = "Escuchar"; +$text['label-eavesdrop']['es-mx'] = "Escuchar"; +$text['label-eavesdrop']['fr-ca'] = "Espionner"; +$text['label-eavesdrop']['fr-fr'] = "Espionner"; +$text['label-eavesdrop']['he-il'] = "לְצוֹתֵת"; +$text['label-eavesdrop']['it-it'] = "Ascolta"; +$text['label-eavesdrop']['nl-nl'] = "Afluisteren"; +$text['label-eavesdrop']['pl-pl'] = "Podsłuchiwanie"; +$text['label-eavesdrop']['pt-br'] = "Investigar"; +$text['label-eavesdrop']['pt-pt'] = "Bisbilhotar"; +$text['label-eavesdrop']['ro-ro'] = "Trage cu urechea"; +$text['label-eavesdrop']['ru-ru'] = "Подслушивать"; +$text['label-eavesdrop']['sv-se'] = "Medlyssning"; +$text['label-eavesdrop']['uk-ua'] = "підслуховувати"; +$text['label-eavesdrop']['zh-cn'] = "窃听"; +$text['label-eavesdrop']['ja-jp'] = "盗聴"; +$text['label-eavesdrop']['ko-kr'] = "엿듣다"; + $text['description-2']['en-us'] = "Use this to view all extensions and monitor and interact with active calls."; $text['description-2']['en-gb'] = "Use this to view all extensions and monitor and interact with active calls."; $text['description-2']['ar-eg'] = "استخدم هذا لعرض جميع الملحقات ومراقبة المكالمات النشطة والتفاعل معها."; @@ -650,6 +675,31 @@ $text['description']['zh-cn'] = "使用它来监视活动呼叫并与之交互 $text['description']['ja-jp'] = "これを使用して、アクティブな通話を監視し、対話します。"; $text['description']['ko-kr'] = "이를 사용하여 활성 통화를 모니터링하고 상호 작용합니다."; +$text['description-eavesdrop_destination']['en-us'] = "Select the Eavesdrop Destination"; +$text['description-eavesdrop_destination']['en-gb'] = "Select the Eavesdrop Destination"; +$text['description-eavesdrop_destination']['ar-eg'] = "حدد وجهة Eavesdrop"; +$text['description-eavesdrop_destination']['de-at'] = "Wählen Sie ein Ziel zum Mithören"; +$text['description-eavesdrop_destination']['de-ch'] = "Wählen Sie ein Ziel zum Mithören"; +$text['description-eavesdrop_destination']['de-de'] = "Wählen Sie ein Ziel zum Mithören"; +$text['description-eavesdrop_destination']['el-gr'] = "Επιλέξτε τον προορισμό EAVESDROP"; +$text['description-eavesdrop_destination']['es-cl'] = "Seleccione el Eavesdrop Destino"; +$text['description-eavesdrop_destination']['es-mx'] = "Seleccione el Eavesdrop Destino"; +$text['description-eavesdrop_destination']['fr-ca'] = "Sélectionnez la destination d'espionnage"; +$text['description-eavesdrop_destination']['fr-fr'] = "Sélectionnez la destination d'espionnage"; +$text['description-eavesdrop_destination']['he-il'] = "בחר ביעד האזנת סתר"; +$text['description-eavesdrop_destination']['it-it'] = "Seleziona la Destinazione d'Ascolto"; +$text['description-eavesdrop_destination']['nl-nl'] = "Kies afluister bestemming"; +$text['description-eavesdrop_destination']['pl-pl'] = "Wybierz destynację podsłuchiwanych rozmów"; +$text['description-eavesdrop_destination']['pt-br'] = "Selecione o eavesdrop de destino"; +$text['description-eavesdrop_destination']['pt-pt'] = "Selecione o Eavesdrop Destino"; +$text['description-eavesdrop_destination']['ro-ro'] = "Selectați Destinația Eavesdrop"; +$text['description-eavesdrop_destination']['ru-ru'] = "Выберите подслушивание пункта назначения"; +$text['description-eavesdrop_destination']['sv-se'] = "Välj Medlyssning Destination"; +$text['description-eavesdrop_destination']['uk-ua'] = "Виберіть пункт призначення підслуховувати"; +$text['description-eavesdrop_destination']['zh-cn'] = "选择窃听目的地"; +$text['description-eavesdrop_destination']['ja-jp'] = "盗聴先を選択"; +$text['description-eavesdrop_destination']['ko-kr'] = "도청 대상 선택"; + $text['confirm-socket']['en-us'] = "Connection to Event Socket failed."; $text['confirm-socket']['en-gb'] = "Connection to Event Socket failed."; $text['confirm-socket']['ar-eg'] = "فشل الاتصال بـ Event Socket."; @@ -700,6 +750,31 @@ $text['confirm-hangup']['zh-cn'] = "你真的要挂断这个电话吗?"; $text['confirm-hangup']['ja-jp'] = "本当にこの電話を切りますか?"; $text['confirm-hangup']['ko-kr'] = "이 전화를 끊으시겠습니까?"; +$text['confirm-eavesdrop']['en-us'] = "Do you really want to eavesdrop on this call?"; +$text['confirm-eavesdrop']['en-gb'] = "Do you really want to eavesdrop on this call?"; +$text['confirm-eavesdrop']['ar-eg'] = "هل تريد حقًا التنصت على هذه المكالمة؟"; +$text['confirm-eavesdrop']['de-at'] = "Wollen Sie diesen Anruf wirklich belauschen?"; +$text['confirm-eavesdrop']['de-ch'] = "Wollen Sie diesen Anruf wirklich belauschen?"; +$text['confirm-eavesdrop']['de-de'] = "Wollen Sie diesen Anruf wirklich belauschen?"; +$text['confirm-eavesdrop']['el-gr'] = "Θέλετε πραγματικά να κρυφακούσετε αυτήν την κλήση;"; +$text['confirm-eavesdrop']['es-cl'] = "¿De verdad quieres escuchar esta llamada?"; +$text['confirm-eavesdrop']['es-mx'] = "¿De verdad quieres escuchar esta llamada?"; +$text['confirm-eavesdrop']['fr-ca'] = "Voulez-vous vraiment écouter cet appel ?"; +$text['confirm-eavesdrop']['fr-fr'] = "Voulez-vous vraiment écouter cet appel ?"; +$text['confirm-eavesdrop']['he-il'] = "האם אתה באמת רוצה לצותת לשיחה הזו?"; +$text['confirm-eavesdrop']['it-it'] = "Vuoi davvero origliare questa chiamata?"; +$text['confirm-eavesdrop']['nl-nl'] = "Wilt u dit gesprek echt afluisteren?"; +$text['confirm-eavesdrop']['pl-pl'] = "Czy na pewno chcesz podsłuchiwać tę rozmowę?"; +$text['confirm-eavesdrop']['pt-br'] = "Você realmente quer escutar esta chamada?"; +$text['confirm-eavesdrop']['pt-pt'] = "Você realmente quer escutar esta chamada?"; +$text['confirm-eavesdrop']['ro-ro'] = "Chiar vrei să asculti cu urechea la acest apel?"; +$text['confirm-eavesdrop']['ru-ru'] = "Вы действительно хотите подслушать этот звонок?"; +$text['confirm-eavesdrop']['sv-se'] = "Vill du verkligen avlyssna det här samtalet?"; +$text['confirm-eavesdrop']['uk-ua'] = "Ви дійсно хочете підслухати цей дзвінок?"; +$text['confirm-eavesdrop']['zh-cn'] = "你真的想窃听这个电话吗?"; +$text['confirm-eavesdrop']['ja-jp'] = "本当にこの通話を盗聴したいですか?"; +$text['confirm-eavesdrop']['ko-kr'] = "정말로 이 통화를 엿듣고 싶으신가요?"; + $text['confirm-hangups']['en-us'] = "Do you really want to hangup these calls?"; $text['confirm-hangups']['en-gb'] = "Do you really want to hangup these calls?"; $text['confirm-hangups']['ar-eg'] = "هل تريد حقًا إنهاء هذه المكالمات؟"; diff --git a/app/calls_active/calls_active.php b/app/calls_active/calls_active.php index ce59e0a640..0a11d1c8e8 100644 --- a/app/calls_active/calls_active.php +++ b/app/calls_active/calls_active.php @@ -61,20 +61,23 @@ ?> \n"; +echo "\n"; echo "\n"; echo "


"; @@ -118,4 +159,5 @@ require_once "resources/footer.php"; return escape(cmd); } */ -?> + +?> \ No newline at end of file diff --git a/app/calls_active/calls_active_inc.php b/app/calls_active/calls_active_inc.php index a6dc6307ce..c258bb90f3 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2019 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -116,6 +116,22 @@ echo "
".$text['title']." (".$num_rows.")
\n"; echo "
\n"; echo " ".button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'sync-alt fa-spin','onclick'=>'refresh_stop()']).""; + if (permission_exists('call_active_eavesdrop')) { + if (sizeof($_SESSION['user']['extensions']) > 1) { + echo " \n"; + echo " \n"; + echo " \n"; + } + else if (sizeof($_SESSION['user']['extensions']) == 1) { + echo " \n"; + } + } if (permission_exists('call_active_hangup') && $rows) { echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','id'=>'btn_delete','onclick'=>"refresh_stop(); modal_open('modal-hangup','btn_hangup');"]); } @@ -163,8 +179,8 @@ echo " ".$text['label-app']."\n"; echo " ".$text['label-codec']."\n"; echo " ".$text['label-secure']."\n"; - if (permission_exists('call_active_hangup')) { - echo "  \n"; + if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { + echo "  \n"; } echo "\n"; @@ -222,13 +238,20 @@ echo " ".(!empty($application) ? escape($application).":".escape($application_data) : null)." \n"; echo " ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." \n"; echo " ".escape($secure)." \n"; - if (permission_exists('call_active_hangup')) { - echo " "; - echo button::create(['type'=>'button','title'=>$text['label-hangup'],'icon'=>'phone-slash','onclick'=>"if (confirm('".$text['confirm-hangup']."')) { list_self_check('checkbox_".$x."'); list_action_set('hangup'); list_form_submit('form_list'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); - echo " \n"; + if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { + echo " \n"; + //eavesdrop + if (permission_exists('call_active_eavesdrop') && $callstate == 'ACTIVE' && sizeof($_SESSION['user']['extensions']) > 0 && !in_array($cid_num, $_SESSION['user']['extensions'])) { + echo button::create(['type'=>'button','label'=>$text['label-eavesdrop'],'icon'=>'headphones','collapse'=>'hide-lg-dn','onclick'=>"if (confirm('".$text['confirm-eavesdrop']."')) { eavesdrop_call('".escape($cid_num)."','".escape($uuid)."'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + //hangup + if (permission_exists('call_active_hangup')) { + echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','collapse'=>'hide-lg-dn','onclick'=>"if (confirm('".$text['confirm-hangup']."')) { list_self_check('checkbox_".$x."'); list_action_set('hangup'); list_form_submit('form_list'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + echo "\n"; } echo "\n"; - + //unset the domain name unset($domain_name); @@ -246,4 +269,4 @@ } -?> +?> \ No newline at end of file diff --git a/app/calls_active/calls_exec.php b/app/calls_active/calls_exec.php index 7706df5b16..3e8aaaba15 100644 --- a/app/calls_active/calls_exec.php +++ b/app/calls_active/calls_exec.php @@ -91,6 +91,21 @@ header('Location: calls_active.php'); exit; + } + else if ($_REQUEST['action'] == 'eavesdrop' && permission_exists('call_active_eavesdrop')) { + + $uuid_pattern = '/[^-A-Fa-f0-9]/'; + $num_pattern = '/[^-A-Za-z0-9()*#]/'; + + $chan_uuid = preg_replace($uuid_pattern,'',$_GET['chan_uuid']); + $ext = preg_replace($num_pattern,'',$_GET['ext']); + $destination = preg_replace($num_pattern,'',$_GET['destination']); + + $api_cmd = 'bgapi originate {origination_caller_id_name='.$text['label-eavesdrop'].',origination_caller_id_number='.$ext.'}user/'.$destination.'@'.$_SESSION['domain_name'].' &eavesdrop('.$chan_uuid.')'; + + //run the command + $switch_result = event_socket::api($api_cmd); + } else { echo "access denied";