Added check to exclude private calls from TG rewrite. (FLCO_GROUP)
This commit is contained in:
parent
79e24fe5ef
commit
aa3e592ebb
|
@ -20,6 +20,7 @@
|
|||
#include <vector>
|
||||
#include <ctime>
|
||||
|
||||
|
||||
std::vector<unsigned int> DMRAccessControl::m_dstBlackListSlot1RF;
|
||||
std::vector<unsigned int> DMRAccessControl::m_dstBlackListSlot2RF;
|
||||
std::vector<unsigned int> DMRAccessControl::m_dstWhiteListSlot1RF;
|
||||
|
@ -196,7 +197,7 @@ bool DMRAccessControl::validateAccess (unsigned int src_id, unsigned int dst_id,
|
|||
}
|
||||
}
|
||||
|
||||
unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid, unsigned int slot, bool network)
|
||||
unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid, unsigned int slot, bool network, CDMRLC* dmrLC)
|
||||
{
|
||||
|
||||
if (slot == 1 && m_TGRewriteSlot1 == false)
|
||||
|
@ -204,6 +205,9 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
|
|||
|
||||
if (slot == 2 && m_TGRewriteSlot2 == false)
|
||||
return 0;
|
||||
|
||||
if (dmrLC->getFLCO() != FLCO_GROUP)
|
||||
return 0;
|
||||
|
||||
std::time_t currenttime = std::time(nullptr);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include "DMRLC.h"
|
||||
|
||||
class DMRAccessControl {
|
||||
public:
|
||||
|
@ -24,7 +25,7 @@ public:
|
|||
|
||||
static void init(const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF, const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, const std::vector<unsigned int>& SrcIdBlacklist, bool selfOnly, const std::vector<unsigned int>& prefixes,unsigned int id,unsigned int callHang, bool TGRewrteSlot1, bool TGRewrteSlot2);
|
||||
|
||||
static unsigned int DstIdRewrite(unsigned int id, unsigned int sid,unsigned int slot, bool network);
|
||||
static unsigned int DstIdRewrite(unsigned int id, unsigned int sid,unsigned int slot, bool network, CDMRLC* dmrLC);
|
||||
static void setOverEndTime();
|
||||
|
||||
private:
|
||||
|
|
|
@ -159,7 +159,7 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||
return;
|
||||
}
|
||||
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did,sid,m_slotNo,false);
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did,sid,m_slotNo,false,lc);
|
||||
if (rw_id) {
|
||||
|
||||
lc->setDstId(rw_id);
|
||||
|
@ -492,8 +492,7 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||
delete lc;
|
||||
return;
|
||||
}
|
||||
// Test dst rewrite
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did,sid,m_slotNo,false);
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did,sid,m_slotNo,false,lc);
|
||||
if (rw_id) {
|
||||
|
||||
lc->setDstId(rw_id);
|
||||
|
@ -778,7 +777,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||
return;
|
||||
|
||||
// Test dst rewrite
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did, sid,m_slotNo, true);
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did, sid,m_slotNo, true,m_netLC);
|
||||
if (rw_id) {
|
||||
|
||||
m_netLC->setDstId(rw_id);
|
||||
|
@ -848,7 +847,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||
return;
|
||||
|
||||
// Test dst rewrite
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did,sid,m_slotNo,true);
|
||||
unsigned int rw_id = DMRAccessControl::DstIdRewrite(did,sid,m_slotNo,true, m_netLC);
|
||||
if (rw_id) {
|
||||
|
||||
m_netLC->setDstId(rw_id);
|
||||
|
|
Loading…
Reference in a new issue