diff --git a/app/calls_active/app_languages.php b/app/calls_active/app_languages.php index e5a4eacf47..83d93f15a6 100644 --- a/app/calls_active/app_languages.php +++ b/app/calls_active/app_languages.php @@ -468,8 +468,8 @@ $text['label-domain']['zh-cn'] = "领域"; $text['label-domain']['ja-jp'] = "ドメイン"; $text['label-domain']['ko-kr'] = "도메인"; -$text['label-destination']['en-us'] = "Dest"; -$text['label-destination']['en-gb'] = "Dest"; +$text['label-destination']['en-us'] = "Destination"; +$text['label-destination']['en-gb'] = "Destination"; $text['label-destination']['ar-eg'] = "الوجهة"; $text['label-destination']['de-at'] = "Ziel"; $text['label-destination']['de-ch'] = "Ziel"; @@ -546,8 +546,8 @@ $text['label-codec']['zh-cn'] = "读/写编解码器"; $text['label-codec']['ja-jp'] = "読み取り/書き込みコーデック"; $text['label-codec']['ko-kr'] = "읽기/쓰기 코덱"; -$text['label-cid-number']['en-us'] = "CID Number"; -$text['label-cid-number']['en-gb'] = "CID Number"; +$text['label-cid-number']['en-us'] = "Caller Number"; +$text['label-cid-number']['en-gb'] = "Caller Number"; $text['label-cid-number']['ar-eg'] = "رقم CID"; $text['label-cid-number']['de-at'] = "Anrufer Nummer"; $text['label-cid-number']['de-ch'] = "Anrufer Nummer"; @@ -572,8 +572,8 @@ $text['label-cid-number']['zh-cn'] = "来电号码"; $text['label-cid-number']['ja-jp'] = "CID番号"; $text['label-cid-number']['ko-kr'] = "CID 번호"; -$text['label-cid-name']['en-us'] = "CID Name"; -$text['label-cid-name']['en-gb'] = "CID Name"; +$text['label-cid-name']['en-us'] = "Caller Name"; +$text['label-cid-name']['en-gb'] = "Caller Name"; $text['label-cid-name']['ar-eg'] = "اسم CID"; $text['label-cid-name']['de-at'] = "Anrufer Name"; $text['label-cid-name']['de-ch'] = "Anrufer Name"; diff --git a/app/calls_active/calls_active_inc.php b/app/calls_active/calls_active_inc.php index 787af746b3..567951aa52 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -88,10 +88,8 @@ } $num_rows = @sizeof($rows); - //if the connnection is available then run it and return the results if (!$event_socket) { - $msg = "
".$text['confirm-socket']."
"; echo "
\n"; echo "\n"; @@ -103,191 +101,203 @@ echo "\n"; echo "
\n"; echo "
\n"; - + return; } - else { - //create token - $object = new token; - $token = $object->create('/app/calls_active/calls_active_inc.php'); +//create token + $object = new token; + $token = $object->create('/app/calls_active/calls_active_inc.php'); - //show content - echo "
\n"; - echo "
".$text['title']."
".number_format($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') && !empty($_SESSION['user']['extensions'])) { - if (sizeof($_SESSION['user']['extensions']) > 1) { - echo " \n"; - echo " \n"; - 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');"]); + } + if (permission_exists('call_active_all')) { + if ($show == "all") { + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'calls_active.php','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + else { + echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'calls_active.php?show=all','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + } + echo "
\n"; + echo "
\n"; + echo "
\n"; + + if (permission_exists('call_active_hangup') && $rows) { + echo modal::create(['id'=>'modal-hangup','type'=>'general','message'=>$text['confirm-hangups'],'actions'=>button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'check','id'=>'btn_hangup','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('hangup'); list_form_submit('form_list');"])]); + } + + echo $text['description']."\n"; + echo "

\n"; + +//show the results + echo "
\n"; + + echo "
\n"; + echo "\n"; + + echo "
\n"; + echo " \n"; + echo " \n"; + if (permission_exists('call_active_hangup')) { + echo " \n"; + } + echo " \n"; + //echo" \n"; + echo " \n"; + if ($show == 'all') { + echo " \n"; + } + //echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { + echo " \n"; + } + echo " \n"; + + if (is_array($rows)) { + $x = 0; + foreach ($rows as $row) { + + //set the php variables + foreach ($row as $key => $value) { + $$key = $value; + } + + //get the sip profile + $name_array = explode("/", $name); + $sip_profile = $name_array[1]; + $sip_uri = $name_array[2]; + + //get the number + //$temp_array = explode("@", $sip_uri); + //$tmp_number = $temp_array[0]; + //$tmp_number = str_replace("sip:", "", $tmp_number); + + //remove the '+' because it breaks the call recording + $cid_num = str_replace("+", "", $cid_num); + + //replace gateway uuid with name + if (is_array($_SESSION['gateways']) && sizeof($_SESSION['gateways']) > 0) { + foreach ($_SESSION['gateways'] as $gateway_uuid => $gateway_name) { + $application_data = str_replace($gateway_uuid, $gateway_name, $application_data); } - echo " \n"; } - else if (sizeof($_SESSION['user']['extensions']) == 1) { - echo " \n"; + + //convert $created to a UNIX timestamp + $created_timestamp = strtotime($created); + + //get the current timestamp + $now = time(); + + //calculate elapsed seconds + $elapsed_seconds = $now - $created_timestamp; + + //convert seconds to hours, minutes, and seconds + $hours = floor($elapsed_seconds / 3600); + $minutes = floor(($elapsed_seconds % 3600) / 60); + $seconds = $elapsed_seconds % 60; + + //format the elapsed time as HH:MM:SS + $elapsed_time = sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds); + + //reduce too long app data + if(strlen($application_data) > 80) { + $application_data = substr($application_data, 0, 80) . '...'; } - } - 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');"]); - } - if (permission_exists('call_active_all')) { - if ($show == "all") { - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'calls_active.php','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + + //send the html + echo " \n"; + if (permission_exists('call_active_hangup')) { + echo " \n"; } - else { - echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'calls_active.php?show=all','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + echo " \n"; + //echo " \n"; + echo " \n"; + if ($show == 'all') { + echo " \n"; } - } - echo " \n"; - echo "
\n"; - echo "\n"; - - if (permission_exists('call_active_hangup') && $rows) { - echo modal::create(['id'=>'modal-hangup','type'=>'general','message'=>$text['confirm-hangups'],'actions'=>button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'check','id'=>'btn_hangup','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('hangup'); list_form_submit('form_list');"])]); - } - - echo $text['description']."\n"; - echo "

