From 56c35c21e1b7f79154dc32e581e8850fd2694444 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sat, 17 Oct 2026 21:17:55 -0400 Subject: [PATCH] refactor P25 RF grant steering when in enhanced conventional; add option to hide remote grant demand messaging; --- configs/config.example.yml | 8 +++--- src/host/p25/Control.cpp | 32 ++++-------------------- src/host/p25/Control.h | 2 +- src/host/p25/packet/ControlSignaling.cpp | 23 +++-------------- src/host/p25/packet/Voice.cpp | 2 +- 5 files changed, 13 insertions(+), 54 deletions(-) diff --git a/configs/config.example.yml b/configs/config.example.yml index 6c6f9635..c388aa6d 100644 --- a/configs/config.example.yml +++ b/configs/config.example.yml @@ -247,7 +247,7 @@ protocols: verbose: true # Flag indicating whether or not debug logging is enabled. debug: false - + # # Project 25 # @@ -299,10 +299,8 @@ protocols: controlOnly: false # Flag indicating whether or not a voice HDU will transmitted at the start of a call from the network. disableNetworkHDU: false - # Flag indicating whether or not network calls will generate a channel grant. - # (This applies only in conventional operations where channel granting is utilized and RF-only talkgroup - # steering is required.) - disableNetworkGrant: false + # Flag indicating whether or not to hide remote grant demand logging. + hideRemoteGrantLog: true # Flag indicating whether or not a TGID will be tested for affiliations before being granted. ignoreAffiliationCheck: false # Flag indicating whether or not a P25 TDU (call terminator) will occur to the network immmediately after a diff --git a/src/host/p25/Control.cpp b/src/host/p25/Control.cpp index 3264353f..494488b1 100644 --- a/src/host/p25/Control.cpp +++ b/src/host/p25/Control.cpp @@ -78,8 +78,8 @@ Control::Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t q m_controlOnly(false), m_ackTSBKRequests(true), m_allowRFGrantTGSteering(false), - m_disableNetworkGrant(false), m_disableNetworkHDU(false), + m_hideRemoteGrantLog(false), m_allowExplicitSourceId(false), m_convNetGrantDemand(false), m_sndcpSupport(false), @@ -372,26 +372,8 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw LogWarning(LOG_P25, "Frame loss threshold may be excessive, default is %u, configured is %u", DEFAULT_FRAME_LOSS_THRESHOLD, m_frameLossThreshold); } - /* - ** Network HDU and Grant Disables - */ - m_disableNetworkGrant = p25Protocol["disableNetworkGrant"].as(false); m_disableNetworkHDU = p25Protocol["disableNetworkHDU"].as(false); - - if (m_disableNetworkGrant && m_enableControl && m_dedicatedControl) { - LogWarning(LOG_P25, "Cannot disable network traffic grants for dedicated control configuration."); - m_disableNetworkGrant = false; - } - - if (m_disableNetworkGrant && m_controlOnly) { - LogWarning(LOG_P25, "Cannot disable network traffic grants for control-only configuration."); - m_disableNetworkGrant = false; - } - - if (m_disableNetworkGrant && m_voiceOnControl) { - LogWarning(LOG_P25, "Cannot disable network traffic grants for voice on control configuration."); - m_disableNetworkGrant = false; - } + m_hideRemoteGrantLog = p25Protocol["hideRemoteGrantLog"].as(false); /* ** CC Service Class @@ -515,8 +497,8 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw if (m_disableNetworkHDU) { LogInfo(" Disable Network HDUs: yes"); } - if (m_disableNetworkGrant) { - LogInfo(" Disable Network Grants: yes"); + if (m_hideRemoteGrantLog) { + LogInfo(" Hide Remote Grant Demand Logging: yes"); } if (!m_control->m_ctrlTSDUMBF) { LogInfo(" Disable Multi-Block TSDUs: yes"); @@ -1649,10 +1631,6 @@ void Control::processNetwork() case DUID::TDULC: // is this an TDU with a grant demand? if (duid == DUID::TDU && m_enableControl && grantDemand) { - if (m_disableNetworkGrant) { - return; - } - // if we're non-dedicated control, and if we're not in a listening or idle state, ignore any grant // demands if (!m_dedicatedControl && (m_rfState != RS_RF_LISTENING || m_netState != RS_NET_IDLE)) { @@ -1687,7 +1665,7 @@ void Control::processNetwork() (control.getEncrypted() ? 0x40U : 0x00U) + // Encrypted Flag (control.getPriority() & 0x07U); // Priority - if (m_verbose) { + if (m_verbose && !m_hideRemoteGrantLog) { LogInfoEx(LOG_NET, P25_TSDU_STR " remote grant demand, srcId = %u, dstId = %u, unitToUnit = %u, encrypted = %u", srcId, dstId, unitToUnit, grantEncrypt); } diff --git a/src/host/p25/Control.h b/src/host/p25/Control.h index 1986a323..53afbe36 100644 --- a/src/host/p25/Control.h +++ b/src/host/p25/Control.h @@ -320,8 +320,8 @@ namespace p25 bool m_controlOnly; bool m_ackTSBKRequests; bool m_allowRFGrantTGSteering; - bool m_disableNetworkGrant; bool m_disableNetworkHDU; + bool m_hideRemoteGrantLog; bool m_allowExplicitSourceId; bool m_convNetGrantDemand; bool m_sndcpSupport; diff --git a/src/host/p25/packet/ControlSignaling.cpp b/src/host/p25/packet/ControlSignaling.cpp index f9f1a8c1..308f4b34 100644 --- a/src/host/p25/packet/ControlSignaling.cpp +++ b/src/host/p25/packet/ControlSignaling.cpp @@ -2185,25 +2185,6 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_ return true; // do not generate grant packets for $FFFF (All Call) TGID } - // are network channel grants disabled? - if (m_p25->m_disableNetworkGrant) { - // don't process RF grant if the network isn't in a idle state and the RF destination is the network destination - if (m_p25->m_netState != RS_NET_IDLE && dstId == m_p25->m_netLastDstId) { - LogWarning(LOG_RF, "Traffic collision detect, preempting new RF traffic to existing network traffic!"); - LogWarning(LOG_RF, P25_TSDU_STR ", TSBKO, IOSP_GRP_VCH (Group Voice Channel Request) denied, traffic collision, dstId = %u", dstId); - writeRF_TSDU_Deny(srcId, dstId, ReasonCode::DENY_PTT_COLLIDE, (grp) ? TSBKO::IOSP_GRP_VCH : TSBKO::IOSP_UU_VCH, grp, true); - - ::ActivityLog("P25", true, "group grant request from %u to TG %u denied", srcId, dstId); - m_p25->m_rfState = RS_RF_REJECTED; - return false; - } - - // ensure network watchdog is stopped - if (m_p25->m_networkWatchdog.isRunning()) { - m_p25->m_networkWatchdog.stop(); - } - } - // are we skipping checking? if (!skip) { if (m_p25->m_rfState != RS_RF_LISTENING && m_p25->m_rfState != RS_RF_DATA) { @@ -2283,7 +2264,9 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_ ::lookups::TalkgroupRuleGroupVoice tid = m_p25->m_tidLookup->find(dstId); if (tid.config().affiliated()) { if (!m_p25->m_affiliations->hasGroupAff(dstId)) { - LogWarning(LOG_NET, P25_TSDU_STR ", TSBKO, IOSP_GRP_VCH (Group Voice Channel Request) ignored, no group affiliations, dstId = %u", dstId); + if (!m_p25->m_hideRemoteGrantLog) { + LogWarning(LOG_NET, P25_TSDU_STR ", TSBKO, IOSP_GRP_VCH (Group Voice Channel Request) ignored, no group affiliations, dstId = %u", dstId); + } return false; } } diff --git a/src/host/p25/packet/Voice.cpp b/src/host/p25/packet/Voice.cpp index 49067467..32725da0 100644 --- a/src/host/p25/packet/Voice.cpp +++ b/src/host/p25/packet/Voice.cpp @@ -1902,7 +1902,7 @@ void Voice::writeNet_LDU1() LogInfoEx(LOG_NET, "P25 Voice Call, srcId = %u, dstId = %u", srcId, dstId); // conventional registration or DVRS support? - if (((m_p25->m_enableControl && !m_p25->m_dedicatedControl) || m_p25->m_voiceOnControl) && !m_p25->m_disableNetworkGrant) { + if ((m_p25->m_enableControl && !m_p25->m_dedicatedControl) || m_p25->m_voiceOnControl) { uint8_t serviceOptions = (m_netLC.getEmergency() ? 0x80U : 0x00U) + // Emergency Flag (m_netLC.getEncrypted() ? 0x40U : 0x00U) + // Encrypted Flag (m_netLC.getPriority() & 0x07U); // Priority