* Portions created by the Initial Developer are Copyright (C) 2008-2025 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Mark J Crane * Tim Fry */ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('call_active_view')) { //access granted } else { echo "access denied"; exit; } //set a default value $debug = false; global $domain_uuid, $user_uuid, $settings, $database, $config; if (empty($domain_uuid)) { $domain_uuid = $_SESSION['domain_uuid'] ?? ''; } if (empty($user_uuid)) { $user_uuid = $_SESSION['user_uuid'] ?? ''; } if (!($config instanceof config)) { $config = config::load(); } if (!($database instanceof database)) { $database = database::new(); } if (!($settings instanceof settings)) { $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); } //ensure we have the proper icons to avoid PHP warnings $theme_button_icon_all = $settings->get('theme', 'button_icon_all'); $theme_button_icon_back = $settings->get('theme', 'button_icon_back'); $theme_button_icon_broom = $settings->get('theme', 'button_icon_broom'); //add multi-lingual support $language = new text; $text = $language->get(); $token = (new token())->create($_SERVER['PHP_SELF']); //show the header $document['title'] = $text['title']; require_once dirname(__DIR__, 2) . "/resources/header.php"; //add the style echo "\n"; // if (permission_exists('call_active_details')) { if ($debug) { echo "\n"; } echo "
\n"; if (permission_exists('call_active_all')) { echo "
" . $text['title'] . "
0
"; } else { echo "
" . $text['title'] . "
0
"; } echo "
\n"; if (permission_exists('call_active_all')) { // Show All button echo button::create([ 'id' => 'btn_show_all', 'type' => 'button', 'label' => $text['button-show_all'], 'icon' => $theme_button_icon_all, ]); // Hide the back button initially echo button::create([ 'id' => 'btn_back', 'label' => $text['button-back'], 'icon' => $theme_button_icon_back, 'style' => 'display: none;', ]); } if (!$settings->get('active_calls', 'remove_completed_calls', true)) { // Clear rows (development) echo button::create([ 'id' => 'btn_clear', 'label' => $text['button-clear'] ?? 'clear', 'icon' => $theme_button_icon_broom, 'style' => 'display: inline-block;', 'onclick' => 'clear_rows()' ]); } if (permission_exists('call_active_hangup')) { if (permission_exists('call_active_hangup')) { // Hangup selected calls echo button::create([ 'id' => 'btn_hangup', 'type' => 'button', 'label' => $text['label-hangup'], 'icon' => 'phone-slash', 'onclick' => "if (confirm('" . $text['confirm-hangup'] . "')) { " . "hangup_selected();" . "} else { " . "this.blur(); " . "return false; " . "}", ]) . "\n"; } } echo "
\n"; echo "
\n"; echo "
\n"; echo $text['description'] . "\n"; echo "

\n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; if (permission_exists('call_active_hangup')) { echo " \n"; } if (permission_exists('call_active_direction')) { echo " \n"; } if (permission_exists('call_active_profile')) { echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (permission_exists('call_active_application')) { echo " \n"; } if (permission_exists('call_active_codec')) { echo " \n"; } if (permission_exists('call_active_secure')) { echo " \n"; } if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; echo " " . $text['label-direction'] . "" . $text['label-profile'] . "" . $text['label-duration'] . "" . $text['label-cid-name'] . "" . $text['label-cid-number'] . "" . $text['label-destination'] . "" . $text['label-app'] . "" . $text['label-codec'] . "" . $text['label-secure'] . " 
\n"; // After the table, put a generic hangup and eavesdrop button that we can clone if (permission_exists('call_active_hangup')) { echo button::create([ 'id' => 'btn_hangup', 'type' => 'button', 'style' => 'display: none;', 'label' => $text['label-hangup'], 'icon' => 'phone-slash', ]) . "\n"; } echo "
\n"; echo "
\n"; if (permission_exists('call_active_eavesdrop')) { echo button::create([ 'id' => 'btn_eavesdrop' , 'type' => 'button' , 'label' => $text['label-eavesdrop'] , 'icon' => 'headphones' , 'collapse' => 'hide-lg-dn' , 'style' => 'display: none;' ]); } echo " \n"; echo " \n"; // // Pass the token array, websocket services to subscribe to, and time limit to // the subscriber class so that when this subscriber makes a websocket // connection, the subscriber object can validate the information. // subscriber::save_token($token, ['active.calls']); //break the caching $version = md5(file_get_contents(__DIR__, '/resources/javascript/websocket_client.js')); echo "\n"; $version = md5(file_get_contents(__DIR__, '/resources/javascript/arrow.js')); echo "\n"; ?>