\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";
- echo " | \n";
- }
- echo " ".escape($sip_profile)." | \n";
- echo " ".escape($created)." | \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 " ".escape($elapsed_time)." | \n";
- if ($show == 'all') {
- echo " ".escape($domain_name)." | \n";
- }
- echo " ".escape($tmp_number)." | \n";
- echo " ".escape($cid_name)." | \n";
- echo " ".escape($cid_num)." | \n";
- echo " ".escape($dest)." | \n";
- echo " ".(!empty($application) ? escape($application).":".escape($application_data) : null)." | \n";
- echo " ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." | \n";
- echo " ".escape($secure)." | \n";
- if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) {
- echo " \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";
-
- //unset the domain name
- unset($domain_name);
-
- //increment counter
- $x++;
+ //echo " ".escape($tmp_number)." | \n";
+ echo " ".escape($cid_name)." | \n";
+ echo " ".escape($cid_num)." | \n";
+ echo " ".escape($dest)." | \n";
+ echo " ".(!empty($application) ? escape($application).":".escape($application_data) : null)." | \n";
+ echo " ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." | \n";
+ echo " ".escape($secure)." | \n";
+ if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) {
+ echo " \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";
}
- unset($rows);
- }
+ echo " \n";
- echo "