From 6f65df27bcb5e8c395673f4a8f8f31ce5c1f67e9 Mon Sep 17 00:00:00 2001 From: Tobias Blomberg Date: Fri, 25 Mar 2022 23:27:10 +0100 Subject: [PATCH] New reflector server TG config: SHOW_ACTIVITY --- src/doc/man/svxreflector.conf.5 | 5 +++++ src/svxlink/reflector/Reflector.cpp | 7 ++++++- src/svxlink/reflector/TGHandler.cpp | 10 ++++++++++ src/svxlink/reflector/TGHandler.h | 2 ++ src/svxlink/reflector/svxreflector.conf | 1 + src/versions | 2 +- 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/doc/man/svxreflector.conf.5 b/src/doc/man/svxreflector.conf.5 index 0fc00602..897a1f9b 100644 --- a/src/doc/man/svxreflector.conf.5 +++ b/src/doc/man/svxreflector.conf.5 @@ -176,6 +176,7 @@ talkgroup. Those parameters are placed in a configuration section named [TG#9999] AUTO_QSY_AFTER=300 ALLOW=S[A-M]\\\\d.*|LA8PV + SHOW_ACTIVITY=0 The following configuration variables are valid in a talkgroup configuration section. @@ -197,6 +198,10 @@ for ECMAScript with the exception that the backslash special patterns (e.g. An example that match most Swedish callsigns and a specific Norwegian one is "S[A-M]\\\\d.*|LA8PV". That expression will for example match LA8PV, SM0SVX, SK3W, SA7ABC etc. +.TP +.B SHOW_ACTIVITY +If set to 0, do not indicate in the http status message when the talkgroup is +in use by a node. Default is 1 = show activity. . .SH FILES . diff --git a/src/svxlink/reflector/Reflector.cpp b/src/svxlink/reflector/Reflector.cpp index 5079422b..22eed909 100644 --- a/src/svxlink/reflector/Reflector.cpp +++ b/src/svxlink/reflector/Reflector.cpp @@ -650,7 +650,12 @@ void Reflector::httpRequestReceived(Async::HttpServerConnection *con, //node["addr"] = client->remoteHost().toString(); node["protoVer"]["majorVer"] = client->protoVer().majorVer(); node["protoVer"]["minorVer"] = client->protoVer().minorVer(); - node["tg"] = client->currentTG(); + auto tg = client->currentTG(); + if (!TGHandler::instance()->showActivity(tg)) + { + tg = 0; + } + node["tg"] = tg; Json::Value tgs = Json::Value(Json::arrayValue); const std::set& monitored_tgs = client->monitoredTGs(); for (std::set::const_iterator mtg_it=monitored_tgs.begin(); diff --git a/src/svxlink/reflector/TGHandler.cpp b/src/svxlink/reflector/TGHandler.cpp index 26ffe497..4f83440a 100644 --- a/src/svxlink/reflector/TGHandler.cpp +++ b/src/svxlink/reflector/TGHandler.cpp @@ -287,6 +287,16 @@ bool TGHandler::allowTgSelection(ReflectorClient *client, uint32_t tg) } /* TGHandler::allowTgSelection */ +bool TGHandler::showActivity(uint32_t tg) +{ + std::ostringstream ss; + ss << "TG#" << tg; + bool show_activity = true; + m_cfg->getValue(ss.str(), "SHOW_ACTIVITY", show_activity); + return show_activity; +} /* TGHandler::showActivity */ + + /**************************************************************************** * * Protected member functions diff --git a/src/svxlink/reflector/TGHandler.h b/src/svxlink/reflector/TGHandler.h index 6eba5868..42c6a6c5 100644 --- a/src/svxlink/reflector/TGHandler.h +++ b/src/svxlink/reflector/TGHandler.h @@ -160,6 +160,8 @@ class TGHandler : public sigc::trackable bool allowTgSelection(ReflectorClient *client, uint32_t tg); + bool showActivity(uint32_t tg); + sigc::signal talkerUpdated; diff --git a/src/svxlink/reflector/svxreflector.conf b/src/svxlink/reflector/svxreflector.conf index eadf0632..2f659135 100644 --- a/src/svxlink/reflector/svxreflector.conf +++ b/src/svxlink/reflector/svxreflector.conf @@ -27,3 +27,4 @@ TG_FOR_V1_CLIENTS=999 #[TG#9999] #AUTO_QSY_AFTER=300 #ALLOW=S[A-M]\\\\d.*|LA8PV +#SHOW_ACTIVITY=0 diff --git a/src/versions b/src/versions index 393b4686..b58d2e95 100644 --- a/src/versions +++ b/src/versions @@ -37,4 +37,4 @@ DEVCAL=1.0.2.99.6 SVXSERVER=0.0.6 # Version for SvxReflector -SVXREFLECTOR=1.99.11 +SVXREFLECTOR=1.99.12