Move the operator panel

This commit is contained in:
Mark J Crane
2019-05-26 04:56:43 +00:00
parent 4fcc1a2fb3
commit 0d50d272fd
24 changed files with 0 additions and 185 deletions

View File

@@ -0,0 +1,57 @@
<?php
//application details
$apps[$x]['name'] = "Operator Panel";
$apps[$x]['uuid'] = "dd3d173a-5d51-4231-ab22-b18c5b712bb2";
$apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Operator panel shows the status.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Das Bedienfeld zeigt den Status an.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Das Bedienfeld zeigt den Status an.";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "";
$apps[$x]['description']['fr-fr'] = "";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "Canais ativos no sistema.";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_manage";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_eavesdrop";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_kill";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_record";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_call_details";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_on_demand";
?>

View File

@@ -0,0 +1,404 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-operator_panel']['en-us'] = "Operator Panel";
$text['title-operator_panel']['ar-eg'] = "";
$text['title-operator_panel']['de-at'] = "Bedienfeld"; //copied from de-de
$text['title-operator_panel']['de-ch'] = "Bedienfeld"; //copied from de-de
$text['title-operator_panel']['de-de'] = "Bedienfeld";
$text['title-operator_panel']['es-cl'] = "Panel de Operador";
$text['title-operator_panel']['es-mx'] = "Panel de Operador"; //copied from es-cl
$text['title-operator_panel']['fr-ca'] = "Operator Panel"; //copied from fr-fr
$text['title-operator_panel']['fr-fr'] = "Operator Panel";
$text['title-operator_panel']['he-il'] = "לוח מפעיל";
$text['title-operator_panel']['it-it'] = "Pannello Operatore";
$text['title-operator_panel']['nl-nl'] = "";
$text['title-operator_panel']['pl-pl'] = "Panel operatora";
$text['title-operator_panel']['pt-br'] = "Painel do operador";
$text['title-operator_panel']['pt-pt'] = "Painel do Operador";
$text['title-operator_panel']['ro-ro'] = "";
$text['title-operator_panel']['ru-ru'] = "Панель Оператора";
$text['title-operator_panel']['sv-se'] = "Telefonist Panel";
$text['title-operator_panel']['uk-ua'] = "Панель оператора";
$text['label-status_on_demand']['en-us'] = "On Demand";
$text['label-status_on_demand']['ar-eg'] = "";
$text['label-status_on_demand']['de-at'] = "Bei Bedarf"; //copied from de-de
$text['label-status_on_demand']['de-ch'] = "Bei Bedarf"; //copied from de-de
$text['label-status_on_demand']['de-de'] = "Bei Bedarf";
$text['label-status_on_demand']['es-cl'] = "A Pedido";
$text['label-status_on_demand']['es-mx'] = "A Pedido"; //copied from es-cl
$text['label-status_on_demand']['fr-ca'] = "Sur Demande"; //copied from fr-fr
$text['label-status_on_demand']['fr-fr'] = "Sur Demande";
$text['label-status_on_demand']['he-il'] = "על פי דרישה";
$text['label-status_on_demand']['it-it'] = "Su Richiesta";
$text['label-status_on_demand']['nl-nl'] = "";
$text['label-status_on_demand']['pl-pl'] = "Na żądanie ";
$text['label-status_on_demand']['pt-br'] = "A pedido";
$text['label-status_on_demand']['pt-pt'] = "A Pedido";
$text['label-status_on_demand']['ro-ro'] = "";
$text['label-status_on_demand']['ru-ru'] = "По требованию";
$text['label-status_on_demand']['sv-se'] = "På Begäran";
$text['label-status_on_demand']['uk-ua'] = "На вимогу";
$text['label-status_on_break']['en-us'] = "On Break";
$text['label-status_on_break']['ar-eg'] = "";
$text['label-status_on_break']['de-at'] = "In Pause"; //copied from de-de
$text['label-status_on_break']['de-ch'] = "In Pause"; //copied from de-de
$text['label-status_on_break']['de-de'] = "In Pause";
$text['label-status_on_break']['es-cl'] = "En Pausa";
$text['label-status_on_break']['es-mx'] = "En Pausa"; //copied from es-cl
$text['label-status_on_break']['fr-ca'] = "En Pause"; //copied from fr-fr
$text['label-status_on_break']['fr-fr'] = "En Pause";
$text['label-status_on_break']['he-il'] = "בהפסקה";
$text['label-status_on_break']['it-it'] = "In Pausa";
$text['label-status_on_break']['nl-nl'] = "";
$text['label-status_on_break']['pl-pl'] = "Na przerwie";
$text['label-status_on_break']['pt-br'] = "Em pausa";
$text['label-status_on_break']['pt-pt'] = "Em Pausa";
$text['label-status_on_break']['ro-ro'] = "";
$text['label-status_on_break']['ru-ru'] = "Пауза";
$text['label-status_on_break']['sv-se'] = "På Rast";
$text['label-status_on_break']['uk-ua'] = "На перерві";
$text['label-status_logged_out_or_unknown']['en-us'] = "Logged Out / Unknown";
$text['label-status_logged_out_or_unknown']['ar-eg'] = "";
$text['label-status_logged_out_or_unknown']['de-at'] = "Abgemeldet / Unbekannt"; //copied from de-de
$text['label-status_logged_out_or_unknown']['de-ch'] = "Abgemeldet / Unbekannt"; //copied from de-de
$text['label-status_logged_out_or_unknown']['de-de'] = "Abgemeldet / Unbekannt";
$text['label-status_logged_out_or_unknown']['es-cl'] = "Desconectado / Desconocido";
$text['label-status_logged_out_or_unknown']['es-mx'] = "Desconectado / Desconocido"; //copied from es-cl
$text['label-status_logged_out_or_unknown']['fr-ca'] = "Déconnexion / Unknown"; //copied from fr-fr
$text['label-status_logged_out_or_unknown']['fr-fr'] = "Déconnexion / Unknown";
$text['label-status_logged_out_or_unknown']['he-il'] = "";
$text['label-status_logged_out_or_unknown']['it-it'] = "Sloggato/Sconosciuto";
$text['label-status_logged_out_or_unknown']['nl-nl'] = "";
$text['label-status_logged_out_or_unknown']['pl-pl'] = "Wylogowany/nieznany";
$text['label-status_logged_out_or_unknown']['pt-br'] = "Desligar / Desconhecido";
$text['label-status_logged_out_or_unknown']['pt-pt'] = "Desligado / Unknown";
$text['label-status_logged_out_or_unknown']['ro-ro'] = "";
$text['label-status_logged_out_or_unknown']['ru-ru'] = "Вышел из системы / Неизвестен";
$text['label-status_logged_out_or_unknown']['sv-se'] = "Utloggad / Okänd";
$text['label-status_logged_out_or_unknown']['uk-ua'] = "Вийшов/невідомо";
$text['label-status_logged_out']['en-us'] = "Logged Out";
$text['label-status_logged_out']['ar-eg'] = "";
$text['label-status_logged_out']['de-at'] = "Abgemeldet"; //copied from de-de
$text['label-status_logged_out']['de-ch'] = "Abgemeldet"; //copied from de-de
$text['label-status_logged_out']['de-de'] = "Abgemeldet";
$text['label-status_logged_out']['es-cl'] = "Desconectado";
$text['label-status_logged_out']['es-mx'] = "Desconectado"; //copied from es-cl
$text['label-status_logged_out']['fr-ca'] = "Déconnexion"; //copied from fr-fr
$text['label-status_logged_out']['fr-fr'] = "Déconnexion";
$text['label-status_logged_out']['he-il'] = "";
$text['label-status_logged_out']['it-it'] = "Sloggato";
$text['label-status_logged_out']['nl-nl'] = "";
$text['label-status_logged_out']['pl-pl'] = "Wylogowany";
$text['label-status_logged_out']['pt-br'] = "Desligado"; //copied from pt-pt
$text['label-status_logged_out']['pt-pt'] = "Desligado";
$text['label-status_logged_out']['ro-ro'] = "";
$text['label-status_logged_out']['ru-ru'] = "Вышел из системы";
$text['label-status_logged_out']['sv-se'] = "Utloggad";
$text['label-status_logged_out']['uk-ua'] = "Вийшов";
$text['label-status_do_not_disturb']['en-us'] = "Do Not Disturb";
$text['label-status_do_not_disturb']['ar-eg'] = "";
$text['label-status_do_not_disturb']['de-at'] = "Bitte nicht Stören"; //copied from de-de
$text['label-status_do_not_disturb']['de-ch'] = "Bitte nicht Stören"; //copied from de-de
$text['label-status_do_not_disturb']['de-de'] = "Bitte nicht Stören";
$text['label-status_do_not_disturb']['es-cl'] = "No Molestar";
$text['label-status_do_not_disturb']['es-mx'] = "No Molestar"; //copied from es-cl
$text['label-status_do_not_disturb']['fr-ca'] = "Ne pas Déranger"; //copied from fr-fr
$text['label-status_do_not_disturb']['fr-fr'] = "Ne pas Déranger";
$text['label-status_do_not_disturb']['he-il'] = "נא לא להפריע";
$text['label-status_do_not_disturb']['it-it'] = "Non Disturbare";
$text['label-status_do_not_disturb']['nl-nl'] = "";
$text['label-status_do_not_disturb']['pl-pl'] = "Nie przeszkadzać (DND)";
$text['label-status_do_not_disturb']['pt-br'] = "Não perturbe";
$text['label-status_do_not_disturb']['pt-pt'] = "Não perturbe (DND)";
$text['label-status_do_not_disturb']['ro-ro'] = "";
$text['label-status_do_not_disturb']['ru-ru'] = "Просьба не беспокоить";
$text['label-status_do_not_disturb']['sv-se'] = "Stör Ej";
$text['label-status_do_not_disturb']['uk-ua'] = "Не турбувати";
$text['label-status_available_on_demand']['en-us'] = "Available (On Demand)";
$text['label-status_available_on_demand']['ar-eg'] = "";
$text['label-status_available_on_demand']['de-at'] = "Verfügbar (Bei Bedarf)"; //copied from de-de
$text['label-status_available_on_demand']['de-ch'] = "Verfügbar (Bei Bedarf)"; //copied from de-de
$text['label-status_available_on_demand']['de-de'] = "Verfügbar (Bei Bedarf)";
$text['label-status_available_on_demand']['es-cl'] = "Disponible (A Pedido)";
$text['label-status_available_on_demand']['es-mx'] = "Disponible (A Pedido)"; //copied from es-cl
$text['label-status_available_on_demand']['fr-ca'] = "Disponble (sur demande)"; //copied from fr-fr
$text['label-status_available_on_demand']['fr-fr'] = "Disponble (sur demande)";
$text['label-status_available_on_demand']['he-il'] = "";
$text['label-status_available_on_demand']['it-it'] = "Disponibile (Su Richiesta)";
$text['label-status_available_on_demand']['nl-nl'] = "";
$text['label-status_available_on_demand']['pl-pl'] = "Dostępny (na żądanie)";
$text['label-status_available_on_demand']['pt-br'] = "Disponivel (A pedido)";
$text['label-status_available_on_demand']['pt-pt'] = "Disponível (A Pedido)";
$text['label-status_available_on_demand']['ro-ro'] = "";
$text['label-status_available_on_demand']['ru-ru'] = "Доступен (по требованию)";
$text['label-status_available_on_demand']['sv-se'] = "Tillgänglig (På Begäran)";
$text['label-status_available_on_demand']['uk-ua'] = "Доступний (на вимогу)";
$text['label-status_available']['en-us'] = "Available";
$text['label-status_available']['ar-eg'] = "";
$text['label-status_available']['de-at'] = "Verfügbar"; //copied from de-de
$text['label-status_available']['de-ch'] = "Verfügbar"; //copied from de-de
$text['label-status_available']['de-de'] = "Verfügbar";
$text['label-status_available']['es-cl'] = "Disponible";
$text['label-status_available']['es-mx'] = "Disponible"; //copied from es-cl
$text['label-status_available']['fr-ca'] = "Disponible"; //copied from fr-fr
$text['label-status_available']['fr-fr'] = "Disponible";
$text['label-status_available']['he-il'] = "זמין";
$text['label-status_available']['it-it'] = "Disponibile";
$text['label-status_available']['nl-nl'] = "";
$text['label-status_available']['pl-pl'] = "Dostępny";
$text['label-status_available']['pt-br'] = "Disponível";
$text['label-status_available']['pt-pt'] = "Disponível";
$text['label-status_available']['ro-ro'] = "";
$text['label-status_available']['ru-ru'] = "Доступен";
$text['label-status_available']['sv-se'] = "Tillgänglig";
$text['label-status_available']['uk-ua'] = "Доступний";
$text['label-refresh_pause']['en-us'] = "Pause Refresh";
$text['label-refresh_pause']['ar-eg'] = "";
$text['label-refresh_pause']['de-at'] = "Seite neu laden deaktivieren"; //copied from de-de
$text['label-refresh_pause']['de-ch'] = "Seite neu laden deaktivieren"; //copied from de-de
$text['label-refresh_pause']['de-de'] = "Seite neu laden deaktivieren";
$text['label-refresh_pause']['es-cl'] = "Actualizar Pausa";
$text['label-refresh_pause']['es-mx'] = "Actualizar Pausa"; //copied from es-cl
$text['label-refresh_pause']['fr-ca'] = "Pause Actualiser"; //copied from fr-fr
$text['label-refresh_pause']['fr-fr'] = "Pause Actualiser";
$text['label-refresh_pause']['he-il'] = "עצור רענון";
$text['label-refresh_pause']['it-it'] = "Interrompi";
$text['label-refresh_pause']['nl-nl'] = "";
$text['label-refresh_pause']['pl-pl'] = "Pauzuj odÅwieżanie";
$text['label-refresh_pause']['pt-br'] = "Pausar atualização";
$text['label-refresh_pause']['pt-pt'] = "Pausa Atualizar";
$text['label-refresh_pause']['ro-ro'] = "";
$text['label-refresh_pause']['ru-ru'] = "Приостановить обновление";
$text['label-refresh_pause']['sv-se'] = "Paus Uppdatera";
$text['label-refresh_pause']['uk-ua'] = "Припинити оновлення";
$text['label-refresh_enable']['en-us'] = "Enable Refresh";
$text['label-refresh_enable']['ar-eg'] = "";
$text['label-refresh_enable']['de-at'] = "Seite neu laden aktivieren"; //copied from de-de
$text['label-refresh_enable']['de-ch'] = "Seite neu laden aktivieren"; //copied from de-de
$text['label-refresh_enable']['de-de'] = "Seite neu laden aktivieren";
$text['label-refresh_enable']['es-cl'] = "Activar Actualizar";
$text['label-refresh_enable']['es-mx'] = "Activar Actualizar"; //copied from es-cl
$text['label-refresh_enable']['fr-ca'] = "Activer Actualiser"; //copied from fr-fr
$text['label-refresh_enable']['fr-fr'] = "Activer Actualiser";
$text['label-refresh_enable']['he-il'] = "אפשר רענון";
$text['label-refresh_enable']['it-it'] = "Abilita Aggiornamento";
$text['label-refresh_enable']['nl-nl'] = "";
$text['label-refresh_enable']['pl-pl'] = "Ä…cz odÅwieżanie";
$text['label-refresh_enable']['pt-br'] = "Habilitar atualização";
$text['label-refresh_enable']['pt-pt'] = "Habilitar Atualização";
$text['label-refresh_enable']['ro-ro'] = "";
$text['label-refresh_enable']['ru-ru'] = "Включить обновление";
$text['label-refresh_enable']['sv-se'] = "Aktivera Uppdatering";
$text['label-refresh_enable']['uk-ua'] = "Включити оновлення";
$text['label-recording']['en-us'] = "Recording";
$text['label-recording']['ar-eg'] = "";
$text['label-recording']['de-at'] = "Aufnahme"; //copied from de-de
$text['label-recording']['de-ch'] = "Aufnahme"; //copied from de-de
$text['label-recording']['de-de'] = "Aufnahme";
$text['label-recording']['es-cl'] = "Grabación de Llamadas";
$text['label-recording']['es-mx'] = "Grabación de Llamadas"; //copied from es-cl
$text['label-recording']['fr-ca'] = "Enregistrement de L'appel"; //copied from fr-fr
$text['label-recording']['fr-fr'] = "Enregistrement de L'appel";
$text['label-recording']['he-il'] = "מקליט";
$text['label-recording']['it-it'] = "Registrazione";
$text['label-recording']['nl-nl'] = "";
$text['label-recording']['pl-pl'] = "Nagrywanie";
$text['label-recording']['pt-br'] = "Gravação de chamadas";
$text['label-recording']['pt-pt'] = "Gravação de Chamadas";
$text['label-recording']['ro-ro'] = "";
$text['label-recording']['ru-ru'] = "Запись";
$text['label-recording']['sv-se'] = "Inspelning";
$text['label-recording']['uk-ua'] = "Запис";
$text['label-record']['en-us'] = "Record";
$text['label-record']['ar-eg'] = "";
$text['label-record']['de-at'] = "Aufnehmen"; //copied from de-de
$text['label-record']['de-ch'] = "Aufnehmen"; //copied from de-de
$text['label-record']['de-de'] = "Aufnehmen";
$text['label-record']['es-cl'] = "Registro";
$text['label-record']['es-mx'] = "Registro"; //copied from es-cl
$text['label-record']['fr-ca'] = "Enregistrer"; //copied from fr-fr
$text['label-record']['fr-fr'] = "Enregistrer";
$text['label-record']['he-il'] = "הקלטה";
$text['label-record']['it-it'] = "Registrazione";
$text['label-record']['nl-nl'] = "";
$text['label-record']['pl-pl'] = "Nagrywanie";
$text['label-record']['pt-br'] = "Registro"; //copied from pt-pt
$text['label-record']['pt-pt'] = "Registro";
$text['label-record']['ro-ro'] = "";
$text['label-record']['ru-ru'] = "Воспроизведение";
$text['label-record']['sv-se'] = "Spela In";
$text['label-record']['uk-ua'] = "Запис";
$text['label-other_extensions']['en-us'] = "Other Extensions";
$text['label-other_extensions']['ar-eg'] = "";
$text['label-other_extensions']['de-at'] = "Andere Nebenstellen"; //copied from de-de
$text['label-other_extensions']['de-ch'] = "Andere Nebenstellen"; //copied from de-de
$text['label-other_extensions']['de-de'] = "Andere Nebenstellen";
$text['label-other_extensions']['es-cl'] = "Otras Extensiones";
$text['label-other_extensions']['es-mx'] = "Otras Extensiones"; //copied from es-cl
$text['label-other_extensions']['fr-ca'] = "Autres Extensions"; //copied from fr-fr
$text['label-other_extensions']['fr-fr'] = "Autres Extensions";
$text['label-other_extensions']['he-il'] = "שלוחות אחרות";
$text['label-other_extensions']['it-it'] = "Altri Interni";
$text['label-other_extensions']['nl-nl'] = "";
$text['label-other_extensions']['pl-pl'] = "Inne numery wew";
$text['label-other_extensions']['pt-br'] = "Outras extensões";
$text['label-other_extensions']['pt-pt'] = "Outros Extensions";
$text['label-other_extensions']['ro-ro'] = "";
$text['label-other_extensions']['ru-ru'] = "Другие внутренние номера";
$text['label-other_extensions']['sv-se'] = "Annan Anknytning";
$text['label-other_extensions']['uk-ua'] = "Інші розширення";
$text['label-no_extensions_found']['en-us'] = "No extensions found.";
$text['label-no_extensions_found']['ar-eg'] = "";
$text['label-no_extensions_found']['de-at'] = "Keine Nebenstellen gefunden."; //copied from de-de
$text['label-no_extensions_found']['de-ch'] = "Keine Nebenstellen gefunden."; //copied from de-de
$text['label-no_extensions_found']['de-de'] = "Keine Nebenstellen gefunden.";
$text['label-no_extensions_found']['es-cl'] = "No hay extensiones encontrados.";
$text['label-no_extensions_found']['es-mx'] = "No hay extensiones encontrados."; //copied from es-cl
$text['label-no_extensions_found']['fr-ca'] = "Aucun extensions trouvés."; //copied from fr-fr
$text['label-no_extensions_found']['fr-fr'] = "Aucun extensions trouvés.";
$text['label-no_extensions_found']['he-il'] = "לא נמצאו שלוחות";
$text['label-no_extensions_found']['it-it'] = "Nessun interno trovato.";
$text['label-no_extensions_found']['nl-nl'] = "";
$text['label-no_extensions_found']['pl-pl'] = "Nie znaleziono numeru wew";
$text['label-no_extensions_found']['pt-br'] = "Não foi encontrada nenhuma extensão";
$text['label-no_extensions_found']['pt-pt'] = "Sem extensões encontrado.";
$text['label-no_extensions_found']['ro-ro'] = "";
$text['label-no_extensions_found']['ru-ru'] = "Внутренних номеров не найдено.";
$text['label-no_extensions_found']['sv-se'] = "Ingen anknytning funnen.";
$text['label-no_extensions_found']['uk-ua'] = "Не знайдено розширень";
$text['label-kill']['en-us'] = "Kill";
$text['label-kill']['ar-eg'] = "";
$text['label-kill']['de-at'] = "Abwürgen"; //copied from de-de
$text['label-kill']['de-ch'] = "Abwürgen"; //copied from de-de
$text['label-kill']['de-de'] = "Abwürgen";
$text['label-kill']['es-cl'] = "Finalizar Llamada";
$text['label-kill']['es-mx'] = "Finalizar Llamada"; //copied from es-cl
$text['label-kill']['fr-ca'] = "Tuer Appel"; //copied from fr-fr
$text['label-kill']['fr-fr'] = "Tuer Appel";
$text['label-kill']['he-il'] = "הפסק";
$text['label-kill']['it-it'] = "Abbatti";
$text['label-kill']['nl-nl'] = "";
$text['label-kill']['pl-pl'] = "WyÅÄ…cz";
$text['label-kill']['pt-br'] = "Chamada final";
$text['label-kill']['pt-pt'] = "Chamada Final";
$text['label-kill']['ro-ro'] = "";
$text['label-kill']['ru-ru'] = "Убить";
$text['label-kill']['sv-se'] = "Lägg På";
$text['label-kill']['uk-ua'] = "вбити";
$text['label-eavesdrop']['en-us'] = "Eavesdrop";
$text['label-eavesdrop']['ar-eg'] = "";
$text['label-eavesdrop']['de-at'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-ch'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-de'] = "Mithören";
$text['label-eavesdrop']['es-cl'] = "Escuchar";
$text['label-eavesdrop']['es-mx'] = "Escuchar"; //copied from es-cl
$text['label-eavesdrop']['fr-ca'] = "Espionner"; //copied from fr-fr
$text['label-eavesdrop']['fr-fr'] = "Espionner";
$text['label-eavesdrop']['he-il'] = "";
$text['label-eavesdrop']['it-it'] = "Ascolta";
$text['label-eavesdrop']['nl-nl'] = "";
$text['label-eavesdrop']['pl-pl'] = "PodsÅuchiwanie";
$text['label-eavesdrop']['pt-br'] = "Investigar";
$text['label-eavesdrop']['pt-pt'] = "Bisbilhotar";
$text['label-eavesdrop']['ro-ro'] = "";
$text['label-eavesdrop']['ru-ru'] = "Подслушивать";
$text['label-eavesdrop']['sv-se'] = "Medlyssning";
$text['label-eavesdrop']['uk-ua'] = "підслуховувати";
$text['label-call_group']['en-us'] = "Call Group";
$text['label-call_group']['ar-eg'] = "";
$text['label-call_group']['de-at'] = "Rufgruppe"; //copied from de-de
$text['label-call_group']['de-ch'] = "Rufgruppe"; //copied from de-de
$text['label-call_group']['de-de'] = "Rufgruppe";
$text['label-call_group']['es-cl'] = "Llamar a Grupo";
$text['label-call_group']['es-mx'] = "Llamar a Grupo"; //copied from es-cl
$text['label-call_group']['fr-ca'] = "Groupe d'appel"; //copied from fr-fr
$text['label-call_group']['fr-fr'] = "Groupe d'appel";
$text['label-call_group']['he-il'] = "קבוצת חיוג";
$text['label-call_group']['it-it'] = "Gruppo di Chiamata";
$text['label-call_group']['nl-nl'] = "";
$text['label-call_group']['pl-pl'] = "Grupa odbiorców rozmowy";
$text['label-call_group']['pt-br'] = "Grupo"; //copied from pt-pt
$text['label-call_group']['pt-pt'] = "Grupo";
$text['label-call_group']['ro-ro'] = "";
$text['label-call_group']['ru-ru'] = "Группы вызова";
$text['label-call_group']['sv-se'] = "Ring Grupp";
$text['label-call_group']['uk-ua'] = "груповий виклик";
$text['label-call_direction']['en-us'] = "Call Direction";
$text['label-call_direction']['ar-eg'] = "";
$text['label-call_direction']['de-at'] = "Anruf Richtung"; //copied from de-de
$text['label-call_direction']['de-ch'] = "Anruf Richtung"; //copied from de-de
$text['label-call_direction']['de-de'] = "Anruf Richtung";
$text['label-call_direction']['es-cl'] = "Dirección de la llamada";
$text['label-call_direction']['es-mx'] = "Dirección de la llamada"; //copied from es-cl
$text['label-call_direction']['fr-ca'] = "Sens de l'appel"; //copied from fr-fr
$text['label-call_direction']['fr-fr'] = "Sens de l'appel";
$text['label-call_direction']['he-il'] = "כיוון שיחה";
$text['label-call_direction']['it-it'] = "Direzione Chiamata";
$text['label-call_direction']['nl-nl'] = "";
$text['label-call_direction']['pl-pl'] = "Kierunek rozmowy";
$text['label-call_direction']['pt-br'] = "Direção da chamada";
$text['label-call_direction']['pt-pt'] = "Direção da chamada";
$text['label-call_direction']['ro-ro'] = "";
$text['label-call_direction']['ru-ru'] = "Направление вызова";
$text['label-call_direction']['sv-se'] = "Samtals Riktning";
$text['label-call_direction']['uk-ua'] = "напрямок виклику";
$text['description-eavesdrop_destination']['en-us'] = "Select the Eavesdrop Destination";
$text['description-eavesdrop_destination']['ar-eg'] = "";
$text['description-eavesdrop_destination']['de-at'] = "Wählen Sie ein Ziel zum Mithören"; //copied from de-de
$text['description-eavesdrop_destination']['de-ch'] = "Wählen Sie ein Ziel zum Mithören"; //copied from de-de
$text['description-eavesdrop_destination']['de-de'] = "Wählen Sie ein Ziel zum Mithören";
$text['description-eavesdrop_destination']['es-cl'] = "Seleccione el Eavesdrop Destino";
$text['description-eavesdrop_destination']['es-mx'] = "Seleccione el Eavesdrop Destino"; //copied from es-cl
$text['description-eavesdrop_destination']['fr-ca'] = "Sélectionnez le Eavesdrop Destinations"; //copied from fr-fr
$text['description-eavesdrop_destination']['fr-fr'] = "Sélectionnez le Eavesdrop Destinations";
$text['description-eavesdrop_destination']['he-il'] = "";
$text['description-eavesdrop_destination']['it-it'] = "Seleziona la Destinazione d'Ascolto";
$text['description-eavesdrop_destination']['nl-nl'] = "";
$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'] = "";
$text['description-eavesdrop_destination']['ru-ru'] = "Выберите подслушивание пункта назначения";
$text['description-eavesdrop_destination']['sv-se'] = "Välj Medlyssning Destination";
$text['description-eavesdrop_destination']['uk-ua'] = "Виберіть пункт призначення підслуховувати";
$text['button-all']['en-us'] = "All";
$text['button-all']['ar-eg'] = "";
$text['button-all']['de-at'] = "Alle"; //copied from de-de
$text['button-all']['de-ch'] = "Alle"; //copied from de-de
$text['button-all']['de-de'] = "Alle";
$text['button-all']['es-cl'] = "Todos";
$text['button-all']['es-mx'] = "Todos"; //copied from es-cl
$text['button-all']['fr-ca'] = "Tous"; //copied from fr-fr
$text['button-all']['fr-fr'] = "Tous";
$text['button-all']['he-il'] = "הכל";
$text['button-all']['it-it'] = "Tutti";
$text['button-all']['nl-nl'] = "";
$text['button-all']['pl-pl'] = "Wszyscy";
$text['button-all']['pt-br'] = "Tudo"; //copied from pt-pt
$text['button-all']['pt-pt'] = "Tudo";
$text['button-all']['ro-ro'] = "";
$text['button-all']['ru-ru'] = "Все";
$text['button-all']['sv-se'] = "Alla";
$text['button-all']['uk-ua'] = "Всі";
?>

