Next release of TG Rewrite
This commit is contained in:
parent
65bdc54997
commit
e87eae94a1
7 changed files with 37 additions and 27 deletions
20
Conf.cpp
20
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;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -212,6 +212,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);
|
||||
|
||||
if (network) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ private:
|
|||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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));
|
||||
|
@ -658,8 +660,10 @@ 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);
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue