Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('xml_cdr_details')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //get the http values and set them to a variable if (is_uuid($_REQUEST["id"])) { $uuid = $_REQUEST["id"]; } //get the destination select list $destination = new destinations; $destination_array = $destination->get('dialplan'); //get the next ordinal id for the array $id = count($destination_array); //get the destinations from the database $sql = "select * from v_destinations "; $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $database = new database; $destinations = $database->select($sql, $parameters, 'all'); if (!empty($destinations)) { foreach($destinations as $row) { $destination_array['destinations'][$id]['application'] = 'destinations'; $destination_array['destinations'][$id]['destination_uuid'] = $row["destination_uuid"]; $destination_array['destinations'][$id]['uuid'] = $row["destination_uuid"]; $destination_array['destinations'][$id]['dialplan_uuid'] = $row["dialplan_uuid"]; $destination_array['destinations'][$id]['destination_type'] = $row["destination_type"]; $destination_array['destinations'][$id]['destination_prefix'] = $row["destination_prefix"]; $destination_array['destinations'][$id]['destination_number'] = $row["destination_number"]; $destination_array['destinations'][$id]['extension'] = $row["destination_prefix"] . $row["destination_number"]; $destination_array['destinations'][$id]['destination_trunk_prefix'] = $row["destination_trunk_prefix"]; $destination_array['destinations'][$id]['destination_area_code'] = $row["destination_area_code"]; $destination_array['destinations'][$id]['context'] = $row["destination_context"]; $destination_array['destinations'][$id]['label'] = $row["destination_description"]; $destination_array['destinations'][$id]['destination_enabled'] = $row["destination_enabled"]; $destination_array['destinations'][$id]['name'] = $row["destination_description"]; $destination_array['destinations'][$id]['description'] = $row["destination_description"]; //$destination_array[$id]['destination_caller_id_name'] = $row["destination_caller_id_name"]; //$destination_array[$id]['destination_caller_id_number'] = $row["destination_caller_id_number"]; $id++; } } unset($sql, $parameters, $row); //add a function to return the find_app function find_app($destination_array, $detail_action) { $result = ''; if (!empty($destination_array)) { foreach($destination_array as $application => $row) { if (!empty($row)) { foreach ($row as $key => $value) { if ($application == 'destinations') { if ('+'.$value['destination_prefix'].$value['destination_number'] == $detail_action or $value['destination_prefix'].$value['destination_number'] == $detail_action or $value['destination_number'] == $detail_action or $value['destination_trunk_prefix'].$value['destination_number'] == $detail_action or '+'.$value['destination_prefix'].$value['destination_area_code'].$value['destination_number'] == $detail_action or $value['destination_prefix'].$value['destination_area_code'].$value['destination_number'] == $detail_action or $value['destination_area_code'].$value['destination_number'] == $detail_action) { if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$application."/app_languages.php")) { $value['application'] = $application; return $value; } } } if ($value['extension'] == $detail_action) { if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$application."/app_languages.php")) { $value['application'] = $application; return $value; } } } } } } } //get the cdr string from the database $sql = "select * from v_xml_cdr "; if (permission_exists('xml_cdr_all')) { $sql .= "where xml_cdr_uuid = :xml_cdr_uuid "; } else { $sql .= "where xml_cdr_uuid = :xml_cdr_uuid "; $sql .= "and domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $domain_uuid; } $parameters['xml_cdr_uuid'] = $uuid; $database = new database; $row = $database->select($sql, $parameters, 'row'); if (!empty($row) && is_array($row) && @sizeof($row) != 0) { $caller_id_name = trim($row["caller_id_name"]); $caller_id_number = trim($row["caller_id_number"]); $caller_destination = trim($row["caller_destination"]); $destination_number = trim($row["destination_number"]); $duration = trim($row["billsec"]); $missed_call = trim($row["missed_call"]); $start_stamp = trim($row["start_stamp"]); $xml_string = trim($row["xml"] ?? ''); $json_string = trim($row["json"]); $direction = trim($row["direction"]); $call_direction = trim($row["direction"]); $status = trim($row["status"]); } unset($sql, $parameters, $row); //get the format if (!empty($xml_string)) { $format = "xml"; } if (!empty($json_string)) { $format = "json"; } //get cdr from the file system if ($format != "xml" && $format != "json") { $tmp_time = strtotime($start_stamp); $tmp_year = date("Y", $tmp_time); $tmp_month = date("M", $tmp_time); $tmp_day = date("d", $tmp_time); $tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day; if (file_exists($tmp_dir.'/'.$uuid.'.json')) { $format = "json"; $json_string = file_get_contents($tmp_dir.'/'.$uuid.'.json'); } if (file_exists($tmp_dir.'/'.$uuid.'.xml')) { $format = "xml"; $xml_string = file_get_contents($tmp_dir.'/'.$uuid.'.xml'); } } //parse the xml to get the call detail record info try { if ($format == 'json') { $array = json_decode($json_string,true); if (is_null($array)) { $j = stripslashes($json_string); $array = json_decode($j,true); } } if ($format == 'xml') { $array = json_decode(json_encode((array)simplexml_load_string($xml_string)),true); } } catch (Exception $e) { echo $e->getMessage(); } //get the variables $xml_cdr_uuid = urldecode($array["variables"]["uuid"]); $language = urldecode($array["variables"]["language"] ?? ''); $start_epoch = urldecode($array["variables"]["start_epoch"]); $start_stamp = urldecode($array["variables"]["start_stamp"]); $start_uepoch = urldecode($array["variables"]["start_uepoch"]); $answer_stamp = urldecode($array["variables"]["answer_stamp"] ?? ''); $answer_epoch = urldecode($array["variables"]["answer_epoch"]); $answer_uepoch = urldecode($array["variables"]["answer_uepoch"]); $end_epoch = urldecode($array["variables"]["end_epoch"]); $end_uepoch = urldecode($array["variables"]["end_uepoch"]); $end_stamp = urldecode($array["variables"]["end_stamp"]); //$duration = urldecode($array["variables"]["duration"]); $mduration = urldecode($array["variables"]["mduration"]); $billsec = urldecode($array["variables"]["billsec"]); $billmsec = urldecode($array["variables"]["billmsec"]); $bridge_uuid = urldecode($array["variables"]["bridge_uuid"] ?? ''); $read_codec = urldecode($array["variables"]["read_codec"] ?? ''); $write_codec = urldecode($array["variables"]["write_codec"] ?? ''); $remote_media_ip = urldecode($array["variables"]["remote_media_ip"] ?? ''); $hangup_cause = urldecode($array["variables"]["hangup_cause"]); $hangup_cause_q850 = urldecode($array["variables"]["hangup_cause_q850"]); $network_address = urldecode($array["variables"]["network_address"]); $outbound_caller_id_name = urldecode($array["variables"]["outbound_caller_id_name"]); $outbound_caller_id_number = urldecode($array["variables"]["outbound_caller_id_number"]); //normalize the array if (!isset($array["callflow"][0])) { $tmp = $array["callflow"]; unset($array["callflow"]); $array["callflow"][0] = $tmp; } //set the time zone if (isset($_SESSION['domain']['time_zone']['name'])) { date_default_timezone_set($_SESSION['domain']['time_zone']['name']); } //reverse the array to put events in chronological order $array["callflow"] = array_reverse($array["callflow"]); //add the profile end time to the call flow array $i = 0; foreach ($array["callflow"] as $row) { //set the profile end time if (isset($array["callflow"][$i+1]["times"]["profile_created_time"])) { $array["callflow"][$i]["times"]["profile_end_time"] = $array["callflow"][$i+1]["times"]["profile_created_time"]; } else { $array["callflow"][$i]["times"]["profile_end_time"] = $end_epoch * 1000000; } $i++; } //format the times in the call flow array and add the profile duration $i = 0; foreach ($array["callflow"] as $row) { foreach ($row["times"] as $name => $value) { if ($value > 0) { $array["callflow"][$i]["times"]["profile_duration_seconds"] = round($array["callflow"][$i]["times"]["profile_end_time"]/1000000 - $array["callflow"][$i]["times"]["profile_created_time"]/1000000); $array["callflow"][$i]["times"]["profile_duration_formatted"] = gmdate("G:i:s", (int) $array["callflow"][$i]["times"]["profile_duration_seconds"]); $array["callflow"][$i]["times"][$name.'stamp'] = date("Y-m-d H:i:s", (int) $value/1000000); } } $i++; } //debug information if (isset($_REQUEST['debug']) && $_REQUEST['debug'] == 'true') { view_array($array["callflow"], false); } //count the callflow array $callflow_count = 0; if (!empty($array["callflow"])) { $callflow_count = count($array["callflow"]); } //add the final call flow destination to the call flow array //when call_direction is inbound //when destination_number is not same as the last row //when last destination is not voicemail *99ext //count the array $i-1 finds the last record //count the array $i is the next record /* if ($call_direction == 'inbound') { //count the array $i = $callflow_count; //get the application array if (!empty($array["callflow"][$i-1]["caller_profile"]["destination_number"])) { $app = find_app($destination_array, $array["callflow"][$i-1]["caller_profile"]["destination_number"]); } //add last row to the array if (!empty($array["callflow"]) && $array["callflow"][$i-1]["destination_number"] != $destination_number && $app["application"] != 'conferences' && substr($array["callflow"][$i-1]["caller_profile"]["destination_number"], 0, 3) != '*99') { $array["callflow"][$i]["caller_profile"]["destination_number"] = $destination_number; $array["callflow"][$i]["caller_profile"]["network_addr"] = $network_address; $array["callflow"][$i]["caller_profile"]["caller_id_name"] = $caller_id_name; $array["callflow"][$i]["caller_profile"]["caller_id_number"] = $caller_id_number; //$array["callflow"][$i]["times"]["profile_created_time"] = ($end_epoch - $duration) * 1000000; $array["callflow"][$i]["times"]["end_stamp"] = $end_epoch * 1000000; $array["callflow"][$i]["times"]["hangup_time"] = $end_epoch * 1000000; $callflow_count++; } } */ //build the call summary array $x = 0; if (!empty($array["callflow"])) { foreach ($array["callflow"] as $row) { //get the application array $app = find_app($destination_array, urldecode($row["caller_profile"]["destination_number"])); //build the application urls $destination_url = "/app/".$app['application']."/".$destination->singular($app['application'])."_edit.php?id=".$app["uuid"]; $application_url = "/app/".$app['application']."/".$app['application'].".php"; if ($app['application'] == 'call_centers') { $destination_url = "/app/".$app['application']."/".$destination->singular($app['application'])."_queue_edit.php?id=".$app['uuid']; $application_url = "/app/".$app['application']."/".$destination->singular($app['application'])."_queues.php"; } //add the application and destination details $language2 = new text; $text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$app['application']); $call_flow_summary[$x]["application_name"] = $app['application']; $call_flow_summary[$x]["application_label"] = trim($text2['title-'.$app['application']]); $call_flow_summary[$x]["application_url"] = $application_url; $call_flow_summary[$x]["destination_uuid"] = $app['uuid']; $call_flow_summary[$x]["destination_name"] = $app['name']; $call_flow_summary[$x]["destination_url"] = $destination_url; $call_flow_summary[$x]["destination_number"] = $row["caller_profile"]["destination_number"]; $call_flow_summary[$x]["destination_label"] = $app['label']; $call_flow_summary[$x]["destination_description"] = $app['description']; //$call_flow_summary[$x]["application"] = $app; //add the call flow times $call_flow_summary[$x]["start_epoch"] = round($row['times']['profile_created_time'] / 1000000); $call_flow_summary[$x]["end_epoch"] = round($row['times']['profile_end_time'] / 1000000); $call_flow_summary[$x]["start_stamp"] = $row['times']['profile_created_timestamp']; $call_flow_summary[$x]["end_stamp"] = $row['times']['profile_end_timestamp']; $call_flow_summary[$x]["duration_seconds"] = $row['times']['profile_duration_seconds']; $call_flow_summary[$x]["duration_formatted"] = $row['times']['profile_duration_formatted']; unset($tmp_end_stamp, $tmp_start_stamp, $tmp_end_stamp_formatted); $x++; } } unset($x); //set the year, month and date $tmp_year = date("Y", strtotime($start_stamp)); $tmp_month = date("M", strtotime($start_stamp)); $tmp_day = date("d", strtotime($start_stamp)); //set the row style $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; //set the status if ($billsec > 0) { $status = 'Answered'; } if ($missed_call == '1') { $status = 'Missed'; } if (substr($destination_number, 0, 3) == '*99') { $status = 'Voicemail'; } //build the summary array $summary_array = array(); $summary_array['direction'] = escape($direction); $summary_array['caller_id_name'] = escape($caller_id_name); $summary_array['caller_id_number'] = escape($caller_id_number); if ($call_direction == 'outbound') { $summary_array['outbound_caller_id_name'] = escape($outbound_caller_id_name); $summary_array['outbound_caller_id_number'] = escape($outbound_caller_id_number); } $summary_array['caller_destination'] = escape($caller_destination); $summary_array['destination'] = escape($destination_number); $summary_array['start'] = escape($start_stamp); $summary_array['end'] = escape($end_stamp); $summary_array['duration'] = escape(gmdate("G:i:s", (int)$duration)); if (isset($status)) { $summary_array['status'] = escape($status); } if (permission_exists('xml_cdr_hangup_cause')) { $summary_array['hangup_cause'] = escape($hangup_cause); } //get the header require_once "resources/header.php"; //page title and description echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['title2']."\n"; echo " \n"; echo "
\n"; echo "".$text['description-details']." \n"; echo "
\n"; echo "
\n"; echo "
\n"; //show the content echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['label-summary']." 
\n"; if ($_SESSION['cdr']['summary_style']['text'] == 'vertical') { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (is_array($summary_array)) { foreach($summary_array as $name => $value) { echo "\n"; echo " \n"; echo " \n"; echo "\n"; $c = $c ? 0 : 1; } } echo "
".$text['label-name']."".$text['label-value']."
".$text['label-'.$name]." ".$value." 
"; echo "

