An Auto QSY is now only triggered after talker stop

This commit is contained in:
Tobias Blomberg 2020-07-25 16:14:38 +02:00
parent 8f3289d0f0
commit 8f1b245789
3 changed files with 16 additions and 7 deletions

View File

@ -181,6 +181,7 @@ section.
Set this to the number of seconds after which an automatic QSY to a random
talkgroup is requested. This is typically used to keep call channels and wide
area channels clear so that stations does not dwell there for too long.
Auto QSY is only triggered directly aftar a talker stop event.
The default is that auto QSY is disabled (AUTO_QSY_AFTER=0).
.
.SH FILES

View File

@ -221,6 +221,14 @@ void TGHandler::setTalkerForTG(uint32_t tg, ReflectorClient* new_talker)
tg_info->sql_timeout_cnt = (new_talker != 0) ? m_sql_timeout : 0;
id_map_it->second->talker = new_talker;
talkerUpdated(tg, old_talker, new_talker);
time_t now = time(NULL);
if ((new_talker == 0) && (tg_info->auto_qsy_time > 0) &&
(now > tg_info->auto_qsy_time))
{
requestAutoQsy(tg_info->id);
tg_info->auto_qsy_time = now + tg_info->auto_qsy_after_s;
}
//printTGStatus();
} /* TGHandler::setTalkerForTG */
@ -290,12 +298,12 @@ void TGHandler::checkTimers(Async::Timer *t)
}
}
if ((tg_info->auto_qsy_time > 0) &&
(now.tv_sec > tg_info->auto_qsy_time))
{
requestAutoQsy(tg_info->id);
tg_info->auto_qsy_time = time(NULL) + tg_info->auto_qsy_after_s;
}
//if ((tg_info->auto_qsy_time > 0) &&
// (now.tv_sec > tg_info->auto_qsy_time))
//{
// requestAutoQsy(tg_info->id);
// tg_info->auto_qsy_time = time(NULL) + tg_info->auto_qsy_after_s;
//}
}
} /* TGHandler::checkTimers */

View File

@ -37,4 +37,4 @@ DEVCAL=1.0.2.99.0
SVXSERVER=0.0.6
# Version for SvxReflector
SVXREFLECTOR=1.99.3
SVXREFLECTOR=1.99.4