Another try at reflectors
This commit is contained in:
parent
ec755dcb26
commit
26eeb9fbba
|
@ -787,10 +787,10 @@ class routerOBP(OPENBRIDGE):
|
||||||
_target_system = self._CONFIG['SYSTEMS'][_target['SYSTEM']]
|
_target_system = self._CONFIG['SYSTEMS'][_target['SYSTEM']]
|
||||||
if _target_system['MODE'] == 'OPENBRIDGE':
|
if _target_system['MODE'] == 'OPENBRIDGE':
|
||||||
print(int_id(_target['TGID']))
|
print(int_id(_target['TGID']))
|
||||||
if _noOBP == True:
|
if _noOBP == True or _target['SYSTEM'] in _tgidIgnore:
|
||||||
print('bang')
|
print('bang')
|
||||||
continue
|
continue
|
||||||
_tgidIgnore.append(int_id(_target['TGID']))
|
_tgidIgnore.append(_target['SYSTEM'])
|
||||||
# Is this a new call stream on the target?
|
# Is this a new call stream on the target?
|
||||||
if (_stream_id not in _target_status):
|
if (_stream_id not in _target_status):
|
||||||
# This is a new call stream on the target
|
# This is a new call stream on the target
|
||||||
|
@ -965,8 +965,9 @@ class routerOBP(OPENBRIDGE):
|
||||||
#if _bridge[0:1] != '#':
|
#if _bridge[0:1] != '#':
|
||||||
if True:
|
if True:
|
||||||
for _system in BRIDGES[_bridge]:
|
for _system in BRIDGES[_bridge]:
|
||||||
if (_system['SYSTEM'] == self._system and _system['TGID'] == _dst_id and _system['TS'] == _slot and _system['ACTIVE'] == True):
|
if _system['SYSTEM'] == self._system and _system['TGID'] == _dst_id and _system['TS'] == _slot and _system['ACTIVE'] == True:
|
||||||
print(_OBtgidIgnore)
|
_OBtgidIgnore = self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,False,_OBtgidIgnore)
|
||||||
|
elif _system['SYSTEM'] == self._system and int_id(_system['TGID']) == 9 and _system['TS'] == 2 and _system['ACTIVE'] == True and _bridge == "#"+str(int_id(_system['TGID'])):
|
||||||
_OBtgidIgnore = self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,False,_OBtgidIgnore)
|
_OBtgidIgnore = self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,False,_OBtgidIgnore)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1055,10 +1056,10 @@ class routerHBP(HBSYSTEM):
|
||||||
|
|
||||||
if _target_system['MODE'] == 'OPENBRIDGE':
|
if _target_system['MODE'] == 'OPENBRIDGE':
|
||||||
print(int_id(_target['TGID']))
|
print(int_id(_target['TGID']))
|
||||||
if _noOBP == True:
|
if _noOBP == True or _target['SYSTEM'] in _tgidIgnore:
|
||||||
print('bang')
|
print('bang')
|
||||||
continue
|
continue
|
||||||
_tgidIgnore.append(int_id(_target['TGID']))
|
_tgidIgnore.append(_target['SYSTEM'])
|
||||||
# Is this a new call stream on the target?
|
# Is this a new call stream on the target?
|
||||||
if (_stream_id not in _target_status):
|
if (_stream_id not in _target_status):
|
||||||
# This is a new call stream on the target
|
# This is a new call stream on the target
|
||||||
|
@ -1187,7 +1188,7 @@ class routerHBP(HBSYSTEM):
|
||||||
# Transmit the packet to the destination system
|
# Transmit the packet to the destination system
|
||||||
systems[_target['SYSTEM']].send_system(_tmp_data)
|
systems[_target['SYSTEM']].send_system(_tmp_data)
|
||||||
#logger.debug('(%s) Packet routed by bridge: %s to system: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
|
#logger.debug('(%s) Packet routed by bridge: %s to system: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
|
||||||
return(_tgidIgnore)
|
return _tgidIgnore
|
||||||
|
|
||||||
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data):
|
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data):
|
||||||
pkt_time = time()
|
pkt_time = time()
|
||||||
|
@ -1366,27 +1367,16 @@ class routerHBP(HBSYSTEM):
|
||||||
logger.info('(%s) Bridge for TG %s does not exist. Creating as User Activated. Timeout %s',self._system, int_id(_dst_id),CONFIG['SYSTEMS'][self._system]['DEFAULT_UA_TIMER'])
|
logger.info('(%s) Bridge for TG %s does not exist. Creating as User Activated. Timeout %s',self._system, int_id(_dst_id),CONFIG['SYSTEMS'][self._system]['DEFAULT_UA_TIMER'])
|
||||||
make_single_bridge(_dst_id,self._system,_slot,CONFIG['SYSTEMS'][self._system]['DEFAULT_UA_TIMER'])
|
make_single_bridge(_dst_id,self._system,_slot,CONFIG['SYSTEMS'][self._system]['DEFAULT_UA_TIMER'])
|
||||||
|
|
||||||
#for _bridge in BRIDGES:
|
|
||||||
#for _system in BRIDGES[_bridge]:
|
|
||||||
#if _bridge[0:1] == '#':
|
|
||||||
#continue
|
|
||||||
#if (_system['SYSTEM'] == self._system and _system['TGID'] == _dst_id and _system['TS'] == _slot and _system['ACTIVE'] == True):
|
|
||||||
|
|
||||||
#self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,False)
|
|
||||||
|
|
||||||
#_bridge = '#'+_bridge
|
|
||||||
#if _bridge in BRIDGES:
|
|
||||||
#self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,True)
|
|
||||||
|
|
||||||
_OBtgidIgnore = []
|
_OBtgidIgnore = []
|
||||||
for _bridge in BRIDGES:
|
for _bridge in BRIDGES:
|
||||||
#if _bridge[0:1] != '#':
|
#if _bridge[0:1] != '#':
|
||||||
if True:
|
if True:
|
||||||
for _system in BRIDGES[_bridge]:
|
for _system in BRIDGES[_bridge]:
|
||||||
if (_system['SYSTEM'] == self._system and _system['TGID'] == _dst_id and _system['TS'] == _slot and _system['ACTIVE'] == True):
|
if _system['SYSTEM'] == self._system and _system['TGID'] == _dst_id and _system['TS'] == _slot and _system['ACTIVE'] == True:
|
||||||
print(_OBtgidIgnore)
|
_OBtgidIgnore = self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,False,_OBtgidIgnore)
|
||||||
|
elif _system['SYSTEM'] == self._system and int_id(_system['TGID']) == 9 and _system['TS'] == 2 and _system['ACTIVE'] == True and _bridge == "#"+str(int_id(_system['TGID'])):
|
||||||
_OBtgidIgnore = self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,False,_OBtgidIgnore)
|
_OBtgidIgnore = self.to_target(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,False,_OBtgidIgnore)
|
||||||
|
|
||||||
|
|
||||||
# Final actions - Is this a voice terminator?
|
# Final actions - Is this a voice terminator?
|
||||||
if (_frame_type == HBPF_DATA_SYNC) and (_dtype_vseq == HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != HBPF_SLT_VTERM):
|
if (_frame_type == HBPF_DATA_SYNC) and (_dtype_vseq == HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != HBPF_SLT_VTERM):
|
||||||
|
|
|
@ -280,7 +280,7 @@ class HBSYSTEM(DatagramProtocol):
|
||||||
_packet = b''.join([_packet[:11], _peer, _packet[15:]])
|
_packet = b''.join([_packet[:11], _peer, _packet[15:]])
|
||||||
self.transport.write(_packet, self._peers[_peer]['SOCKADDR'])
|
self.transport.write(_packet, self._peers[_peer]['SOCKADDR'])
|
||||||
# KEEP THE FOLLOWING COMMENTED OUT UNLESS YOU'RE DEBUGGING DEEPLY!!!!
|
# KEEP THE FOLLOWING COMMENTED OUT UNLESS YOU'RE DEBUGGING DEEPLY!!!!
|
||||||
logger.debug('(%s) TX Packet to %s on port %s: %s', self._peers[_peer]['RADIO_ID'], self._peers[_peer]['IP'], self._peers[_peer]['PORT'], ahex(_packet))
|
#logger.debug('(%s) TX Packet to %s on port %s: %s', self._peers[_peer]['RADIO_ID'], self._peers[_peer]['IP'], self._peers[_peer]['PORT'], ahex(_packet))
|
||||||
|
|
||||||
def send_master(self, _packet):
|
def send_master(self, _packet):
|
||||||
if _packet[:4] == DMRD:
|
if _packet[:4] == DMRD:
|
||||||
|
|
Loading…
Reference in New Issue