diff --git a/Conf.cpp b/Conf.cpp index e5f6ab6..425d898 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -206,8 +206,7 @@ bool CConf::read() section = SECTION_NEXTION; else if (::strncmp(buffer, "[OLED]", 6U) == 0) section = SECTION_OLED; - else if (::strncmp(buffer, "[DMR TG Rewrite]", 16U) == 0) - section = SECTION_TGREWRITE; + else section = SECTION_NONE; @@ -423,6 +422,14 @@ bool CConf::read() m_dmrTXHang = (unsigned int)::atoi(value); else if (::strcmp(key, "CallHang") == 0) m_dmrCallHang = (unsigned int)::atoi(value); + if (::strcmp(key, "TGRewriteSlot1") == 0) + m_TGRewriteSlot1 = ::atoi(value) == 1; + else if (::strcmp(key, "TGRewriteSlot2") == 0) + m_TGRewriteSlot2 = ::atoi(value) == 1; + else if (::strcmp(key, "BMAutoRewrite") == 0) + m_BMAutoRewrite = ::atoi(value) == 1; + else if (::strcmp(key, "BMRewriteReflectorVoicePrompts") == 0) + m_BMRewriteReflectorVoicePrompts = ::atoi(value) == 1; } else if (section == SECTION_FUSION) { if (::strcmp(key, "Enable") == 0) m_fusionEnabled = ::atoi(value) == 1; @@ -521,15 +528,6 @@ bool CConf::read() m_oledBrightness = (unsigned char)::atoi(value); else if (::strcmp(key, "Brightness") == 0) m_oledInvert = (unsigned char)::atoi(value); - } else if (section == SECTION_TGREWRITE) { - if (::strcmp(key, "TGRewriteSlot1") == 0) - m_TGRewriteSlot1 = ::atoi(value) == 1; - else if (::strcmp(key, "TGRewriteSlot2") == 0) - m_TGRewriteSlot2 = ::atoi(value) == 1; - else if (::strcmp(key, "BMAutoRewrite") == 0) - m_BMAutoRewrite = ::atoi(value) == 1; - else if (::strcmp(key, "BMRewriteReflectorVoicePrompts") == 0) - m_BMAutoRewrite = ::atoi(value) == 1; } diff --git a/DMRAccessControl.cpp b/DMRAccessControl.cpp index 3208c74..cf12ffd 100644 --- a/DMRAccessControl.cpp +++ b/DMRAccessControl.cpp @@ -67,7 +67,7 @@ void DMRAccessControl::init(const std::vector& DstIdBlacklistSlot1 m_callHang = callHang; m_TGRewriteSlot1 = TGRewriteSlot1; m_TGRewriteSlot2 = TGRewriteSlot2; - m_BMAutoRewrite = BMAutoRewrite; + m_BMAutoRewrite = BMAutoRewrite; m_BMRewriteReflectorVoicePrompts = BMRewriteReflectorVoicePrompts; } @@ -211,6 +211,7 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid, if (slot == 2 && m_TGRewriteSlot2 == false) return 0; + std::time_t currenttime = std::time(nullptr); @@ -226,12 +227,6 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid, dmrLC->setFLCO(FLCO_GROUP); LogMessage("DMR Slot %u, Rewrite inbound private call to %u to Group Call on TG 9 (BM reflector voice prompt)",slot,did); return 9; -// commented because BM does not seem to pass Private Call to repeater ID. Will need to ask master devs. - // rewrite direct dial inbound -// } else if (did == 235135 && dmrLC->getFLCO() == FLCO_USER_USER) { -// dmrLC->setFLCO(FLCO_GROUP); -// LogMessage("DMR Slot %u, Rewrite inbound private call to repeater ID to Group Call on TG9 (direct dial)",slot,did); -// return(9); } else { return 0; } @@ -240,10 +235,6 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid, return(m_dstRewriteID); } else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9) { m_dstRewriteID = did; - // commented because BM does not seem to pass Private Call to repeater ID. Will need to ask master devs. - /*} else if (m_dstRewriteID == 235135 && m_lastdmrLC->getFLCO() == FLCO_USER_USER) { - LogMessage("DMR Slot %u, Rewrite DST ID of outbound network group call on TG %u to private call %u (direct dial response)",slot,did,m_SrcID); - return(m_SrcID);*/ } return 0; } diff --git a/DMRAccessControl.h b/DMRAccessControl.h index f081c24..4e21fe5 100644 --- a/DMRAccessControl.h +++ b/DMRAccessControl.h @@ -64,6 +64,7 @@ private: static bool m_BMRewriteReflectorVoicePrompts; static CDMRLC* m_lastdmrLC; + diff --git a/DMRSlot.cpp b/DMRSlot.cpp index 922af11..c9600f8 100644 --- a/DMRSlot.cpp +++ b/DMRSlot.cpp @@ -255,8 +255,10 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len) writeNetworkRF(data, DT_TERMINATOR_WITH_LC); if (m_duplex) { + for (unsigned int i = 0U; i < m_hangCount; i++) writeQueueRF(data); + } LogMessage("DMR Slot %u, received RF end of voice transmission, %.1f seconds, BER: %.1f%%", m_slotNo, float(m_rfFrames) / 16.667F, float(m_rfErrs * 100U) / float(m_rfBits)); @@ -657,9 +659,11 @@ void CDMRSlot::writeEndRF(bool writeEnd) data[0U] = TAG_EOT; data[1U] = 0x00U; - + + for (unsigned int i = 0U; i < m_hangCount; i++) writeQueueRF(data); + } } @@ -732,8 +736,10 @@ void CDMRSlot::writeEndNet(bool writeEnd) data[1U] = 0x00U; if (m_duplex) { + for (unsigned int i = 0U; i < m_hangCount; i++) writeQueueNet(data); + } else { for (unsigned int i = 0U; i < 3U; i++) writeQueueNet(data); @@ -902,8 +908,10 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) data[1U] = 0x00U; if (m_duplex) { + for (unsigned int i = 0U; i < m_hangCount; i++) writeQueueNet(data); + } else { for (unsigned int i = 0U; i < 3U; i++) writeQueueNet(data); diff --git a/MMDVM.ini b/MMDVM.ini index 2940f54..f2aa910 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -72,12 +72,12 @@ TXHang=4 #DstIdBlackListSlot2NET= #DstIdWhiteListSlot1NET= #DstIdWhiteListSlot2NET= - -[DMR TG Rewrite] TGRewriteSlot1=0 -TGReWriteSlot2=0 +TGRewriteSlot2=0 BMAutoRewrite=0 BMRewriteReflectorVoicePrompts=0 + + DirectDial=0 TargetTG=9 #RewriteMapSlot1= diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 1153b36..05475eb 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -364,6 +364,10 @@ int CMMDVMHost::run() if (TGRewriteSlot2) LogInfo(" TG Rewrite Slot 2 enabled"); + if (BMAutoRewrite) + LogInfo(" BrandMeister Auto Rewrite enabled"); + if(BMRewriteReflectorVoicePrompts) + LogInfo(" BrandMeister Rewrite Reflector Voice Prompts enabled"); dmr = new CDMRControl(id, colorCode, callHang, selfOnly, prefixes, blackList,dstIDBlackListSlot1RF,dstIDWhiteListSlot1RF, dstIDBlackListSlot2RF, dstIDWhiteListSlot2RF, dstIDBlackListSlot1NET,dstIDWhiteListSlot1NET, dstIDBlackListSlot2NET, dstIDWhiteListSlot2NET, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, lookupFile, rssiMultiplier, rssiOffset, jitter, TGRewriteSlot1, TGRewriteSlot2, BMAutoRewrite, BMRewriteReflectorVoicePrompts); diff --git a/README.TGRewrite b/README.TGRewrite index 8b6480c..43395b9 100644 --- a/README.TGRewrite +++ b/README.TGRewrite @@ -30,11 +30,19 @@ groups, although it will function with permanent talk-groups too. It is useful to set the CallHang parameter to a generous amount. I am currently using seven seconds. +In addition to the above, there is also the capability ro rewrite voice prompts +on link/unlink so all users can hear them on TG9. -Two boolean configuration options control the TG Rewrite feature: +Configuration options are as follows: TGRewriteSlot1=[0|1] TGRewriteSlot2=[0|1] +BMAutoRewrite=[0|1] +BMRewriteReflectorVoicePrompts=[0|1] + +Note at present, Auto rewrite is the only type of rewrite that is implemented so +to do something useful, this option must be set. + ACL's are applied before the rewrite, so still apply to rewritten traffic on original (non-rewritten) talk-group.