diff --git a/src/fne/network/callhandler/TagDMRData.cpp b/src/fne/network/callhandler/TagDMRData.cpp index e2f4c579..cf719426 100644 --- a/src/fne/network/callhandler/TagDMRData.cpp +++ b/src/fne/network/callhandler/TagDMRData.cpp @@ -245,6 +245,10 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId parrotFrame.dstId = dstId; m_parrotFrames.push_back(parrotFrame); + + if (m_network->m_parrotOnlyOriginating) { + return true; // end here because parrot calls should never repeat anywhere + } } // process CSBK from peer diff --git a/src/fne/network/callhandler/TagNXDNData.cpp b/src/fne/network/callhandler/TagNXDNData.cpp index 50d05b41..dd8f8d6b 100644 --- a/src/fne/network/callhandler/TagNXDNData.cpp +++ b/src/fne/network/callhandler/TagNXDNData.cpp @@ -215,6 +215,10 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI parrotFrame.dstId = dstId; m_parrotFrames.push_back(parrotFrame); + + if (m_network->m_parrotOnlyOriginating) { + return true; // end here because parrot calls should never repeat anywhere + } } // repeat traffic to the connected peers diff --git a/src/fne/network/callhandler/TagP25Data.cpp b/src/fne/network/callhandler/TagP25Data.cpp index 07c73863..de2368b2 100644 --- a/src/fne/network/callhandler/TagP25Data.cpp +++ b/src/fne/network/callhandler/TagP25Data.cpp @@ -279,6 +279,10 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId parrotFrame.dstId = dstId; m_parrotFrames.push_back(parrotFrame); + + if (m_network->m_parrotOnlyOriginating) { + return true; // end here because parrot calls should never repeat anywhere + } } // process TSDU from peer @@ -458,10 +462,15 @@ void TagP25Data::playbackParrot() uint32_t messageLength = 0U; UInt8Array message = m_network->createP25_TDUMessage(messageLength, control, lsd, controlByte); if (message != nullptr) { - // repeat traffic to the connected peers - for (auto peer : m_network->m_peers) { - LogMessage(LOG_NET, "P25, Parrot Grant Demand, peer = %u, srcId = %u, dstId = %u", peer.first, srcId, dstId); - m_network->writePeer(peer.first, { NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25 }, message.get(), messageLength, 0U, false); + if (m_network->m_parrotOnlyOriginating) { + LogMessage(LOG_NET, "P25, Parrot Grant Demand, peer = %u, srcId = %u, dstId = %u", pkt.peerId, srcId, dstId); + m_network->writePeer(pkt.peerId, { NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25 }, message.get(), messageLength, 0U, false); + } else { + // repeat traffic to the connected peers + for (auto peer : m_network->m_peers) { + LogMessage(LOG_NET, "P25, Parrot Grant Demand, peer = %u, srcId = %u, dstId = %u", peer.first, srcId, dstId); + m_network->writePeer(peer.first, { NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25 }, message.get(), messageLength, 0U, false); + } } } }