From c9b4700300111c88bc440519bab07a5697d301f9 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 7 Oct 2016 16:35:37 +0100 Subject: [PATCH 1/3] TG Rewrite - add manual dial of UA talkgroup - same mechanism as reflectors --- DMRAccessControl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/DMRAccessControl.cpp b/DMRAccessControl.cpp index 3b88571..4eadfcc 100644 --- a/DMRAccessControl.cpp +++ b/DMRAccessControl.cpp @@ -234,8 +234,14 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid, } else if (m_BMAutoRewrite && did == 9U && m_dstRewriteID != 9U && m_dstRewriteID != 0U && (m_time + m_callHang) > currenttime && dmrLC->getFLCO() == FLCO_GROUP ) { LogMessage("DMR Slot %u, Rewrite DST ID (TG) of outbound network traffic from %u to %u (return traffic during CallHang)",slot,did,m_dstRewriteID); return(m_dstRewriteID); - } else if (m_BMAutoRewrite && (did < 4000U || did > 5000U) && did > 0U && did !=9U) { - m_dstRewriteID = did; + + } else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9 && did < 99999 && dmrLC->getFLCO() == FLCO_USER_USER) { + m_dstRewriteID = did; + dmrLC->setFLCO(FLCO_GROUP); + LogMessage("DMR Slot %u, Rewrite outbound private call to %u Group Call (Connect talkgroup by private call)",slot,did); + return did; + } else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9 && did > 99999) { + m_dstRewriteID = did; } return 0U; } From 0d56f3e295871459eb3e9a5f83b9584168ccfe54 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 7 Oct 2016 16:36:57 +0100 Subject: [PATCH 2/3] TG Rewrite readme update --- README.TGRewrite | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.TGRewrite b/README.TGRewrite index 43395b9..f960732 100644 --- a/README.TGRewrite +++ b/README.TGRewrite @@ -12,8 +12,11 @@ which transparently maps back to the originating talkgroup. Rewrite is also enabled if an outbound call is made to a talkgroup and then TG9 is activated during the CallHang period. -To use a User Activated talk-group, briefly key-up on that talk-group to -activate it, then switch back to TG9 and talk as normal. If the CallHang period +To use a User Activated talk-group, either briefly key-up on that talk-group to +activate it, then switch back to TG9 and talk as normal. Alternatively, and +perhaps more usefully, you can make a private call to the talk-group ID. This +enables you to manual-dial a talkgroup that is not in your codeplug, in the same +way that you can manual dial a reflector. If the CallHang period expires, you may need to activate the talk-group again by keying up on that talkgroup briefly, as before. Alternatively, you can wait for inbound audio to re-activate the rewrite, then respond during the CallHang period. @@ -40,7 +43,8 @@ TGRewriteSlot2=[0|1] BMAutoRewrite=[0|1] BMRewriteReflectorVoicePrompts=[0|1] -Note at present, Auto rewrite is the only type of rewrite that is implemented so +Note at present, Auto rewrite is the only type of rewrite that is implemented +so to do something useful, this option must be set. From 84c06afdb643b86ace00abe5f9e0549cb65e8663 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 7 Oct 2016 19:47:33 +0100 Subject: [PATCH 3/3] Signed/Unsigned issues --- DMRAccessControl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DMRAccessControl.cpp b/DMRAccessControl.cpp index 4eadfcc..56604da 100644 --- a/DMRAccessControl.cpp +++ b/DMRAccessControl.cpp @@ -235,12 +235,12 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid, LogMessage("DMR Slot %u, Rewrite DST ID (TG) of outbound network traffic from %u to %u (return traffic during CallHang)",slot,did,m_dstRewriteID); return(m_dstRewriteID); - } else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9 && did < 99999 && dmrLC->getFLCO() == FLCO_USER_USER) { + } else if (m_BMAutoRewrite && (did < 4000U || did > 5000U) && did > 0U && did !=9U && did < 99999U && dmrLC->getFLCO() == FLCO_USER_USER) { m_dstRewriteID = did; dmrLC->setFLCO(FLCO_GROUP); LogMessage("DMR Slot %u, Rewrite outbound private call to %u Group Call (Connect talkgroup by private call)",slot,did); return did; - } else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9 && did > 99999) { + } else if (m_BMAutoRewrite && (did < 4000U || did > 5000U) && did > 0U && did !=9U && did > 99999U) { m_dstRewriteID = did; } return 0U;