update sample config

This commit is contained in:
Cort Buffington 2020-02-17 19:20:10 -06:00
parent 7fc4ce0495
commit 21f9c680be
2 changed files with 23 additions and 4 deletions

View File

@ -892,23 +892,27 @@ class routerHBP(HBSYSTEM):
if _dst_id in UNIT_MAP: if _dst_id in UNIT_MAP:
if UNIT_MAP[_dst_id][0] != self._system: if UNIT_MAP[_dst_id][0] != self._system:
self._targets = [UNIT_MAP[_dst_id][0]] self._targets = [UNIT_MAP[_dst_id][0]]
_target_route = UNIT_MAP[_dst_id][0] #_target_route = UNIT_MAP[_dst_id][0]
else: else:
self._targets = [] self._targets = []
logger.debug('UNIT call to a subscriber on the same system, send nothing') logger.debug('UNIT call to a subscriber on the same system, send nothing')
else: else:
self._targets = list(systems) self._targets = list(systems)
self._targets.remove(self._system) self._targets.remove(self._system)
_target_route = 'FLOOD' #_target_route = 'FLOOD'
# This is a new call stream, so log & report # This is a new call stream, so log & report
self.STATUS[_slot]['RX_START'] = pkt_time self.STATUS[_slot]['RX_START'] = pkt_time
logger.info('(%s) *UNIT CALL START* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) UNIT: %s (%s), TS: %s, FORWARD: %s', \ logger.info('(%s) *UNIT CALL START* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) UNIT: %s (%s), TS: %s, FORWARD: %s', \
self._system, int_id(_stream_id), get_alias(_rf_src, subscriber_ids), int_id(_rf_src), get_alias(_peer_id, peer_ids), int_id(_peer_id), get_alias(_dst_id, talkgroup_ids), int_id(_dst_id), _slot, _target_route) self._system, int_id(_stream_id), get_alias(_rf_src, subscriber_ids), int_id(_rf_src), get_alias(_peer_id, peer_ids), int_id(_peer_id), get_alias(_dst_id, talkgroup_ids), int_id(_dst_id), _slot, self._targets)
if CONFIG['REPORTS']['REPORT']: if CONFIG['REPORTS']['REPORT']:
self._report.send_bridgeEvent('UNIT VOICE,START,RX,{},{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), _target_route).encode(encoding='utf-8', errors='ignore')) self._report.send_bridgeEvent('UNIT VOICE,START,RX,{},{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), _target_route).encode(encoding='utf-8', errors='ignore'))
for _target in self._targets: for _target in self._targets:
if _target not in UNIT:
logger.debug('(%s) *UNIT CALL NOT FORWARDED* UNIT calling is disabled for this system (EGRESS)', self._system)
continue
_target_status = systems[_target].STATUS _target_status = systems[_target].STATUS
_target_system = self._CONFIG['SYSTEMS'][_target] _target_system = self._CONFIG['SYSTEMS'][_target]
@ -1007,7 +1011,9 @@ class routerHBP(HBSYSTEM):
if _call_type == 'group': if _call_type == 'group':
self.group_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data) self.group_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
elif _call_type == 'unit': elif _call_type == 'unit':
if UNIT: if self._system not in UNIT:
logger.debug('(%s) *UNIT CALL NOT FORWARDED* UNIT calling is disabled for this system (INGRESS)', self._system)
else:
self.unit_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data) self.unit_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
elif _call_type == 'vscsbk': elif _call_type == 'vscsbk':
logger.debug('CSBK recieved, but HBlink does not process them currently') logger.debug('CSBK recieved, but HBlink does not process them currently')

View File

@ -47,6 +47,19 @@ BRIDGES = {
] ]
} }
'''
list the names of each system that should process unit to unit (individual) calls. Processing
is both ingress and egress.
'''
UNIT = ['ONE', 'TWO']
'''
This is for testing the syntax of the file. It won't eliminate all errors, but running this file
like it were a Python program itself will tell you if the syntax is correct!
'''
if __name__ == '__main__': if __name__ == '__main__':
from pprint import pprint from pprint import pprint
pprint(BRIDGES) pprint(BRIDGES)
print(UNIT)