|
|
|
|
@ -1236,7 +1236,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
OPENBRIDGE.__init__(self, _name, _config, _report)
|
|
|
|
|
self.STATUS = {}
|
|
|
|
|
|
|
|
|
|
def to_target(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,_noOBP,sysIgnore, _hops = b''):
|
|
|
|
|
def to_target(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data, pkt_time, dmrpkt, _bits,_bridge,_system,_noOBP,sysIgnore, _hops = b'', _source_server = b'\x00\x00\x00\x00'):
|
|
|
|
|
_sysIgnore = sysIgnore
|
|
|
|
|
for _target in BRIDGES[_bridge]:
|
|
|
|
|
if (_target['SYSTEM'] != self._system) and (_target['ACTIVE']):
|
|
|
|
|
@ -1408,7 +1408,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
_tmp_data = b''.join([_tmp_data, dmrpkt, b'\x00\x00']) # Add two bytes of nothing since OBP doesn't include BER & RSSI bytes #_data[53:55]
|
|
|
|
|
|
|
|
|
|
# Transmit the packet to the destination system
|
|
|
|
|
systems[_target['SYSTEM']].send_system(_tmp_data,_hops)
|
|
|
|
|
systems[_target['SYSTEM']].send_system(_tmp_data,_hops,_source_server)
|
|
|
|
|
#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']))
|
|
|
|
|
#Ignore this system and TS pair if it's called again on this packet
|
|
|
|
|
return(_sysIgnore)
|
|
|
|
|
@ -1423,7 +1423,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
systems[_d_system]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_d_system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
|
|
|
|
|
def sendDataToOBP(self,_target,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_hops = b''):
|
|
|
|
|
def sendDataToOBP(self,_target,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_hops = b'',_source_server = b'\x00\x00\x00\x00'):
|
|
|
|
|
|
|
|
|
|
_int_dst_id = int_id(_dst_id)
|
|
|
|
|
_target_status = systems[_target].STATUS
|
|
|
|
|
@ -1457,13 +1457,13 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
#Assemble transmit HBP packet header
|
|
|
|
|
_tmp_data = b''.join([_data[:15], _tmp_bits.to_bytes(1, 'big'), _data[16:20]])
|
|
|
|
|
_tmp_data = b''.join([_tmp_data, dmrpkt])
|
|
|
|
|
systems[_target].send_system(_tmp_data,_hops)
|
|
|
|
|
systems[_target].send_system(_tmp_data,_hops, _source_server)
|
|
|
|
|
logger.info('(%s) UNIT Data Bridged to OBP System: %s DST_ID: %s', self._system, _target,_int_dst_id)
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
systems[_target]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_target, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash, _hops = b''):
|
|
|
|
|
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash, _hops = b'', _source_server = b'\x00\x00\x00\x00'):
|
|
|
|
|
pkt_time = time()
|
|
|
|
|
dmrpkt = _data[20:53]
|
|
|
|
|
_bits = _data[15]
|
|
|
|
|
@ -1569,7 +1569,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
continue
|
|
|
|
|
#We only want to send data calls to individual IDs via OpenBridge
|
|
|
|
|
if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE' and (_int_dst_id >= 1000000):
|
|
|
|
|
self.sendDataToOBP(system,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_hops)
|
|
|
|
|
self.sendDataToOBP(system,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_hops,_source_server)
|
|
|
|
|
|
|
|
|
|
#If destination ID is in the Subscriber Map
|
|
|
|
|
if _dst_id in SUB_MAP:
|
|
|
|
|
@ -1768,7 +1768,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
for _system in BRIDGES[_bridge]:
|
|
|
|
|
|
|
|
|
|
if _system['SYSTEM'] == self._system and _system['TGID'] == _dst_id and _system['TS'] == _slot and _system['ACTIVE'] == True:
|
|
|
|
|
_sysIgnore = 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,_sysIgnore,_hops)
|
|
|
|
|
_sysIgnore = 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,_sysIgnore,_hops,_source_server)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Final actions - Is this a voice terminator?
|
|
|
|
|
|