From dafde43786ba7adccb563d4487d6806da5624e07 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 9 Nov 2016 17:56:59 +0000 Subject: [PATCH 1/4] Recreated .kateproject - it went missing --- .kateproject | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .kateproject diff --git a/.kateproject b/.kateproject new file mode 100644 index 0000000..10f6888 --- /dev/null +++ b/.kateproject @@ -0,0 +1,4 @@ +{ + "name": "MMDVMHost" + , "files": [ { "git": 1 } ] + } From 2889b5f9ab0bb2180ab38084f2775245859596d8 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 27 Nov 2016 19:53:41 +0000 Subject: [PATCH 2/4] Fix bug in TGRewrite that stopped echo from working properly, tidy up, remove unused variables. --- DMRAccessControl.cpp | 52 +++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/DMRAccessControl.cpp b/DMRAccessControl.cpp index 4fed8de..4fbd37b 100644 --- a/DMRAccessControl.cpp +++ b/DMRAccessControl.cpp @@ -42,8 +42,6 @@ unsigned int CDMRAccessControl::m_id = 0U; unsigned int CDMRAccessControl::m_dstRewriteID[2]; unsigned int CDMRAccessControl::m_srcID[2]; -CDMRLC* CDMRAccessControl::m_lastdmrLC; - time_t CDMRAccessControl::m_time[2]; int CDMRAccessControl::m_callHang; @@ -215,10 +213,14 @@ unsigned int CDMRAccessControl::dstIdRewrite(unsigned int did, unsigned int sid, if (network) { m_dstRewriteID[slot - 1U] = did; m_srcID[slot - 1U] = sid; - - // Not needed at present - for direct dial, which requires change at master end. - //memcpy(&m_lastdmrLC, &dmrLC, sizeof(dmrLC)); - if (m_bmAutoRewrite && (did < 4000U || did > 5000U) && did > 0U && did != 9U && dmrLC->getFLCO() == FLCO_GROUP) { + + //deal with values of did we should never rewrite for + if(did == 0U || did == 9U) { + return 0U; + }; + + + if (m_bmAutoRewrite && (did < 4000U || did > 5000U) && dmrLC->getFLCO() == FLCO_GROUP) { LogMessage("DMR Slot %u, Rewrite DST ID (TG) of of inbound network traffic from %u to 9", slot, did); return 9U; // Rewrite incoming BM voice prompts to TG 9 @@ -229,19 +231,33 @@ unsigned int CDMRAccessControl::dstIdRewrite(unsigned int did, unsigned int sid, } else { return 0U; } - } else if (m_bmAutoRewrite && did == 9U && m_dstRewriteID[slot - 1U] != 9U && m_dstRewriteID[slot - 1U] != 0U && (m_time[slot - 1U] + 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[slot - 1U]); - return m_dstRewriteID[slot - 1U]; - } else if (m_bmAutoRewrite && (did < 4000U || did > 5000U) && did > 0U && did != 9U && did != 9990U && did < 999999U && dmrLC->getFLCO() == FLCO_USER_USER) { - m_dstRewriteID[slot - 1U] = 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 < 4000U || did > 5000U) && did > 0U && did != 9U && did != 9990U && did > 999999U) { - m_dstRewriteID[slot - 1U] = did; - } + } else { + + //deal with values of did we should never rewrite for + switch(did) { + case 0U : + return 0U; + break; + case 9990U : + LogMessage("DMR Slot %u, Outbound call to Echo on 9990 by %u", slot, sid); + return 0U; + break; + } + + if (m_bmAutoRewrite && did == 9U && m_dstRewriteID[slot - 1U] != 9U && m_dstRewriteID[slot - 1U] != 0U && (m_time[slot - 1U] + 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[slot - 1U]); + return m_dstRewriteID[slot - 1U]; + } else if (m_bmAutoRewrite && (did < 4000U || did > 5000U) && did != 9U && did < 999999U && dmrLC->getFLCO() == FLCO_USER_USER) { + m_dstRewriteID[slot - 1U] = 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 < 4000U || did > 5000U) && did != 9U && did > 999999U) { + m_dstRewriteID[slot - 1U] = did; + } - return 0U; + return 0U; + } } void CDMRAccessControl::setOverEndTime(unsigned int slot) From c7b4be0354480e916dc94b9380fc46396ee14ab6 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 27 Nov 2016 19:56:25 +0000 Subject: [PATCH 3/4] TG Rewrite - removed unsused options in MMDVM.ini --- MMDVM.ini | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MMDVM.ini b/MMDVM.ini index 5b11909..fb50054 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -86,10 +86,6 @@ TGRewriteSlot1=0 TGRewriteSlot2=0 BMAutoRewrite=0 BMRewriteReflectorVoicePrompts=0 -DirectDial=0 -TargetTG=9 -#RewriteMapSlot1= -#RewritemapSlot2= [System Fusion] Enable=1 From 37803597c91723fbd208c6b102cba701c925c1a2 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 27 Nov 2016 21:53:49 +0000 Subject: [PATCH 4/4] As requested - removed .kateproject --- .kateproject | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .kateproject diff --git a/.kateproject b/.kateproject deleted file mode 100644 index 10f6888..0000000 --- a/.kateproject +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "MMDVMHost" - , "files": [ { "git": 1 } ] - }