From 9bfbe4ea10a627147151be633f249fd42505c4b6 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 09:54:36 +0200 Subject: [PATCH 01/10] Add P25 to modes.php --- include/modes.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/modes.php b/include/modes.php index aa84bca..0d52a39 100644 --- a/include/modes.php +++ b/include/modes.php @@ -10,6 +10,7 @@ + From 155955e31ddd6d3cf0887e8a9abe1e701ae08910 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 10:05:07 +0200 Subject: [PATCH 02/10] Add P25 network --- include/modes.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/modes.php b/include/modes.php index 0d52a39..9d625da 100644 --- a/include/modes.php +++ b/include/modes.php @@ -11,6 +11,7 @@ + From fae1bcde9b3a34ab96690c848ca2ec5879f655ef Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 12:01:29 +0200 Subject: [PATCH 03/10] Correct indendiation --- include/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/functions.php b/include/functions.php index 1f418be..fee0b11 100644 --- a/include/functions.php +++ b/include/functions.php @@ -258,10 +258,10 @@ function getHeardList($logLines, $onlyLast) { $ber = $ts2ber; break; case "YSF": - $duration = $ysfduration; - $loss = $ysfloss; - $ber = $ysfber; - break; + $duration = $ysfduration; + $loss = $ysfloss; + $ber = $ysfber; + break; } // Callsign or ID should be less than 11 chars long, otherwise it could be errorneous From 15b2adaeab88d7492ec86634966740c357499d41 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 12:54:02 +0200 Subject: [PATCH 04/10] More indentiation --- include/functions.php | 78 +++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/include/functions.php b/include/functions.php index fee0b11..2dfbcb6 100644 --- a/include/functions.php +++ b/include/functions.php @@ -147,8 +147,8 @@ function getHeardList($logLines, $onlyLast) { $dstarloss = ""; $dstarber = ""; $ysfduration = ""; - $ysfloss = ""; - $ysfber = ""; + $ysfloss = ""; + $ysfber = ""; foreach ($logLines as $logLine) { $duration = ""; $loss = ""; @@ -391,45 +391,45 @@ function getActualLink($logLines, $mode) { //M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094 //M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094 switch ($mode) { - case "D-Star": - if (isProcessRunning(IRCDDBGATEWAY)) { - return getDSTARLinks(); - } else { - return "ircddbgateway not running!"; - } - break; - case "DMR Slot 1": - foreach ($logLines as $logLine) { - if(strpos($logLine,"unable to decode the network CSBK")) { - continue; - } else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 1") { - $to = ""; - if (strpos($logLine,"to")) { - $to = trim(substr($logLine, strpos($logLine,"to") + 3)); + case "D-Star": + if (isProcessRunning(IRCDDBGATEWAY)) { + return getDSTARLinks(); + } else { + return "ircddbgateway not running!"; + } + break; + case "DMR Slot 1": + foreach ($logLines as $logLine) { + if(strpos($logLine,"unable to decode the network CSBK")) { + continue; + } else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 1") { + $to = ""; + if (strpos($logLine,"to")) { + $to = trim(substr($logLine, strpos($logLine,"to") + 3)); + } + if ($to !== "") { + return $to; + } } - if ($to !== "") { - return $to; + } + return "not linked"; + break; + case "DMR Slot 2": + foreach ($logLines as $logLine) { + if(strpos($logLine,"unable to decode the network CSBK")) { + continue; + } else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { + $to = ""; + if (strpos($logLine,"to")) { + $to = trim(substr($logLine, strpos($logLine,"to") + 3)); + } + if ($to !== "") { + return $to; + } } - } - } - return "not linked"; - break; - case "DMR Slot 2": - foreach ($logLines as $logLine) { - if(strpos($logLine,"unable to decode the network CSBK")) { - continue; - } else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { - $to = ""; - if (strpos($logLine,"to")) { - $to = trim(substr($logLine, strpos($logLine,"to") + 3)); - } - if ($to !== "") { - return $to; - } - } - } - return "not linked"; - break; + } + return "not linked"; + break; } return "something went wrong!"; } From b37c81ae83f2e3ad987e2f8d49c94a3a8babd7cd Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 12:55:19 +0200 Subject: [PATCH 05/10] Even more indentiation corrected --- include/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index 2dfbcb6..eb67d71 100644 --- a/include/functions.php +++ b/include/functions.php @@ -439,8 +439,8 @@ function getActualReflector($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 //M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094 - foreach ($logLines as $logLine) { - if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { + foreach ($logLines as $logLine) { + if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { $from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6); if (strlen($from) == 4 && startsWith($from,"4")) { From 2536f4dc1c8dde2df37c42aba91b8b2bcd0edde6 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 12:57:17 +0200 Subject: [PATCH 06/10] Removed whitespace before line endings --- include/functions.php | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/include/functions.php b/include/functions.php index eb67d71..6e7bd26 100644 --- a/include/functions.php +++ b/include/functions.php @@ -69,13 +69,13 @@ function getEnabled ($mode, $mmdvmconfigs) { function showMode($mode, $mmdvmconfigs) { // shows if mode is enabled or not. ?> - 0 ) { $source = "Net"; } - + switch ($mode) { case "D-Star": $duration = $dstarduration; @@ -263,7 +263,7 @@ function getHeardList($logLines, $onlyLast) { $ber = $ysfber; break; } - + // Callsign or ID should be less than 11 chars long, otherwise it could be errorneous if ( strlen($callsign) < 11 ) { array_push($heardList, array($timestamp, $mode, $callsign, $id, $target, $source, $duration, $loss, $ber)); @@ -309,7 +309,7 @@ function getActualMode($metaLastHeard, $mmdvmconfigs) { } else { $now = new DateTime(); $hangtime = getConfigItem("General", "ModeHang", $mmdvmconfigs); - + if ($hangtime != "") { $timestamp->add(new DateInterval('PT' . $hangtime . 'S')); } else { @@ -365,7 +365,7 @@ function getDSTARLinks() { $linkDest = $linx[4][0]; $linkDir = $linx[5][0]; } -// Dongle-Link, sample: +// 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){ @@ -380,7 +380,7 @@ function getDSTARLinks() { } } $out .= ""; - + fclose($linkLog); return $out; } @@ -403,7 +403,7 @@ function getActualLink($logLines, $mode) { if(strpos($logLine,"unable to decode the network CSBK")) { continue; } else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 1") { - $to = ""; + $to = ""; if (strpos($logLine,"to")) { $to = trim(substr($logLine, strpos($logLine,"to") + 3)); } @@ -419,7 +419,7 @@ function getActualLink($logLines, $mode) { if(strpos($logLine,"unable to decode the network CSBK")) { continue; } else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { - $to = ""; + $to = ""; if (strpos($logLine,"to")) { $to = trim(substr($logLine, strpos($logLine,"to") + 3)); } @@ -442,19 +442,19 @@ function getActualReflector($logLines, $mode) { foreach ($logLines as $logLine) { if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { $from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6); - + if (strlen($from) == 4 && startsWith($from,"4")) { if ($from == "4000") { return "Reflector not linked"; } else { return "Reflector ".$from; } - } + } $source = "RF"; if (strpos($logLine,"network") > 0 ) { $source = "Net"; } - + if ( $source == "RF") { $to = substr($logLine, strpos($logLine, "to") + 3); if (strlen($to) < 6 && startsWith($to, "4")) { @@ -478,7 +478,7 @@ function getActiveYSFReflectors($logLines) { $timestamp2 = new DateTime($timestamp); $now = new DateTime(); $timestamp2->add(new DateInterval('PT2H')); - + if ($now->format('U') <= $timestamp2->format('U')) { $str = substr($logLine, 60); $id = strtok($str, "/"); From 148a28f0b28de948152f0f15a90b492d2422ca15 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 13:14:03 +0200 Subject: [PATCH 07/10] dd P25 to getLastHeard --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 6e7bd26..7fabb9b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -285,7 +285,7 @@ function getLastHeard($logLines, $onlyLast) { $heardList = getHeardList($logLines, $onlyLast); $counter = 0; foreach ($heardList as $listElem) { - if ( ($listElem[1] == "D-Star") || ($listElem[1] == "YSF") || (startsWith($listElem[1], "DMR")) ) { + if ( ($listElem[1] == "D-Star") || ($listElem[1] == "YSF") || ($listElem[1] == "P25") || (startsWith($listElem[1], "DMR")) ) { if(!(array_search($listElem[2]."#".$listElem[1].$listElem[3], $heardCalls) > -1)) { array_push($heardCalls, $listElem[2]."#".$listElem[1].$listElem[3]); array_push($lastHeard, $listElem); From 9042f3fb18dc7d854383fb6877011615d537290d Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 13:16:04 +0200 Subject: [PATCH 08/10] Add coding info for P25 frame --- include/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/functions.php b/include/functions.php index 7fabb9b..dafb80c 100644 --- a/include/functions.php +++ b/include/functions.php @@ -135,6 +135,7 @@ function getYSFGatewayLog() { // M: 2016-04-29 00:15:00.013 D-Star, received network header from DG9VH /ZEIT to CQCQCQ via DCS002 S // M: 2016-04-29 19:43:21.839 DMR Slot 2, received network voice header from DL1ESZ to TG 9 // M: 2016-04-30 14:57:43.072 DMR Slot 2, received RF voice header from DG9VH to 5000 +// M: 2016-09-16 09:14:12.886 P25, received RF from DF2ET to TG10100 function getHeardList($logLines, $onlyLast) { $heardList = array(); $ts1duration = ""; From d618e8d46c84ef75698b3f919154a44686bae767 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 13:41:15 +0200 Subject: [PATCH 09/10] Add cases for P25 --- include/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/functions.php b/include/functions.php index dafb80c..9196c5a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -218,6 +218,11 @@ function getHeardList($logLines, $onlyLast) { $ysfloss = $loss; $ysfber = $ber; break; + case "P25": + $p25duration = $duration; + $p25loss = $loss; + $p25ber = $ber; + break; } } } @@ -263,6 +268,11 @@ function getHeardList($logLines, $onlyLast) { $loss = $ysfloss; $ber = $ysfber; break; + case "P25": + $duration = $p25duration; + $loss = $p25loss; + $ber = $p25ber; + break; } // Callsign or ID should be less than 11 chars long, otherwise it could be errorneous From 5da5742202ce7170aed4c221063ca6adc3c56ae3 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 20 Sep 2016 13:46:29 +0200 Subject: [PATCH 10/10] Add P25 to local transmissions --- include/localtx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/localtx.php b/include/localtx.php index 6cd6e97..cd3a5f6 100644 --- a/include/localtx.php +++ b/include/localtx.php @@ -34,7 +34,7 @@ $localTXList = getHeardList($reverseLogLinesMMDVM, FALSE); "; echo"$listElem[0]"; echo"$listElem[1]";