\n"; } if ($_SESSION['cdr']['summary_style']['text'] == 'horizontal') { echo "\n"; echo "\n"; //echo "\n"; //echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; //echo " \n"; //echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-direction']."LanguageContext".$text['label-name']."".$text['label-number']."".$text['label-destination']."".$text['label-start']."".$text['label-end']."".$text['label-duration']."".$text['label-status']."".$text['label-hangup_cause']."
".escape($direction)."".$language."".$context.""; if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) { //echo " \n"; //echo " "; echo " \n"; //$tmp_file_array = explode("\.",$file); echo $caller_id_name.' '; echo " "; } else { echo $caller_id_name.' '; } echo " "; if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) { echo " \n"; echo escape($caller_id_number).' '; echo " "; } else { echo escape($caller_id_number).' '; } echo " ".escape($destination_number)."".escape(date("Y-m-d H:i:s", (int) $start_epoch))."".escape(date("Y-m-d H:i:s", (int) $end_epoch))."".escape(gmdate("G:i:s", (int)$duration))."".escape($status)."".escape($hangup_cause)."
"; echo "

\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['label-call_flow_summary']." 
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //show the call flow summary $i = 1; foreach ($call_flow_summary as $row) { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; //alternate $c $c = $c ? 0 : 1; //increment the row count $i++; } echo "
".$text['label-application']."".$text['label-destination']."".$text['label-name']."".$text['label-start']."".$text['label-end']."".$text['label-duration']."
".escape($row["application_label"])."".escape($row["destination_number"])."".escape($row["destination_name"])."".escape($row["start_stamp"])."".escape($row["end_stamp"])."".escape($row["duration_formatted"])."
"; echo "