\n"; - - //show the results - echo "
\n"; - - echo "\n"; - echo "\n"; - - echo "
\n"; - echo "
\n"; + echo " \n"; + echo " ".$text['label-profile']."".$text['label-created']."".$text['label-duration']."".$text['label-domain']."".$text['label-number']."".$text['label-cid-name']."".$text['label-cid-number']."".$text['label-destination']."".$text['label-app']."".$text['label-codec']."".$text['label-secure']." 
\n"; + echo " \n"; + echo " \n"; + echo " ".escape($sip_profile)." ".escape($created)." ".escape($elapsed_time)."".escape($domain_name)." 
\n"; - echo "\n"; - if (permission_exists('call_active_hangup')) { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - if ($show == 'all') { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { - echo " \n"; - } - echo "\n"; - - if (is_array($rows)) { - $x = 0; - foreach ($rows as $row) { - - //set the php variables - foreach ($row as $key => $value) { - $$key = $value; - } - - //get the sip profile - $name_array = explode("/", $name); - $sip_profile = $name_array[1]; - $sip_uri = $name_array[2]; - - //get the number - $temp_array = explode("@", $sip_uri); - $tmp_number = $temp_array[0]; - $tmp_number = str_replace("sip:", "", $tmp_number); - - //remove the '+' because it breaks the call recording - $cid_num = str_replace("+", "", $cid_num); - - //replace gateway uuid with name - if (is_array($_SESSION['gateways']) && sizeof($_SESSION['gateways']) > 0) { - foreach ($_SESSION['gateways'] as $gateway_uuid => $gateway_name) { - $application_data = str_replace($gateway_uuid, $gateway_name, $application_data); - } - } - - // reduce too long app data - if(strlen($application_data) > 512) { - $application_data = substr($application_data, 0, 512) . '...'; - } - - //send the html - echo "\n"; - if (permission_exists('call_active_hangup')) { - echo " \n"; - } - echo " \n"; - echo " \n"; - // Convert $created to a UNIX timestamp - $created_timestamp = strtotime($created); - - // Get the current timestamp - $now = time(); - - // Calculate elapsed seconds - $elapsed_seconds = $now - $created_timestamp; - - // Convert seconds to hours, minutes, and seconds - $hours = floor($elapsed_seconds / 3600); - $minutes = floor(($elapsed_seconds % 3600) / 60); - $seconds = $elapsed_seconds % 60; - - // Format the elapsed time as HH:MM:SS - $elapsed_time = sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds); - - echo " \n"; - if ($show == 'all') { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { - echo " \n"; - } - echo "\n"; - - //unset the domain name - unset($domain_name); - - //increment counter - $x++; + //echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { + echo " \n"; } - unset($rows); - } + echo " \n"; - echo "
\n"; - echo " \n"; - echo " ".$text['label-profile']."".$text['label-created']."".$text['label-duration']."".$text['label-domain']."".$text['label-number']."".$text['label-cid-name']."".$text['label-cid-number']."".$text['label-destination']."".$text['label-app']."".$text['label-codec']."".$text['label-secure']." 
\n"; - echo " \n"; - echo " \n"; - echo " ".escape($sip_profile)." ".escape($created)." ".escape($elapsed_time)."".escape($domain_name)." ".escape($tmp_number)." ".escape($cid_name)." ".escape($cid_num)." ".escape($dest)." ".(!empty($application) ? escape($application).":".escape($application_data) : null)." ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." ".escape($secure)." \n"; - //eavesdrop - if (permission_exists('call_active_eavesdrop') && $callstate == 'ACTIVE' && !empty($_SESSION['user']['extensions']) && !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 "
".escape($tmp_number)." ".escape($cid_name)." ".escape($cid_num)." ".escape($dest)." ".(!empty($application) ? escape($application).":".escape($application_data) : null)." ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." ".escape($secure)." \n"; + //eavesdrop + if (permission_exists('call_active_eavesdrop') && $callstate == 'ACTIVE' && !empty($_SESSION['user']['extensions']) && !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"; - - echo "\n"; - - echo "
\n"; + //unset the domain name + unset($domain_name); + //increment counter + $x++; + } } + echo " \n"; + echo "\n"; + echo "\n"; + echo "\n"; + ?>