diff --git a/src/svxlink/ChangeLog b/src/svxlink/ChangeLog index 69aec770..625c7a49 100644 --- a/src/svxlink/ChangeLog +++ b/src/svxlink/ChangeLog @@ -158,6 +158,10 @@ setConfigValue function, to change behavior at runtime. See example in ReflectorLogic.tcl. +* Bugfix in ReflectorLogic: It was possible to activate a temporary TG monitor + on a TG that was configured to be permanent. When the temporary monitor + timed out the TG was removed from the monitoring list completely. + 1.7.0 -- 01 Sep 2019 diff --git a/src/svxlink/svxlink/ReflectorLogic.cpp b/src/svxlink/svxlink/ReflectorLogic.cpp index 5618e451..255b8c8b 100644 --- a/src/svxlink/svxlink/ReflectorLogic.cpp +++ b/src/svxlink/svxlink/ReflectorLogic.cpp @@ -479,6 +479,7 @@ void ReflectorLogic::remoteCmdReceived(LogicBase* src_logic, } else if (cmd[0] == '4') // Temporarily monitor talk group { + std::ostringstream os; const std::string subcmd(cmd.substr(1)); if ((m_tmp_monitor_timeout > 0) && !subcmd.empty()) { @@ -489,10 +490,21 @@ void ReflectorLogic::remoteCmdReceived(LogicBase* src_logic, const MonitorTgsSet::iterator it = m_monitor_tgs.find(tg); if (it != m_monitor_tgs.end()) { - std::cout << name() << ": Refresh temporary monitor for TG #" - << tg << std::endl; - // NOTE: (*it).timeout is mutable - (*it).timeout = m_tmp_monitor_timeout; + if ((*it).timeout > 0) + { + std::cout << name() << ": Refresh temporary monitor for TG #" + << tg << std::endl; + // NOTE: (*it).timeout is mutable + (*it).timeout = m_tmp_monitor_timeout; + os << "tmp_monitor_add " << tg; + } + else + { + std::cout << "*** WARNING: Not allowed to add a temporary montior " + "for TG #" << tg << " which is being permanently " + "monitored" << std::endl; + os << "command_failed " << cmd; + } } else { @@ -503,20 +515,24 @@ void ReflectorLogic::remoteCmdReceived(LogicBase* src_logic, m_monitor_tgs.insert(mte); sendMsg(MsgTgMonitor(std::set( m_monitor_tgs.begin(), m_monitor_tgs.end()))); + os << "tmp_monitor_add " << tg; } - std::ostringstream os; - os << "tmp_monitor_add " << tg; - processEvent(os.str()); } else { - processEvent(std::string("command_failed ") + cmd); + std::cout << "*** WARNING: Failed to parse temporary TG monitor " + "command: " << cmd << std::endl; + os << "command_failed " << cmd; } } else { - processEvent(std::string("command_failed ") + cmd); + std::cout << "*** WARNING: Ignoring temporary TG monitoring command (" + << cmd << ") since that function is not enabled or there " + "were no TG specified" << std::endl; + os << "command_failed " << cmd; } + processEvent(os.str()); } else { diff --git a/src/versions b/src/versions index 1ff8d3fd..b9335579 100644 --- a/src/versions +++ b/src/versions @@ -11,7 +11,7 @@ LIBECHOLIB=1.3.3.99.0 LIBASYNC=1.6.99.15 # SvxLink versions -SVXLINK=1.7.99.51 +SVXLINK=1.7.99.52 MODULE_HELP=1.0.0 MODULE_PARROT=1.1.1 MODULE_ECHO_LINK=1.5.99.2