From 87c320da362651e170678112e557dbfb12612e34 Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Fri, 29 Jan 2021 16:04:44 +0000 Subject: [PATCH] fixing problem with shorter timestamps in DMRHost closed https://github.com/dg9vh/MMDVMHost-Websocketboard/issues/17 --- html/js/functions.js | 17 +++++++++++++++-- logtailer.ini | 3 ++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/html/js/functions.js b/html/js/functions.js index 34d27b9..0a0d31f 100644 --- a/html/js/functions.js +++ b/html/js/functions.js @@ -10,7 +10,9 @@ setInterval(getCurrentTXing, 1000); // M: 2020-11-01 21:33:27.454 YSF, received network data from DG2MAS to DG-ID 0 at DG2MAS // M: 2020-11-01 21:33:35.025 YSF, received network end of transmission from DG2MAS to DG-ID 0, 7.7 seconds, 0% packet loss, BER: 0.0% // M: 2020-11-07 15:41:22.601 DMR Slot 1, received network late entry from DO5DC to TG 262810 - +// DMRHost: +// M: 2021-01-29 00:32:28 DMR Slot 1, received network end of voice transmission from nnnnnnn to TG 262, 1.6 seconds +// M: 2021-01-29 00:50:02 DMR Slot 2, received network voice header from nnnnnnn to TG 26298 function logIt(message) { if (debug == 1 || message.startsWith("Logtailer-Errormessage:")) { console.log(message); @@ -42,6 +44,14 @@ function getTimezone() { return "UTC"; } } + +function isDMRHost(logline) { + if (logline.charAt(22) == " " ) + return true; + else + return false; +} + function getLocaltimeFromTimestamp(timestamp) { //logIt(timestamp); if (useClientTimezone) { @@ -61,7 +71,10 @@ function getTimestamp(logline) { } function getMode(logline) { - return logline.substring(27, logline.indexOf(",")); + if (isDMRHost) + return logline.substring(23, logline.indexOf(",")); + else + return logline.substring(27, logline.indexOf(",")); } function getCallsign(logline) { diff --git a/logtailer.ini b/logtailer.ini index eff15dc..96baaa2 100644 --- a/logtailer.ini +++ b/logtailer.ini @@ -10,7 +10,8 @@ Filerotate=True [MMDVMHost] Logdir=/mnt/ramdisk/ -Prefix=MMDVM +#Prefix=MMDVM +Prefix=DMRHost DMR_ID_Lookup=0 DMR_ID_LookupFile=/etc/MMDVM/DMRIds.dat