From 0282689e98272f4bb12e255c859579a3b8a9f188 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Mon, 27 Mar 2023 10:14:00 -0400 Subject: [PATCH] fix issue where network grants would trigger local grant transmissions, even if the TG was already granted; --- src/dmr/packet/ControlSignaling.cpp | 16 ++++++++++++---- src/nxdn/packet/Trunk.cpp | 4 +++- src/p25/packet/Trunk.cpp | 12 ++++++++---- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/dmr/packet/ControlSignaling.cpp b/src/dmr/packet/ControlSignaling.cpp index 6de71005..c01bc1cd 100644 --- a/src/dmr/packet/ControlSignaling.cpp +++ b/src/dmr/packet/ControlSignaling.cpp @@ -449,27 +449,35 @@ void ControlSignaling::processNetwork(const data::Data & dmrData) writeRF_CSBK_ACK_RSP(srcId, TS_WAIT_RSN, 1U); if (m_slot->m_authoritative) { - writeRF_CSBK_Grant(srcId, dstId, isp->getServiceOptions(), false); + if (!m_slot->m_affiliations->isGranted(dstId)) { + writeRF_CSBK_Grant(srcId, dstId, isp->getServiceOptions(), false); + } } break; case SVC_KIND_GRP_VOICE_CALL: writeRF_CSBK_ACK_RSP(srcId, TS_WAIT_RSN, 1U); if (m_slot->m_authoritative) { - writeRF_CSBK_Grant(srcId, dstId, isp->getServiceOptions(), true); + if (!m_slot->m_affiliations->isGranted(dstId)) { + writeRF_CSBK_Grant(srcId, dstId, isp->getServiceOptions(), true); + } } break; case SVC_KIND_IND_DATA_CALL: case SVC_KIND_IND_UDT_DATA_CALL: writeRF_CSBK_ACK_RSP(srcId, TS_WAIT_RSN, 0U); - writeRF_CSBK_Data_Grant(srcId, dstId, isp->getServiceOptions(), false); + if (!m_slot->m_affiliations->isGranted(dstId)) { + writeRF_CSBK_Data_Grant(srcId, dstId, isp->getServiceOptions(), false); + } break; case SVC_KIND_GRP_DATA_CALL: case SVC_KIND_GRP_UDT_DATA_CALL: writeRF_CSBK_ACK_RSP(srcId, TS_WAIT_RSN, 0U); - writeRF_CSBK_Data_Grant(srcId, dstId, isp->getServiceOptions(), true); + if (!m_slot->m_affiliations->isGranted(dstId)) { + writeRF_CSBK_Data_Grant(srcId, dstId, isp->getServiceOptions(), true); + } break; case SVC_KIND_REG_SVC: break; diff --git a/src/nxdn/packet/Trunk.cpp b/src/nxdn/packet/Trunk.cpp index 50d725d9..ede142e5 100644 --- a/src/nxdn/packet/Trunk.cpp +++ b/src/nxdn/packet/Trunk.cpp @@ -268,7 +268,9 @@ bool Trunk::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t (rcch->getPriority() & 0x07U); // Priority if (m_nxdn->m_dedicatedControl && !m_nxdn->m_voiceOnControl) { - writeRF_Message_Grant(srcId, dstId, serviceOptions, true); + if (!m_nxdn->m_affiliations.isGranted(dstId)) { + writeRF_Message_Grant(srcId, dstId, serviceOptions, true); + } } } return true; // don't allow this to write to the air diff --git a/src/p25/packet/Trunk.cpp b/src/p25/packet/Trunk.cpp index cd52a865..5b28b083 100644 --- a/src/p25/packet/Trunk.cpp +++ b/src/p25/packet/Trunk.cpp @@ -711,7 +711,9 @@ bool Trunk::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L (tsbk->getPriority() & 0x07U); // Priority if (m_p25->m_dedicatedControl && !m_p25->m_voiceOnControl) { - writeRF_TSDU_Grant(srcId, dstId, serviceOptions, true); + if (!m_p25->m_affiliations.isGranted(dstId)) { + writeRF_TSDU_Grant(srcId, dstId, serviceOptions, true); + } } } return true; // don't allow this to write to the air @@ -727,7 +729,9 @@ bool Trunk::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L (tsbk->getPriority() & 0x07U); // Priority if (m_p25->m_dedicatedControl && !m_p25->m_voiceOnControl) { - writeRF_TSDU_Grant(srcId, dstId, serviceOptions, false); + if (!m_p25->m_affiliations.isGranted(dstId)) { + writeRF_TSDU_Grant(srcId, dstId, serviceOptions, false); + } } } return true; // don't allow this to write to the air @@ -2235,8 +2239,8 @@ bool Trunk::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOp // callback REST API to permit the granted TG on the specified voice channel if (m_p25->m_authoritative && m_p25->m_supervisor) { ::lookups::VoiceChData voiceChData = m_p25->m_affiliations.getRFChData(chNo); - if (voiceChData.isValidCh() && !voiceChData.address().empty() && voiceChData.port() > 0 && - chNo != m_p25->m_siteData.channelNo()) { + if (voiceChData.isValidCh() && !voiceChData.address().empty() && voiceChData.port() > 0/* && + chNo != m_p25->m_siteData.channelNo()*/) { json::object req = json::object(); int state = modem::DVM_STATE::STATE_P25; req["state"].set(state);