\n"; //call stats $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; if (!empty($array["call-stats"]) && is_array($array["call-stats"])) { if (!empty($array["call-stats"]['audio']) && is_array($array["call-stats"]['audio'])) { foreach ($array["call-stats"]['audio'] as $audio_direction => $stat) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-call-stats'].": ".$audio_direction."  
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; foreach ($stat as $key => $value) { if (!empty($value) && is_array($value)) { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } else { $value = urldecode($value); echo "\n"; echo " \n"; echo " \n"; echo "\n"; } $c = $c ? 0 : 1; } echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-name']."".$text['label-value']."
".escape($key).""; echo " \n"; foreach ($value as $vk => $arrays) { echo " \n"; echo " \n"; echo " \n"; } echo "
".$vk."    \n"; echo " \n"; foreach ($arrays as $k => $v) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; } echo "
".$k."    ".$v."
\n"; echo "
\n"; echo "
\n"; echo "
".escape($key)."".escape(wordwrap($value,75,"\n", true))." 


\n"; } } } echo ""; echo "

\n"; //channel data loop $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['label-channel']." 
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (is_array($array["channel_data"])) { foreach($array["channel_data"] as $key => $value) { if (!empty($value)) { $value = urldecode($value); echo "\n"; echo " \n"; echo " \n"; echo "\n"; $c = $c ? 0 : 1; } } } echo "
".$text['label-name']."".$text['label-value']."
".escape($key)." ".escape(wordwrap($value,75,"\n", TRUE))." 
"; echo "

