Direct dial, logic changes

This commit is contained in:
Simon 2016-09-18 21:47:03 +01:00
parent fbcc72420d
commit 40a9a2c562
2 changed files with 17 additions and 3 deletions

View file

@ -19,6 +19,7 @@
#include <algorithm>
#include <vector>
#include <ctime>
#include <string.h>
std::vector<unsigned int> DMRAccessControl::m_dstBlackListSlot1RF;
@ -42,6 +43,8 @@ unsigned int DMRAccessControl::m_id = 0U;
unsigned int DMRAccessControl::m_dstRewriteID = 0U;
unsigned int DMRAccessControl::m_SrcID = 0U;
CDMRLC* DMRAccessControl::m_lastdmrLC;
std::time_t DMRAccessControl::m_time;
unsigned int DMRAccessControl::m_callHang;
@ -211,23 +214,32 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
if (network) {
m_dstRewriteID = did;
m_SrcID = sid;
memcpy(&dmrLC, &m_lastdmrLC, sizeof(dmrLC));
if ( (did < 4000 || did > 5000) && did > 0 && did != 9 && dmrLC->getFLCO() == FLCO_GROUP ) {
LogMessage("DMR Slot %u, Rewrite DST ID (TG) of of inbound network traffic from %u to 9",slot,did);
return 9;
// rewrite incoming BM voice prompts to TG 9
} else if ((sid >= 4000 && sid <= 5000) && dmrLC->getFLCO() == FLCO_USER_USER) {
dmrLC->setFLCO(FLCO_GROUP);
LogMessage("DMR Slot %u, Rewrite inbound private call to %u to Group Call on TG9",slot,did);
LogMessage("DMR Slot %u, Rewrite inbound private call to %u to Group Call on TG 9 (BM reflector voice prompt)",slot,did);
return 9;
// 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;
}
} else if (did == 9 && m_dstRewriteID != 9 && m_dstRewriteID != 0 && (m_time + m_callHang) > currenttime) {
} else if (did == 9 && m_dstRewriteID != 9 && m_dstRewriteID != 0 && (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 ((did < 4000 || did > 5000) && did > 0 && did !=9) {
m_dstRewriteID = did;
}
} 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;
}

View file

@ -61,6 +61,8 @@ private:
static bool m_TGRewriteSlot1;
static bool m_TGRewriteSlot2;
static CDMRLC* m_lastdmrLC;
};