diff --git a/config/config.php b/config/config.php index c2dd272..91d0a54 100644 --- a/config/config.php +++ b/config/config.php @@ -1,9 +1,75 @@ 0){ + $linkDate = $linx[1][0]; + $protocol = $linx[2][0]; + $linkType = $linx[3][0]; + $linkSource = $linx[4][0]; + $linkDest = $linx[5][0]; + $linkDir = $linx[6][0]; + } +// CCS-Link, sample: +// 2013-03-30 23:21:53: CCS link - Rptr: PE1AGO C Remote: PE1KZU Dir: Incoming + if(preg_match_all('/^(.{19}).*(CC[A-Za-z]*).*Rptr: (.{8}).*Remote: (.{8}).*Dir: (.{8})/',$linkLine,$linx) > 0){ + $linkDate = $linx[1][0]; + $protocol = $linx[2][0]; + $linkType = $linx[2][0]; + $linkSource = $linx[3][0]; + $linkDest = $linx[4][0]; + $linkDir = $linx[5][0]; + } +// Dongle-Link, sample: +// 2011-09-24 07:26:59: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming +// 2012-03-14 21:32:18: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming + if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*User: (.{6,8}).*Dir: (.*)$/',$linkLine,$linx) > 0){ + $linkDate = $linx[1][0]; + $protocol = $linx[2][0]; + $linkType = $linx[3][0]; + $linkSource = " "; + $linkDest = $linx[4][0]; + $linkDir = $linx[5][0]; + } + $out .= $protocol . "-link to >" . $linkDest . "< " . $linkDir . "
"; + } + } + return $out; +} + function getActualLink($logLines, $mode) { //M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S" //M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094 @@ -165,12 +214,15 @@ function getActualLink($logLines, $mode) { array_multisort($logLines,SORT_DESC); switch ($mode) { case "D-Star": + /* foreach ($logLines as $logLine) { if (strpos($logLine, "D-Star link status set to")) { return substr($logLine, 54, strlen($logLine) - 56); } } return "not linked"; + */ + return getDSTARLinks(); break; case "DMR Slot 1": foreach ($logLines as $logLine) { diff --git a/include/repeaterinfo.php b/include/repeaterinfo.php index c591c86..b4b1c92 100644 --- a/include/repeaterinfo.php +++ b/include/repeaterinfo.php @@ -9,7 +9,7 @@ - + diff --git a/index.php b/index.php index 79a827d..14e0ea2 100644 --- a/index.php +++ b/index.php @@ -34,7 +34,6 @@ include "include/lh.php"; ?>
Actual ModeD-Star last linked toD-Star linked to DMR TS1 last linked to DMR TS2 last linked to