\n"; //variable loop $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo "
".$text['label-variables']." 
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (is_array($array["variables"])) { foreach($array["variables"] as $key => $value) { if (is_array($value)) { $value = implode($value); } $value = urldecode($value); if ($key != "digits_dialed" && $key != "dsn") { echo "\n"; echo " \n"; if ($key == "bridge_uuid" || $key == "signal_bond") { echo " \n"; } else { echo " \n"; } echo "\n"; } $c = $c ? 0 : 1; } } echo "
".$text['label-name']."".$text['label-value']."
".escape($key)."\n"; echo " ".escape($value)." \n"; $tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day; $tmp_name = ''; if (file_exists($tmp_dir.'/'.$value.'.wav')) { $tmp_name = $value.".wav"; } else if (file_exists($tmp_dir.'/'.$value.'_1.wav')) { $tmp_name = $value."_1.wav"; } else if (file_exists($tmp_dir.'/'.$value.'.mp3')) { $tmp_name = $value.".mp3"; } else if (file_exists($tmp_dir.'/'.$value.'_1.mp3')) { $tmp_name = $value."_1.mp3"; } if (!empty($tmp_name) && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) { echo " \n"; echo " play"; echo "  "; } if (!empty($tmp_name) && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) { echo " \n"; echo " download"; echo " "; } echo "".escape(wordwrap($value,75,"\n", true))." 
"; echo "

