New reflector server TG config: SHOW_ACTIVITY

This commit is contained in:
Tobias Blomberg 2022-03-25 23:27:10 +01:00
parent 3319f37112
commit 6f65df27bc
6 changed files with 25 additions and 2 deletions

View File

@ -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
.

View File

@ -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<uint32_t>& monitored_tgs = client->monitoredTGs();
for (std::set<uint32_t>::const_iterator mtg_it=monitored_tgs.begin();

View File

@ -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

View File

@ -160,6 +160,8 @@ class TGHandler : public sigc::trackable
bool allowTgSelection(ReflectorClient *client, uint32_t tg);
bool showActivity(uint32_t tg);
sigc::signal<void, uint32_t,
ReflectorClient*, ReflectorClient*> talkerUpdated;

View File

@ -27,3 +27,4 @@ TG_FOR_V1_CLIENTS=999
#[TG#9999]
#AUTO_QSY_AFTER=300
#ALLOW=S[A-M]\\\\d.*|LA8PV
#SHOW_ACTIVITY=0

View File

@ -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