View File

@@ -0,0 +1,29 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Operator Panel";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Bedienfeld";
$apps[$x]['menu'][$y]['title']['de-de'] = "Bedienfeld";
$apps[$x]['menu'][$y]['title']['es-cl'] = "";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Panneau Operateur";
$apps[$x]['menu'][$y]['title']['he-il'] = "לוח מפעיל";
$apps[$x]['menu'][$y]['title']['it-it'] = "Pannello Operatore";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Panel operatora";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Painel do operador";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Панель оператора";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Telefonist Panel";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Панель оператора";
$apps[$x]['menu'][$y]['uuid'] = "dd3d173a-5d51-4231-ab22-b18c5b712bb2";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/operator_panel/index.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
$apps[$x]['menu'][$y]['groups'][] = "admin";
?>

View File

@@ -0,0 +1,193 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('contact_view')) {
//access granted
}
else {
exit;
}
//search term
$term = check_str($_GET['term']);
if (isset($_GET['debug'])) {
echo "Search Term: ".$term."<br><br>";
}
//if term contains spaces, break into array
if (substr_count($term, ' ') > 0) {
$terms = explode(' ', $term);
}
else {
$terms[] = $term;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//retrieve current user's assigned groups (uuids)
foreach ($_SESSION['groups'] as $group_data) {
$user_group_uuids[] = $group_data['group_uuid'];
}
//add user's uuid to group uuid list to include private (non-shared) contacts
$user_group_uuids[] = $_SESSION["user_uuid"];
//create the database object
$database = new database;
//get extensions list
$sql = "select \n";
$sql .= "e.extension, \n";
$sql .= "e.effective_caller_id_name, \n";
$sql .= "concat(e.directory_first_name, ' ', e.directory_last_name) as directory_full_name \n";
$sql .= "from \n";
$sql .= "v_extensions e \n";
$sql .= "where \n";
foreach ($terms as $index => $term) {
$sql .= "( \n";
$sql .= " lower(e.effective_caller_id_name) like lower('%".$term."%') or \n";
$sql .= " lower(e.outbound_caller_id_name) like lower('%".$term."%') or \n";
$sql .= " lower(concat(e.directory_first_name, ' ', e.directory_last_name)) like lower('%".$term."%') or \n";
$sql .= " lower(e.description) like lower('%".$term."%') or \n";
$sql .= " lower(e.call_group) like lower('%".$term."%') or \n";
$sql .= " e.extension like '%".$term."%' \n";
$sql .= ") \n";
if ($index + 1 < sizeof($terms)) {
$sql .= " and \n";
}
}
$sql .= "and e.domain_uuid = '".$_SESSION['domain_uuid']."' \n";
$sql .= "and e.enabled = 'true' \n";
$sql .= "order by \n";
$sql .= "directory_full_name asc, \n";
$sql .= "e.effective_caller_id_name asc \n";
if (isset($_GET['debug'])) { echo $sql."<br><br>"; }
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
if (is_array($result)) {
if (isset($_GET['debug'])) { echo $result."<br><br>"; }
foreach($result as $row) {
if ($row['directory_full_name'] != '') { $values[] = $row['directory_full_name']; }
if ($row['effective_caller_id_name'] != '') { $values[] = $row['effective_caller_id_name']; }
$suggestions[] = "{ \"label\": \"".(implode(', ', $values)." @ ".$row['extension'])."\", \"value\": \"".$row['extension']."\" }";
unset($values);
}
unset($sql, $result, $row_count);
}
//get contacts list
$sql = "select \n";
$sql .= "c.contact_organization, \n";
$sql .= "c.contact_name_given, \n";
$sql .= "c.contact_name_middle, \n";
$sql .= "c.contact_name_family, \n";
$sql .= "c.contact_nickname, \n";
$sql .= "p.phone_number, \n";
$sql .= "p.phone_label \n";
$sql .= "from \n";
$sql .= "v_contacts as c, \n";
$sql .= "v_contact_phones as p \n";
$sql .= "where \n";
foreach ($terms as $index => $term) {
$sql .= "( \n";
$sql .= " lower(c.contact_organization) like lower('%".$term."%') or \n";
$sql .= " lower(c.contact_name_given) like lower('%".$term."%') or \n";
$sql .= " lower(c.contact_name_middle) like lower('%".$term."%') or \n";
$sql .= " lower(c.contact_name_family) like lower('%".$term."%') or \n";
$sql .= " lower(c.contact_nickname) like lower('%".$term."%') or \n";
$sql .= " p.phone_number like '%".$term."%' \n";
$sql .= ") \n";
if ($index + 1 < sizeof($terms)) {
$sql .= " and \n";
}
}
$sql .= "and c.contact_uuid = p.contact_uuid \n";
$sql .= "and c.domain_uuid = '".$_SESSION['domain_uuid']."' \n";
if (sizeof($user_group_uuids) > 0) {
$sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group
$sql .= " c.contact_uuid in ( \n";
$sql .= " select contact_uuid from v_contact_groups \n";
$sql .= " where group_uuid in ('".implode("','", $user_group_uuids)."') \n";
$sql .= " and domain_uuid = '".$_SESSION['domain_uuid']."' \n";
$sql .= " ) \n";
$sql .= " or \n";
$sql .= " c.contact_uuid not in ( \n";
$sql .= " select contact_uuid from v_contact_groups \n";
$sql .= " where domain_uuid = '".$_SESSION['domain_uuid']."' \n";
$sql .= " ) \n";
$sql .= ") \n";
}
$sql .= "and p.phone_type_voice = 1 \n";
$sql .= "order by \n";
$sql .= "contact_organization desc, \n";
$sql .= "contact_name_given asc, \n";
$sql .= "contact_name_family asc \n";
if (isset($_GET['debug'])) { echo $sql."<br><br>"; }
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset($prep_statement, $sql);
if (is_array($result)) {
foreach($result as $row) {
if ($row['contact_organization'] != '') { $values[] = $row['contact_organization']; }
if ($row['contact_name_given'] != '') { $names = $row['contact_name_given']; }
if ($row['contact_name_middle'] != '') { $names .= " ".$row['contact_name_middle']; }
if ($row['contact_name_family'] != '') { $names .= " ".$row['contact_name_family']; }
if ($names != '') { $values[] = $names; }
if ($row['contact_nickname'] != '') { $values[] = $row['contact_nickname']; }
$suggestions[] = "{ \"label\": \"".(implode(', ', $values)." - ".format_phone($row['phone_number']).(($row['phone_label'] != '') ? " (".$row['phone_label'].")" : null))."\", \"value\": \"".$row['phone_number']."\" }";
unset($values, $names);
}
unset($sql, $result, $row_count);
}
//output suggestions, if any
if (sizeof($suggestions) > 0) {
$resp .= "[\n";
$resp .= implode(",\n", $suggestions)."\n";
$resp .= "]";
if (isset($_GET['debug'])) { echo "<pre>"; }
echo $resp;
if (isset($_GET['debug'])) { echo "</pre>"; }
}
?>

View File

@@ -0,0 +1,203 @@
<?php
/* $Id$ */
/*
v_exec.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
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,
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,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//authorized referrer
// if(stristr($_SERVER["HTTP_REFERER"], '/index.php') === false) {
// if(stristr($_SERVER["HTTP_REFERER"], '/index_inc.php') === false) {
// echo " access denied";
// exit;
// }
// }
//http get variables set to php variables
if (count($_GET)>0) {
$switch_cmd = trim(check_str($_GET["cmd"]));
$action = trim(check_str($_GET["action"]));
$data = trim(check_str($_GET["data"]));
$direction = trim(check_str($_GET["direction"]));
$username = $_SESSION['username'];
}
//authorized commands
// if (stristr($switch_cmd, '&uuid=') == true) {
// //authorized;
// } elseif (stristr($switch_cmd, 'uuid_kill') == true) {
// //authorized;
// } elseif (stristr($switch_cmd, 'uuid_transfer') == true) {
// //authorized;
// } elseif (stristr($switch_cmd, 'uuid_record') == true) {
// //authorized;
// } elseif (stristr($action, 'user_status') == true) {
// //authorized;
// } elseif (stristr($action, 'callcenter_config') == true) {
// //authorized;
// } elseif (stristr($action, 'originate') == true) {
// //authorized;
// } else {
// //not found. this command is not authorized
// echo "access denied";
// exit;
// }
if (count($_GET)>0) {
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//get the status
if (stristr($action, 'user_status') == true) {
$user_status = $data;
switch ($user_status) {
case "Available":
$user_status = "Available";
//update the user state
$cmd = "api callcenter_config agent set state ".$username."@".$_SESSION['domain_name']." Waiting";
$response = event_socket_request($fp, $cmd);
break;
case "Available_On_Demand":
$user_status = "Available (On Demand)";
//update the user state
$cmd = "api callcenter_config agent set state ".$username."@".$_SESSION['domain_name']." Waiting";
$response = event_socket_request($fp, $cmd);
break;
case "Logged_Out":
$user_status = "Logged Out";
//update the user state
$cmd = "api callcenter_config agent set state ".$username."@".$_SESSION['domain_name']." Waiting";
$response = event_socket_request($fp, $cmd);
break;
case "On_Break":
$user_status = "On Break";
//update the user state
$cmd = "api callcenter_config agent set state ".$username."@".$_SESSION['domain_name']." Waiting";
$response = event_socket_request($fp, $cmd);
break;
case "Do_Not_Disturb":
$user_status = "Do Not Disturb";
//update the user state
$cmd = "api callcenter_config agent set state ".$username."@".$_SESSION['domain_name']." Waiting";
$response = event_socket_request($fp, $cmd);
break;
default:
$user_status = "";
}
}
//allow specific commands
if (strlen($switch_cmd) > 0) {
if (stristr($switch_cmd, 'originate') == true) {}
elseif (stristr($switch_cmd, 'uuid_record') == true) {}
elseif (stristr($switch_cmd, 'uuid_transfer') == true) {}
elseif (stristr($switch_cmd, 'eavesdrop') == true) {}
elseif (stristr($switch_cmd, 'uuid_kill') == true) {}
else {
$switch_cmd = '';
}
if (stristr($switch_cmd, 'system') == true) {
$switch_cmd = '';
}
}
//switch cmd
if (strlen($switch_cmd) > 0) {
//set the status so they are compatible with mod_callcenter
$switch_cmd = str_replace("Available_On_Demand", "'Available (On Demand)'", $switch_cmd);
$switch_cmd = str_replace("Logged_Out", "'Logged Out'", $switch_cmd);
$switch_cmd = str_replace("On_Break", "'On Break'", $switch_cmd);
$switch_cmd = str_replace("Do_Not_Disturb", "'Logged Out'", $switch_cmd);
/*
//if ($action == "energy") {
//conference 3001-example.org energy 103
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$result_array = explode("=",$switch_result);
$tmp_value = $result_array[1];
//if ($direction == "up") { $tmp_value = $tmp_value + 100; }
//if ($direction == "down") { $tmp_value = $tmp_value - 100; }
//echo "energy $tmp_value<br />\n";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
//}
if ($action == "volume_in") {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$result_array = explode("=",$switch_result);
$tmp_value = $result_array[1];
if ($direction == "up") { $tmp_value = $tmp_value + 1; }
if ($direction == "down") { $tmp_value = $tmp_value - 1; }
//echo "volume $tmp_value<br />\n";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
}
if ($action == "volume_out") {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$result_array = explode("=",$switch_result);
$tmp_value = $result_array[1];
if ($direction == "up") { $tmp_value = $tmp_value + 1; }
if ($direction == "down") { $tmp_value = $tmp_value - 1; }
//echo "volume $tmp_value<br />\n";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
}
*/
//run the command
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
//record stop
if ($action == "record") {
if (trim($_GET["action2"]) == "stop") {
$x=0;
while (true) {
if ($x > 0) {
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"]."_".$x.".wav";
}
else {
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav";
}
if (!file_exists($dest_file)) {
rename($_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav", $dest_file);
break;
}
$x++;
}
}
}
}
}
?>

