" preview where applicable. * * Data flow: parses the in-memory `$logLinesDAPNETGateway` array * populated by mmdvmhost/functions.php from * /var/log/pi-star/DAPNETGateway-YYYY-MM-DD.log. * * Most of the work here contributed by geeks4hire (Ben Horan); Skyper * decode added by Andy Taylor (MW0MWZ). */ // AJAX-loaded partial — embeddable variant only. The earlier // duplicate setSecurityHeaders() call has been removed; that // non-embeddable variant raced with this one and won via the // headers_sent() guard, so the file was effectively shipping // X-Frame-Options / frame-ancestors despite the embeddable // version being added below it. require_once($_SERVER['DOCUMENT_ROOT'] . '/config/security_headers.php'); setEmbeddableSecurityHeaders(); include_once $_SERVER['DOCUMENT_ROOT'].'/config/config.php'; // MMDVMDash Config include_once $_SERVER['DOCUMENT_ROOT'].'/mmdvmhost/tools.php'; // MMDVMDash Tools include_once $_SERVER['DOCUMENT_ROOT'].'/mmdvmhost/functions.php'; // MMDVMDash Functions include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code // Function to reverse the ROT1 used for Skyper function un_rot($message) { $output = ""; $messageTextArray = str_split($message); // ROT -1 foreach($messageTextArray as $asciiChar) { $asciiAsInt = ord($asciiChar); $convretedAsciiAsInt = $asciiAsInt -1; $convertedAsciiChar = chr($convretedAsciiAsInt); $output .= $convertedAsciiChar; } // Return the clear text return $output; } // Function to handle Skyper Messages function skyper($message, $pocsagric) { $output = ""; $messageTextArray = str_split($message); if ($pocsagric == "0002504") { // Skyper OTA TimeSync Messages $output = "[Skyper OTA Time] ".$message; return $output; } if ($pocsagric == "0004512") { // Skyper Rubric Index if (isset($messageTextArray[0])) { // This is hard coded to 1 for rubric index unset($messageTextArray[0]); } if (isset($messageTextArray[1])) { // Rubric Number $skyperRubric = ord($messageTextArray[1]) - 31; unset($messageTextArray[1]); } if (isset($messageTextArray[2])) { // Message number, hard coded to 10 for Rubric Index unset($messageTextArray[2]); } if (count($messageTextArray) >= 1) { // Check to see if there is a message to decode $output = "[Skyper Index Rubric:$skyperRubric] ".un_rot(implode($messageTextArray)); } else { $output = "[Skyper Index Rubric:$skyperRubric] No Name"; } return $output; } if ($pocsagric == "0004520") { // Skyper Message if (isset($messageTextArray[0])) { // Rubric Number $skyperRubric = ord($messageTextArray[0]) - 31; unset($messageTextArray[0]); } if (isset($messageTextArray[1])) { // Message number $skyperMsgNr = ord($messageTextArray[1]) - 32; unset($messageTextArray[1]); } if (count($messageTextArray) >= 1) { // Check to see if there is a message to decode $output = "[Skyper Rubric:$skyperRubric Msg:$skyperMsgNr] ".un_rot(implode($messageTextArray)); } else { $output = "[Skyper Rubric:$skyperRubric] No Message"; } return $output; } } ?> setTimeZone($local_tz); $local_time = $dt->format('H:i:s M jS'); $pocsag_timeslot = $dapnetMessageArr["6"]; $pocsag_ric = str_replace(',', '', $dapnetMessageArr["8"]); // Fix incorrectly truncated strings containing double quotes unset($dapnetMessageTxtArr[0]); if (count($dapnetMessageTxtArr) > 2) { unset($dapnetMessageTxtArr[count($dapnetMessageTxtArr)]); $pocsag_msg = implode('"', $dapnetMessageTxtArr); } else { $pocsag_msg = $dapnetMessageTxtArr[1]; } // Decode Skyper Messages if ( ($pocsag_ric == "0004520") || ($pocsag_ric == "0004512") || ($pocsag_ric == "0002504") ) { $pocsag_msg = skyper($pocsag_msg, $pocsag_ric); } // Formatting long messages without spaces if (strpos($pocsag_msg, ' ') == 0 && strlen($pocsag_msg) >= 45) { $pocsag_msg = wordwrap($pocsag_msg, 45, ' ', true); } // Sanitise the data before displaying the HTML if (isset($local_time)) { $local_time = htmlspecialchars($local_time, ENT_QUOTES, 'UTF-8'); } if (isset($pocsag_timeslot)) { $pocsag_timeslot = htmlspecialchars($pocsag_timeslot, ENT_QUOTES, 'UTF-8'); } if (isset($pocsag_ric)) { $pocsag_ric = htmlspecialchars($pocsag_ric, ENT_QUOTES, 'UTF-8'); } if (isset($pocsag_msg)) { $pocsag_msg = htmlspecialchars($pocsag_msg, ENT_QUOTES, 'UTF-8'); } ?>
()Time in time zone Message Mode RIC / CapCode of the receiving Pager Message contents