\n"; //app_log $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['label-application-log']." 
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //foreach($array["variables"] as $key => $value) { if (is_array($array["app_log"]["application"])) { foreach ($array["app_log"]["application"] as $key=>$row) { //single app if ($key === "@attributes") { $app_name = $row["app_name"]; $app_data = urldecode($row["app_data"]); } //multiple apps else { $app_name = $row["@attributes"]["app_name"]; $app_data = urldecode($row["@attributes"]["app_data"]); } echo "\n"; echo " \n"; echo " \n"; echo "\n"; $c = $c ? 0 : 1; } } echo "
".$text['label-name']."".$text['label-data']."
".escape($app_name)." ".escape(wordwrap($app_data,75,"\n", true))." 
"; echo "

\n"; //call flow $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; if (is_array($array["callflow"])) { foreach ($array["callflow"] as $row) { echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "
\n"; //attributes echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-call-flow']."  
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (is_array($row["@attributes"])) { foreach($row["@attributes"] as $key => $value) { $value = urldecode($value); echo " \n"; echo " \n"; echo " \n"; echo " \n"; $c = $c ? 0 : 1; } } echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-name']."".$text['label-value']."
".escape($key)." ".escape(wordwrap($value,75,"\n", true))." 


\n"; //extension attributes echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-call-flow-2']."  
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (is_array($row["extension"]["@attributes"])) { foreach($row["extension"]["@attributes"] as $key => $value) { $value = urldecode($value); echo " \n"; echo " \n"; echo " \n"; echo " \n"; $c = $c ? 0 : 1; } } echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-name']."".$text['label-value']."
".escape($key)." ".escape(wordwrap($value,75,"\n", true))." 