View File

@@ -0,0 +1,499 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//set user status
if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') {
//create the database object
$database = new database;
//validate the user status
$user_status = $_REQUEST['status'];
switch ($user_status) {
case "Available" :
break;
case "Available (On Demand)" :
break;
case "On Break" :
break;
case "Do Not Disturb" :
break;
default :
$user_status = '';
}
//update the status
$sql = "update v_users set ";
$sql .= "user_status = '".$user_status."' ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and user_uuid = '".$_SESSION['user']['user_uuid']."' ";
if (permission_exists("user_account_setting_edit")) {
$count = $db->exec(check_sql($sql));
}
//if call center app is installed then update the user_status
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/call_centers')) {
//get the call center agent uuid
$sql = "select call_center_agent_uuid from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and user_uuid = :user_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['user_uuid'] = $_SESSION['user']['user_uuid'];
$result = $database->select($sql, $parameters);
if (is_array($result)) {
$call_center_agent_uuid = $result[0]['call_center_agent_uuid'];
}
//update the user_status
if (isset($call_center_agent_uuid)) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$switch_cmd .= "callcenter_config agent set status ".$call_center_agent_uuid." '".$user_status."'";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
//update the user state
if (isset($call_center_agent_uuid)) {
$cmd = "api callcenter_config agent set state ".$call_center_agent_uuid." Waiting";
$response = event_socket_request($fp, $cmd);
}
}
//stop execution
exit;
}
//set the title
$document['title'] = $text['title-operator_panel'];
//include the header
require_once "resources/header.php";
?>
<!-- virtual_drag function holding elements -->
<input type='hidden' class='formfld' id='vd_call_id' value=''>
<input type='hidden' class='formfld' id='vd_ext_from' value=''>
<input type='hidden' class='formfld' id='vd_ext_to' value=''>
<input type='hidden' class='formfld' id='sort1' value=''>
<!-- autocomplete for contact lookup -->
<link rel="stylesheet" type="text/css" href="<?php echo PROJECT_PATH; ?>/resources/jquery/jquery-ui.css">
<script language="JavaScript" type="text/javascript" src="<?php echo PROJECT_PATH; ?>/resources/jquery/jquery-ui-1.9.2.min.js"></script>
<script type="text/javascript">
//ajax refresh
var refresh = 1500;
var source_url = 'index_inc.php?' <?php if (isset($_GET['debug'])) { echo " + '&debug'"; } ?>;
var interval_timer_id;
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
loadXmlHttp.prototype.stateChanged=function () {
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_reponse').innerHTML = this.xmlHttp.responseText;
if(document.getElementById('sort')){
if(document.getElementById('sort').value != "")
document.getElementById('sort1').value=document.getElementById('sort').value;
}
}
var requestTime = function() {
var url = source_url;
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
if (document.getElementById('sort1'))
if (document.getElementById('sort1').value == '1') url += '&sort';
<?php
if (isset($_GET['debug'])) {
echo "url += '&debug';";
}
?>
new loadXmlHttp(url, 'ajax_reponse');
refresh_start();
}
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
window.attachEvent('onload', requestTime);
}
//drag/drop functionality
var ie_workaround = false;
function drag(ev, from_ext) {
refresh_stop();
try {
ev.dataTransfer.setData("Call", ev.target.id);
ev.dataTransfer.setData("From", from_ext);
virtual_drag_reset();
}
catch (err) {
// likely internet explorer being used, do workaround
virtual_drag(ev.target.id, from_ext);
ie_workaround = true;
}
}
function allowDrop(ev, target_id) {
ev.preventDefault();
}
function discardDrop(ev, target_id) {
ev.preventDefault();
}
function drop(ev, to_ext) {
ev.preventDefault();
if (ie_workaround) { // potentially set on drag() function above
var call_id = document.getElementById('vd_call_id').value;
var from_ext = document.getElementById('vd_ext_from').value;
virtual_drag_reset();
}
else {
var call_id = ev.dataTransfer.getData("Call");
var from_ext = ev.dataTransfer.getData("From");
}
var to_ext = to_ext;
var cmd;
if (call_id != '') {
cmd = get_transfer_cmd(call_id, to_ext); //transfer a call
}
else {
if (from_ext != to_ext) { // prevent user from dragging extention onto self
cmd = get_originate_cmd(from_ext+'@<?php echo $_SESSION["domain_name"]?>', to_ext); //make a call
}
}
if (cmd != '') { send_cmd('exec.php?cmd='+escape(cmd)); }
refresh_start();
}
//refresh controls
function refresh_stop() {
clearInterval(interval_timer_id);
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">"; }
}
function refresh_start() {
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
refresh_stop();
interval_timer_id = setInterval( function() {
url = source_url;
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
if (document.getElementById('sort1'))
if (document.getElementById('sort1').value == '1') url += '&sort';
<?php
if (isset($_GET['debug'])) {
echo "url += '&debug';";
}
?>
new loadXmlHttp(url, 'ajax_reponse');
}, refresh);
}
//call or transfer to destination
function go_destination(from_ext, destination, which, call_id) {
call_id = typeof call_id !== 'undefined' ? call_id : '';
if (destination != '') {
if (!isNaN(parseFloat(destination)) && isFinite(destination)) {
if (call_id == '') {
cmd = get_originate_cmd(from_ext+'@<?php echo $_SESSION["domain_name"]?>', destination); //make a call
}
else {
cmd = get_transfer_cmd(call_id, destination);
}
if (cmd != '') {
send_cmd('exec.php?cmd='+escape(cmd));
$('#destination_'+from_ext+'_'+which).removeAttr('onblur');
toggle_destination(from_ext, which);
}
}
}
}
//kill call
function kill_call(call_id) {
if (call_id != '') {
cmd = 'uuid_kill ' + call_id;
send_cmd('exec.php?cmd='+escape(cmd));
}
}
//eavesdrop call
function eavesdrop_call(ext, chan_uuid) {
if (ext != '' && chan_uuid != '') {
cmd = get_eavesdrop_cmd(ext, chan_uuid);
if (cmd != '') {
send_cmd('exec.php?cmd='+escape(cmd));
}
}
}
//record call
function record_call(chan_uuid) {
if (chan_uuid != '') {
cmd = get_record_cmd(chan_uuid);
if (cmd != '') {
send_cmd('exec.php?cmd='+escape(cmd));
}
}
}
//used by call control and ajax refresh functions
function send_cmd(url) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
}
//hide/show destination input field
function toggle_destination(ext, which) {
refresh_stop();
if (which == 'call') {
if ($('#destination_'+ext+'_call').is(':visible')) {
$('#destination_'+ext+'_call').val('');
$('#destination_'+ext+'_call').autocomplete('destroy');
$('#destination_'+ext+'_call').hide(0, function() {
$('.call_control').children().attr('onmouseout', "refresh_start();");
$('.destination_control').attr('onmouseout', "refresh_start();");
refresh_start();
});
}
else {
$('#destination_'+ext+'_call').show(0, function() {
$('#destination_'+ext+'_call').focus();
$('#destination_'+ext+'_call').autocomplete({
source: "autocomplete.php",
minLength: 3,
select: function(event, ui) {
$('#destination_'+ext+'_call').val(ui.item.value);
$('#frm_destination_'+ext+'_call').submit();
}
});
$('.call_control').children().removeAttr('onmouseout');
$('.destination_control').removeAttr('onmouseout');
});
}
}
else if (which == 'transfer') {
if ($('#destination_'+ext+'_transfer').is(':visible')) {
$('#destination_'+ext+'_transfer').val('');
$('#destination_'+ext+'_transfer').autocomplete('destroy');
$('#destination_'+ext+'_transfer').hide(0, function() {
$('#op_caller_details_'+ext).show();
$('.call_control').children().attr('onmouseout', "refresh_start();");
$('.destination_control').attr('onmouseout', "refresh_start();");
refresh_start();
});
}
else {
$('#op_caller_details_'+ext).hide(0, function() {
$('#destination_'+ext+'_transfer').show(0, function() {
$('#destination_'+ext+'_transfer').focus();
$('#destination_'+ext+'_transfer').autocomplete({
source: "autocomplete.php",
minLength: 3,
select: function(event, ui) {
$('#destination_'+ext+'_transfer').val(ui.item.value);
$('#frm_destination_'+ext+'_transfer').submit();
}
});
$('.call_control').children().removeAttr('onmouseout');
$('.destination_control').removeAttr('onmouseout');
});
});
}
}
}
function get_transfer_cmd(uuid, destination) {
cmd = "uuid_transfer " + uuid + " " + destination + " XML <?php echo trim($_SESSION['user_context'])?>";
return cmd;
}
function get_originate_cmd(source, destination) {
cmd = "bgapi originate {sip_auto_answer=true,origination_caller_id_number=" + destination + ",sip_h_Call-Info=_undef_}user/" + source + " " + destination + " XML <?php echo trim($_SESSION['user_context'])?>";
return cmd;
}
function get_eavesdrop_cmd(ext, chan_uuid) {
cmd = "bgapi originate {origination_caller_id_name=<?php echo $text['label-eavesdrop']?>,origination_caller_id_number=" + ext + "}user/"+(document.getElementById('eavesdrop_dest').value)+"@<?php echo $_SESSION['domain_name']?> &eavesdrop(" + chan_uuid + ")";
return cmd;
}
function get_record_cmd(uuid) {
cmd = "uuid_record " + uuid + " start <?php echo $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']; ?>/archive/<?php echo date('Y')?>/<?php echo date('M')?>/<?php echo date('d')?>/" + uuid + ".wav";
return cmd;
}
//virtual functions
function virtual_drag(call_id, ext) {
if (document.getElementById('vd_ext_from').value != '' && document.getElementById('vd_ext_to').value != '') {
virtual_drag_reset();
}
if (call_id != '') {
document.getElementById('vd_call_id').value = call_id;
}
if (ext != '') {
if (document.getElementById('vd_ext_from').value == '') {
document.getElementById('vd_ext_from').value = ext;
document.getElementById(ext).style.borderStyle = 'dotted';
if (document.getElementById('vd_ext_to').value != '') {
document.getElementById(document.getElementById('vd_ext_to').value).style.borderStyle = '';
document.getElementById('vd_ext_to').value = '';
}
}
else {
document.getElementById('vd_ext_to').value = ext;
if (document.getElementById('vd_ext_from').value != document.getElementById('vd_ext_to').value) {
if (document.getElementById('vd_call_id').value != '') {
cmd = get_transfer_cmd(document.getElementById('vd_call_id').value, document.getElementById('vd_ext_to').value); //transfer a call
}
else {
cmd = get_originate_cmd(document.getElementById('vd_ext_from').value + '@<?php echo $_SESSION["domain_name"]?>', document.getElementById('vd_ext_to').value); //originate a call
}
if (cmd != '') {
//alert(cmd);
send_cmd('exec.php?cmd='+escape(cmd));
}
}
virtual_drag_reset();
}
}
}
function virtual_drag_reset(vd_var) {
if (!(vd_var === undefined)) {
document.getElementById(vd_var).value = '';
}
else {
document.getElementById('vd_call_id').value = '';
if (document.getElementById('vd_ext_from').value != '') {
document.getElementById(document.getElementById('vd_ext_from').value).style.borderStyle = '';
document.getElementById('vd_ext_from').value = '';
}
if (document.getElementById('vd_ext_to').value != '') {
document.getElementById(document.getElementById('vd_ext_to').value).style.borderStyle = '';
document.getElementById('vd_ext_to').value = '';
}
}
}
</script>
<style type="text/css">
TABLE {
border-spacing: 0px;
border-collapse: collapse;
border: none;
}
</style>
<?php
//create simple array of users own extensions
unset($_SESSION['user']['extensions']);
if (is_array($_SESSION['user']['extension'])) {
foreach ($_SESSION['user']['extension'] as $assigned_extensions) {
$_SESSION['user']['extensions'][] = $assigned_extensions['user'];
}
}
?>
<div id='ajax_reponse'></div>
<div id='cmd_reponse' style='display: none;'></div>
<br><br>
<?php
//include the footer
require_once "resources/footer.php";
?>

