for control channel dvmhost peers, report the known peerId of voice channels via the TRANSFER_SUBFUNC_STATUS; update sysview to properly expire peers from the peer status list after 10 seconds of no updates from the FNE about that peer;

pull/121/merge
Bryan Biedenkapp 1 month ago
parent 6d15d94379
commit 45c0661723

@ -1368,6 +1368,9 @@ json::object Host::getStatus()
uint8_t chId = entry.second.chId();
chData["channelId"].set<uint8_t>(chId);
uint32_t peerId = m_voiceChPeerId[chNo];
chData["peerId"].set<uint32_t>(peerId);
uint32_t dstId = 0U, srcId = 0U;
// fetch affiliations from DMR if we're a DMR CC

@ -312,18 +312,24 @@ void* threadNetworkPump(void* arg)
// clock peer status timers and remove expired entries from the peer status map
g_network->lockPeerStatus();
std::vector<uint32_t> expiredPeerIds;
for (auto it = g_network->peerStatusTimers.begin(); it != g_network->peerStatusTimers.end();) {
it->second.clock(ms);
if (it->second.isRunning() && it->second.hasExpired()) {
uint32_t peerId = it->first;
it = g_network->peerStatusTimers.erase(it);
g_network->peerStatus.erase(peerId);
g_network->peerStatusTimers[peerId].stop();
LogInfoEx(LOG_HOST, "peer status expired, peerId = %u", peerId);
it->second.stop();
expiredPeerIds.push_back(peerId);
}
else {
++it;
}
}
// remove expired entries from the peer status map
for (uint32_t peerId : expiredPeerIds) {
g_network->peerStatus.erase(peerId);
g_network->peerStatusTimers.erase(peerId);
}
g_network->unlockPeerStatus();
hrc::hrc_t pktTime = hrc::now();

@ -26,7 +26,7 @@ using namespace network;
// Constants
// ---------------------------------------------------------------------------
const uint32_t PEER_STATUS_EXPIRY = 60000U; // 60 seconds
const uint32_t PEER_STATUS_EXPIRY = 10U; // 10 seconds
// ---------------------------------------------------------------------------
// Static Class Members

Loading…
Cancel
Save

Powered by TurnKey Linux.