\n"; //extension application echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-call-flow-3']."  
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (!empty($row["extension"]["application"]) && is_array($row["extension"]["application"])) { foreach ($row["extension"]["application"] as $key => $tmp_row) { if (!is_numeric($key)) { $app_name = $tmp_row["app_name"] ?? ''; $app_data = urldecode($tmp_row["app_data"] ?? ''); } else { $app_name = $tmp_row["@attributes"]["app_name"] ?? ''; $app_data = urldecode($tmp_row["@attributes"]["app_data"] ?? ''); } echo " \n"; echo " \n"; echo " \n"; echo " \n"; $c = $c ? 0 : 1; } } echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-name']."".$text['label-data']."
".escape($app_name)." ".escape(wordwrap($app_data,75,"\n", true))." 


\n"; //caller profile echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-call-flow-4']."  
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (is_array($row["caller_profile"])) { foreach ($row["caller_profile"] as $key => $value) { echo " \n"; if ($key != "originatee" && $key != "origination") { if (is_array($value)) { $value = implode('', $value); } else { $value = urldecode($value); } echo " \n"; if ($key == "uuid") { echo " \n"; } else { echo " \n"; } } else { echo " \n"; echo " \n"; } } echo "\n"; $c = $c ? 0 : 1; } } echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-name']."".$text['label-value']."
".escape($key)." ".escape($value)." ".escape(wordwrap($value,75,"\n", true))." ".escape($key)." \n"; if (isset($value[$key."_caller_profile"]) && is_array($value[$key."_caller_profile"])) { echo " \n"; foreach ($value[$key."_caller_profile"] as $key_2 => $value_2) { if (is_numeric($key_2)) { $group_output = false; foreach ($value_2 as $key_3 => $value_3) { echo " \n"; if ($group_output == false) { echo " \n"; $group_output = true; } echo " \n"; if (is_array($value_3)) { echo " \n"; } else { echo " \n"; } echo " \n"; } } else { echo " \n"; echo " \n"; if (is_array($value_2)) { echo " \n"; } else { echo " \n"; } echo " \n"; } } unset($key_2, $value_2); echo "
".escape($key_2)." ".escape($key_3)." ".escape(implode('', $value_3))." ".escape(wordwrap($value_3,75,"\n", true))." 
".escape($key_2)." ".escape(implode('', $value_2))." ".escape(wordwrap($value_2,75,"\n", true))." 
\n"; echo "


\n"; //times echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (is_array($row["times"])) { foreach($row["times"] as $key => $value) { $value = urldecode($value); echo " \n"; echo " \n"; echo " \n"; echo " \n"; $c = $c ? 0 : 1; } } echo " \n"; echo " \n"; echo " \n"; echo "
".$text['label-call-flow-5']." 
".$text['label-name']."".$text['label-value']."
".escape($key)." ".escape(wordwrap($value,75,"\n", true))." 


"; echo "

\n"; echo "
"; } } //get the footer require_once "resources/footer.php"; ?>