View File

@@ -0,0 +1,467 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2016
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "./resources/functions/get_call_activity.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the call activity
$activity = get_call_activity();
if (is_array($activity)) foreach ($activity as $extension => $fields) {
if (substr_count($fields['call_group'], ',')) {
$tmp = explode(',', $fields['call_group']);
if (is_array($tmp)) foreach ($tmp as $tmp_index => $tmp_value) {
if (trim($tmp_value) == '') { unset($tmp[$tmp_index]); }
else { $groups[] = $tmp_value; }
}
}
else if ($fields['call_group'] != '') {
$groups[] = $fields['call_group'];
}
}
if (is_array($groups)) {
$groups = array_unique($groups);
sort($groups);
}
//prevent warnings
if (!is_array($_SESSION['user']['extensions'])) {
$_SESSION['user']['extensions'] = array();
}
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";
echo "<table width='100%'>";
echo " <tr>";
echo " <td valign='top' align='left' width='50%' nowrap>";
echo " <b>".$text['title-operator_panel']."</b>";
echo " </td>";
echo " <td valign='top' align='center' nowrap>";
if (sizeof($_SESSION['user']['extensions']) > 0) {
$status_options[1]['status'] = "Available";
$status_options[1]['label'] = $text['label-status_available'];
$status_options[1]['style'] = "op_btn_status_available";
if (permission_exists('operator_panel_on_demand')) {
$status_options[2]['status'] = "Available (On Demand)";
$status_options[2]['label'] = $text['label-status_on_demand'];
$status_options[2]['style'] = "op_btn_status_available_on_demand";
}
$status_options[3]['status'] = "On Break";
$status_options[3]['label'] = $text['label-status_on_break'];
$status_options[3]['style'] = "op_btn_status_on_break";
$status_options[4]['status'] = "Do Not Disturb";
$status_options[4]['label'] = $text['label-status_do_not_disturb'];
$status_options[4]['style'] = "op_btn_status_do_not_disturb";
$status_options[5]['status'] = "Logged Out";
$status_options[5]['label'] = $text['label-status_logged_out'];
$status_options[5]['style'] = "op_btn_status_logged_out";
if (is_array($status_options)) foreach ($status_options as $status_option) {
echo " <input type='button' id='".$status_option['style']."' class='btn' value=\"".$status_option['label']."\" onclick=\"send_cmd('index.php?status='+escape('".$status_option['status']."')); this.disabled='disabled'; refresh_start();\" ".$onhover_pause_refresh.">\n";
}
}
echo " </td>";
echo " <td valign='top' align='right' width='50%' nowrap>";
echo " <table cellpadding='0' cellspacing='0' border='0'>";
echo " <tr>";
echo " <td valign='middle' nowrap='nowrap' style='padding-right: 15px' id='refresh_state'>";
echo " <img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\">";
echo " </td>";
if (permission_exists('operator_panel_eavesdrop')) {
echo " <td valign='top' nowrap='nowrap'>";
if (sizeof($_SESSION['user']['extensions']) > 1) {
echo " <input type='hidden' id='eavesdrop_dest' value=\"".(($_REQUEST['eavesdrop_dest'] == '') ? $_SESSION['user']['extension'][0]['destination'] : $_REQUEST['eavesdrop_dest'])."\">";
echo " <img src='resources/images/eavesdrop.png' style='width: 12px; height: 12px; border: none; margin: 0px 5px; cursor: help;' title='".$text['description-eavesdrop_destination']."' align='absmiddle'>";
echo " <select class='formfld' style='margin-right: 5px;' align='absmiddle' onchange=\"document.getElementById('eavesdrop_dest').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
if (is_array($_SESSION['user']['extensions'])) foreach ($_SESSION['user']['extensions'] as $user_extension) {
echo " <option value='".$user_extension."' ".(($_REQUEST['eavesdrop_dest'] == $user_extension) ? "selected" : null).">".$user_extension."</option>\n";
}
echo " </select>\n";
}
else if (sizeof($_SESSION['user']['extensions']) == 1) {
echo " <input type='hidden' id='eavesdrop_dest' value=\"".$_SESSION['user']['extension'][0]['destination']."\">";
}
echo " </td>";
}
if (sizeof($groups) > 0) {
echo " <td valign='top' nowrap='nowrap'>";
echo " <input type='hidden' id='group' value=\"".$_REQUEST['group']."\">";
if (sizeof($groups) > 5) {
//show select box
echo " <select class='formfld' onchange=\"document.getElementById('group').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
echo " <option value='' ".(($_REQUEST['group'] == '') ? "selected" : null).">".$text['label-call_group']."</option>";
echo " <option value=''>".$text['button-all']."</option>";
if (is_array($groups)) foreach ($groups as $group) {
echo " <option value='".$group."' ".(($_REQUEST['group'] == $group) ? "selected" : null).">".$group."</option>\n";
}
echo " </select>\n";
}
else {
//show buttons
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".$text['button-all']."\" onclick=\"document.getElementById('group').value = '';\" ".$onhover_pause_refresh.">";
if (is_array($groups)) foreach ($groups as $group) {
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".$group."\" ".(($_REQUEST['group'] == $group) ? "disabled='disabled'" : null)." onclick=\"document.getElementById('group').value = this.value;\" ".$onhover_pause_refresh.">";
}
}
echo " </td>";
}
echo " </tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "<br>";
if (is_array($activity)) foreach ($activity as $extension => $ext) {
unset($block);
//filter by group, if defined
if ($_REQUEST['group'] != '' && substr_count($ext['call_group'], $_REQUEST['group']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
//check if feature code being called
$format_number = (substr($ext['dest'], 0, 1) == '*') ? false : true;
//determine extension state, direction icon, and displayed name/number for caller/callee
if ($ext['state'] == 'CS_EXECUTE') {
if (($ext['callstate'] == 'RINGING' || $ext['callstate'] == 'EARLY' || $ext['callstate'] == 'RING_WAIT') && $ext['direction'] == 'inbound') {
$ext_state = 'ringing';
}
else if ($ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
else if ($ext['callstate'] == 'RING_WAIT' && $ext['direction'] == 'outbound') {
$ext_state = 'ringing';
}
else if ($ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'inbound') {
$ext_state = 'active';
}
if (!$format_number) {
$call_name = 'System';
$call_number = $ext['dest'];
}
else {
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
}
$dir_icon = 'outbound';
}
else if ($ext['state'] == 'CS_HIBERNATE') {
if ($ext['callstate'] == 'ACTIVE') {
$ext_state = 'active';
if ($ext['direction'] == 'inbound') {
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
$dir_icon = 'outbound';
}
else if ($ext['direction'] == 'outbound') {
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
$call_number = format_phone($ext['cid_num']);
$dir_icon = 'inbound';
}
}
}
else if ($ext['state'] == 'CS_CONSUME_MEDIA' || $ext['state'] == 'CS_EXCHANGE_MEDIA') {
if ($ext['state'] == 'CS_CONSUME_MEDIA' && $ext['callstate'] == 'RINGING' && $ext['direction'] == 'outbound') {
$ext_state = 'ringing';
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
$dir_icon = 'inbound';
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
$call_number = format_phone($ext['cid_num']);
}
else {
unset($ext_state, $dir_icon, $call_name, $call_number);
}
//determine block style by state (if any)
$style = ($ext_state != '') ? "op_state_".$ext_state : null;
//determine the call identifier passed on drop
if ($ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') { // transfer an outbound internal call
$call_identifier = $activity[$call_number]['uuid'];
}
else if (($ext['variable_call_direction'] == 'outbound' || $ext['variable_call_direction'] == 'local') && $ext['variable_bridge_uuid'] != '') { // transfer an outbound external call
$call_identifier = $ext['variable_bridge_uuid'];
}
else {
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
if (permission_exists('operator_panel_manage')) {
if (!in_array($extension, $_SESSION['user']['extensions'])) {
//other extension
if ($ext_state == "ringing") {
if ($_GET['vd_ext_from'] == '' && $dir_icon == 'inbound') {
$draggable = true; // selectable - is ringing and not outbound so can transfer away the call (can set as vd_ext_from)
}
else {
$draggable = false; // unselectable - is ringing so can't send a call to the ext (can't set as vd_ext_to)
}
}
else if ($ext_state == 'active') {
$draggable = false; // unselectable - on a call already so can't transfer or send a call to the ext (can't set as vd_ext_from or vd_ext_to)
}
else { // idle
if ($_GET['vd_ext_from'] == '') {
$draggable = false; // unselectable - is idle, but can't initiate a call from the ext as is not assigned to user (can't set as vd_ext_from)
}
else {
$draggable = true; // selectable - is idle, so can transfer a call in to ext (can set as vd_ext_to).
}
}
}
else {
//user extension
if ($ext['uuid'] != '' && $ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') {
$draggable = false;
}
else if ($ext_state == 'ringing' && $ext['variable_call_direction'] == 'local') {
$draggable = false;
}
else if ($ext_state != '' && !$format_number) {
$draggable = false;
}
else {
$draggable = true;
}
}
}
else {
$draggable = false;
}
//determine extension (user) status
$ext_status = (in_array($extension, $_SESSION['user']['extensions'])) ? $ext_user_status[$_SESSION['user_uuid']] : $ext_user_status[$ext['user_uuid']];
switch ($ext_status) {
case "Available" :
$status_icon = "available";
$status_hover = $text['label-status_available'];
break;
case "Available (On Demand)" :
$status_icon = "available_on_demand";
$status_hover = $text['label-status_available_on_demand'];
break;
case "On Break" :
$status_icon = "on_break";
$status_hover = $text['label-status_on_break'];
break;
case "Do Not Disturb" :
$status_icon = "do_not_disturb";
$status_hover = $text['label-status_do_not_disturb'];
break;
default :
$status_icon = "logged_out";
$status_hover = $text['label-status_logged_out_or_unknown'];
}
$block .= "<div id='".$extension."' class='op_ext ".$style."' ".(($_GET['vd_ext_from'] == $extension || $_GET['vd_ext_to'] == $extension) ? "style='border-style: dotted;'" : null)." ".(($ext_state != 'active' && $ext_state != 'ringing') ? "ondrop='drop(event, this.id);' ondragover='allowDrop(event, this.id);' ondragleave='discardDrop(event, this.id);'" : null).">"; // DRAG TO
$block .= "<table class='op_ext ".$style."'>";
$block .= " <tr>";
$block .= " <td class='op_ext_icon'>";
$block .= " <span name='".$extension."'>"; // DRAG FROM
$block .= "<img id='".$call_identifier."' class='op_ext_icon' src='resources/images/status_".$status_icon.".png' title='".$status_hover."' ".(($draggable) ? "draggable='true' ondragstart=\"drag(event, this.parentNode.getAttribute('name'));\" onclick=\"virtual_drag('".$call_identifier."', '".$extension."');\"" : "onfocus='this.blur();' draggable='false' style='cursor: not-allowed;'").">";
$block .= "</span>";
$block .= " </td>";
$block .= " <td class='op_ext_info ".$style."'>";
if ($dir_icon != '') {
$block .= " <img src='resources/images/".$dir_icon.".png' align='right' style='margin-top: 3px; margin-right: 1px; width: 12px; height: 12px; cursor: help;' draggable='false' alt=\"".$text['label-call_direction']."\" title=\"".$text['label-call_direction']."\">";
}
$block .= " <span class='op_user_info'>";
if ($ext['effective_caller_id_name'] != '' && $ext['effective_caller_id_name'] != $extension) {
$block .= " <strong class='strong'>".$ext['effective_caller_id_name']."</strong> (".$extension.")";
}
else {
$block .= " <strong class='strong'>".$extension."</strong>";
}
$block .= " </span><br>";
if ($ext_state != '') {
$block .= " <span class='op_caller_info'>";
$block .= " <table align='right'><tr><td style='text-align: right;'>";
$block .= " <span class='op_call_info'>".$ext['call_length']."</span><br>";
$block .= " <span class='call_control'>";
//record
if (permission_exists('operator_panel_record') && $ext_state == 'active') {
$call_identifier_record = $ext['call_uuid'];
$rec_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$call_identifier_record.".wav";
if (file_exists($rec_file)) {
$block .= "<img src='resources/images/recording.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: help;' title=\"".$text['label-recording']."\" ".$onhover_pause_refresh.">";
}
else {
$block .= "<img src='resources/images/record.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title=\"".$text['label-record']."\" onclick=\"record_call('".$call_identifier_record."');\" ".$onhover_pause_refresh.">";
}
}
//eavesdrop
if (permission_exists('operator_panel_eavesdrop') && $ext_state == 'active' && sizeof($_SESSION['user']['extensions']) > 0 && !in_array($extension, $_SESSION['user']['extensions'])) {
$block .= "<img src='resources/images/eavesdrop.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title='".$text['label-eavesdrop']."' onclick=\"eavesdrop_call('".$ext['destination']."','".$call_identifier."');\" ".$onhover_pause_refresh.">";
}
//kill
if (permission_exists('operator_panel_kill') || in_array($extension, $_SESSION['user']['extensions'])) {
if ($ext['variable_bridge_uuid'] == '' && $ext_state == 'ringing') {
$call_identifier_kill = $ext['uuid'];
}
else if ($dir_icon == 'outbound') {
$call_identifier_kill = $ext['uuid'];
}
else {
$call_identifier_kill = $call_identifier;
}
$block .= "<img src='resources/images/kill.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title='".$text['label-kill']."' onclick=\"kill_call('".$call_identifier_kill."');\" ".$onhover_pause_refresh.">";
}
$block .= "</span>";
//transfer
if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$block .= "<img id='destination_control_".$extension."_transfer' class='destination_control' src='resources/images/keypad_transfer.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' onclick=\"toggle_destination('".$extension."', 'transfer');\" ".$onhover_pause_refresh.">";
}
$block .= " </td></tr></table>";
if (permission_exists('operator_panel_call_details')) {
$block .= " <span id='op_caller_details_".$extension."'><strong>".escape($call_name)."</strong><br>".escape($call_number)."</span>";
}
$block .= " </span>";
//transfer
if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$call_identifier_transfer = $ext['variable_bridge_uuid'];
$block .= " <form id='frm_destination_".$extension."_transfer' onsubmit=\"go_destination('".$extension."', document.getElementById('destination_".$extension."_transfer').value, 'transfer', '".$call_identifier_transfer."'); return false;\">";
$block .= " <input type='text' class='formfld' id='destination_".$extension."_transfer' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 3px; text-align: center; display: none;' onblur=\"toggle_destination('".$extension."', 'transfer');\">";
$block .= " </form>\n";
}
}
else {
//call
if (in_array($extension, $_SESSION['user']['extensions'])) {
$block .= " <img id='destination_control_".$extension."_call' class='destination_control' src='resources/images/keypad_call.png' style='width: 12px; height: 12px; border: none; margin-top: 26px; margin-right: 1px; cursor: pointer;' align='right' onclick=\"toggle_destination('".$extension."', 'call');\" ".$onhover_pause_refresh.">";
$block .= " <form id='frm_destination_".$extension."_call' onsubmit=\"go_destination('".$extension."', document.getElementById('destination_".$extension."_call').value, 'call'); return false;\">";
$block .= " <input type='text' class='formfld' id='destination_".$extension."_call' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 10px; text-align: center; display: none;' onblur=\"toggle_destination('".$extension."', 'call');\">";
$block .= " </form>\n";
}
}
$block .= " </td>";
$block .= " </tr>";
$block .= "</table>";
if (if_group("superadmin") && isset($_GET['debug'])) {
$block .= "<span style='font-size: 10px;'>";
$block .= "From ID<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: maroon'>".$extension."</strong><br>";
$block .= "uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['uuid'] ? 'blue' : 'black').";'>".$ext['uuid']."</strong><br>";
$block .= "call_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['call_uuid'] ? 'blue' : 'black').";'>".$ext['call_uuid']."</strong><br>";
$block .= "variable_bridge_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['variable_bridge_uuid'] ? 'blue' : 'black').";'>".$ext['variable_bridge_uuid']."</strong><br>";
$block .= "direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['direction']."</strong><br>";
$block .= "variable_call_direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['variable_call_direction']."</strong><br>";
$block .= "state<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['state']."</strong><br>";
$block .= "cid_num<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['cid_num']."</strong><br>";
$block .= "dest<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['dest']."</strong><br>";
$block .= "context<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['context']."</strong><br>";
$block .= "presence_id<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['presence_id']."</strong><br>";
$block .= "callstate<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".$ext['callstate']."</strong><br>";
$block .= "</span>";
}
$block .= "</div>";
if (in_array($extension, $_SESSION['user']['extensions'])) {
$user_extensions[] = $block;
}
else {
$other_extensions[] = $block;
}
}
if (sizeof($user_extensions) > 0) {
echo "<table width='100%'><tr><td>";
if (is_array($user_extensions)) foreach ($user_extensions as $ext_block) {
echo $ext_block;
}
echo "</td></tr></table>";
}
if ($_REQUEST['group'] != '') {
if (sizeof($user_extensions) > 0) { echo "<br>"; }
echo "<strong style='color: black;'>".ucwords($_REQUEST['group'])."</strong>";
echo "<br><br>";
}
else if (sizeof($user_extensions) > 0) {
echo "<br>";
echo "<strong style='color: black;'>".$text['label-other_extensions']."</strong>";
echo "<br><br>";
}
if (sizeof($other_extensions) > 0) {
echo "<table width='100%'><tr><td>";
if (is_array($other_extensions)) foreach ($other_extensions as $ext_block) {
echo $ext_block;
}
echo "</td></tr></table>";
}
else {
echo $text['label-no_extensions_found'];
}
echo "<br><br>";
/*
if (if_group("superadmin") && isset($_GET['debug'])) {
echo '$activity<br>';
echo "<textarea style='width: 100%; height: 600px; overflow: scroll;' onfocus='refresh_stop();' onblur='refresh_start();'>";
print_r($activity);
echo "</textarea>";
echo "<br><br>";
echo '$_SESSION<br>';
echo "<textarea style='width: 100%; height: 600px; overflow: scroll;' onfocus='refresh_stop();' onblur='refresh_start();'>";
print_r($_SESSION);
echo "</textarea>";
}
*/
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>