Configs and tabs

pull/2/head
Rodrigo Pérez 2 years ago
parent eed7b8df5f
commit 66bd5f8420
No known key found for this signature in database
GPG Key ID: CF3FCD2E39162965

@ -447,7 +447,7 @@ class routerOBP(OPENBRIDGE):
logger.debug('(%s) Generating TX FULL and EMB LCs for HomeBrew destination: System: %s, TS: %s, TGID: %s', self._system, _target['SYSTEM'], _target['TS'], int_id(_target['TGID'])) logger.debug('(%s) Generating TX FULL and EMB LCs for HomeBrew destination: System: %s, TS: %s, TGID: %s', self._system, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
logger.info('(%s) Conference Bridge: %s, Call Bridged to HBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID'])) logger.info('(%s) Conference Bridge: %s, Call Bridged to HBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
if CONFIG['REPORTS']['REPORT']: if CONFIG['REPORTS']['REPORT']:
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore')) systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
# Set other values for the contention handler to test next time there is a frame to forward # Set other values for the contention handler to test next time there is a frame to forward
_target_status[_target['TS']]['TX_TIME'] = pkt_time _target_status[_target['TS']]['TX_TIME'] = pkt_time
@ -494,8 +494,8 @@ class routerOBP(OPENBRIDGE):
logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f', \ logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f', \
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, call_duration) 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, call_duration)
if CONFIG['REPORTS']['REPORT']: if CONFIG['REPORTS']['REPORT']:
self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore')) self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore'))
self.STATUS[_stream_id]['_fin'] = True self.STATUS[_stream_id]['_fin'] = True
#removed = self.STATUS.pop(_stream_id) #removed = self.STATUS.pop(_stream_id)
#logger.debug('(%s) OpenBridge sourced call stream end, remove terminated Stream ID: %s', self._system, int_id(_stream_id)) #logger.debug('(%s) OpenBridge sourced call stream end, remove terminated Stream ID: %s', self._system, int_id(_stream_id))
#if not removed: #if not removed:
@ -746,20 +746,20 @@ class routerHBP(HBSYSTEM):
# Is this a new call stream? # Is this a new call stream?
if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']): if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']):
# Record the DST TGID and Stream ID # Record the DST TGID and Stream ID
_target_status[_target['TS']]['TX_START'] = pkt_time _target_status[_target['TS']]['TX_START'] = pkt_time
_target_status[_target['TS']]['TX_TGID'] = _target['TGID'] _target_status[_target['TS']]['TX_TGID'] = _target['TGID']
_target_status[_target['TS']]['TX_STREAM_ID'] = _stream_id _target_status[_target['TS']]['TX_STREAM_ID'] = _stream_id
_target_status[_target['TS']]['TX_RFS'] = _rf_src _target_status[_target['TS']]['TX_RFS'] = _rf_src
_target_status[_target['TS']]['TX_PEER'] = _peer_id _target_status[_target['TS']]['TX_PEER'] = _peer_id
# Generate LCs (full and EMB) for the TX stream # Generate LCs (full and EMB) for the TX stream
dst_lc = self.STATUS[_slot]['RX_LC'][0:3] + _target['TGID'] + _rf_src dst_lc = self.STATUS[_slot]['RX_LC'][0:3] + _target['TGID'] + _rf_src
_target_status[_target['TS']]['TX_H_LC'] = bptc.encode_header_lc(dst_lc) _target_status[_target['TS']]['TX_H_LC'] = bptc.encode_header_lc(dst_lc)
_target_status[_target['TS']]['TX_T_LC'] = bptc.encode_terminator_lc(dst_lc) _target_status[_target['TS']]['TX_T_LC'] = bptc.encode_terminator_lc(dst_lc)
_target_status[_target['TS']]['TX_EMB_LC'] = bptc.encode_emblc(dst_lc) _target_status[_target['TS']]['TX_EMB_LC'] = bptc.encode_emblc(dst_lc)
logger.debug('(%s) Generating TX FULL and EMB LCs for HomeBrew destination: System: %s, TS: %s, TGID: %s', self._system, _target['SYSTEM'], _target['TS'], int_id(_target['TGID'])) logger.debug('(%s) Generating TX FULL and EMB LCs for HomeBrew destination: System: %s, TS: %s, TGID: %s', self._system, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
logger.info('(%s) Conference Bridge: %s, Call Bridged to HBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID'])) logger.info('(%s) Conference Bridge: %s, Call Bridged to HBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
if CONFIG['REPORTS']['REPORT']: if CONFIG['REPORTS']['REPORT']:
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore')) systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
# Set other values for the contention handler to test next time there is a frame to forward # Set other values for the contention handler to test next time there is a frame to forward
@ -811,7 +811,7 @@ class routerHBP(HBSYSTEM):
logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f', \ logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f', \
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, call_duration) 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, call_duration)
if CONFIG['REPORTS']['REPORT']: if CONFIG['REPORTS']['REPORT']:
self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore')) self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore'))
# #
# Begin in-band signalling for call end. This has nothign to do with routing traffic directly. # Begin in-band signalling for call end. This has nothign to do with routing traffic directly.

@ -149,7 +149,7 @@ def config_API(_config, _bridges):
application = Application([FD_API], application = Application([FD_API],
tns='freedmr.api', tns='adn.api',
in_protocol=HttpRpc(validator='soft'), in_protocol=HttpRpc(validator='soft'),
out_protocol=JsonDocument() out_protocol=JsonDocument()
) )
@ -189,7 +189,7 @@ def make_bridges(_rules):
else: else:
_system['TIMER'] = time() _system['TIMER'] = time()
# if _bridge[0:1] == '#': # if _bridge[0:1] == '#':
# continue # continue
for _confsystem in CONFIG['SYSTEMS']: for _confsystem in CONFIG['SYSTEMS']:
@ -507,10 +507,10 @@ def kaReporting():
if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE': if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE':
if CONFIG['SYSTEMS'][system]['ENHANCED_OBP']: if CONFIG['SYSTEMS'][system]['ENHANCED_OBP']:
if '_bcka' not in CONFIG['SYSTEMS'][system]: if '_bcka' not in CONFIG['SYSTEMS'][system]:
logger.warning('(ROUTER) not sending to system %s as KeepAlive never seen',system) logger.warning('(ROUTER) not sending to system %s as KeepAlive never seen',system)
elif CONFIG['SYSTEMS'][system]['_bcka'] < time() - 60: elif CONFIG['SYSTEMS'][system]['_bcka'] < time() - 60:
logger.warning('(ROUTER) not sending to system %s as last KeepAlive was %s seconds ago',system, int(time() - CONFIG['SYSTEMS'][system]['_bcka'])) logger.warning('(ROUTER) not sending to system %s as last KeepAlive was %s seconds ago',system, int(time() - CONFIG['SYSTEMS'][system]['_bcka']))
#Write SUB_MAP to disk #Write SUB_MAP to disk
def subMapWrite(): def subMapWrite():
try: try:
@ -535,7 +535,7 @@ def SubMapTrimmer():
SUB_MAP.pop(_remove) SUB_MAP.pop(_remove)
if CONFIG['ALIASES']['SUB_MAP_FILE']: if CONFIG['ALIASES']['SUB_MAP_FILE']:
subMapWrite() subMapWrite()
# run this every 10 seconds to trim stream ids # run this every 10 seconds to trim stream ids
def stream_trimmer_loop(): def stream_trimmer_loop():
@ -911,7 +911,7 @@ def options_config():
_options['OVERRIDE_IDENT_TG'] = _options.pop('VOICETG') _options['OVERRIDE_IDENT_TG'] = _options.pop('VOICETG')
if 'IDENT' in _options: if 'IDENT' in _options:
_options['VOICE'] = _options.pop('IDENT') _options['VOICE'] = _options.pop('IDENT')
#DMR+ style options #DMR+ style options
if 'StartRef' in _options: if 'StartRef' in _options:
_options['DEFAULT_REFLECTOR'] = _options.pop('StartRef') _options['DEFAULT_REFLECTOR'] = _options.pop('StartRef')
@ -1474,7 +1474,7 @@ class routerOBP(OPENBRIDGE):
if CONFIG['GLOBAL']['DATA_GATEWAY'] and 'DATA-GATEWAY' in CONFIG['SYSTEMS'] and CONFIG['SYSTEMS']['DATA-GATEWAY']['MODE'] == 'OPENBRIDGE' and CONFIG['SYSTEMS']['DATA-GATEWAY']['ENABLED']: if CONFIG['GLOBAL']['DATA_GATEWAY'] and 'DATA-GATEWAY' in CONFIG['SYSTEMS'] and CONFIG['SYSTEMS']['DATA-GATEWAY']['MODE'] == 'OPENBRIDGE' and CONFIG['SYSTEMS']['DATA-GATEWAY']['ENABLED']:
logger.debug('(%s) DATA packet sent to DATA-GATEWAY',self._system) logger.debug('(%s) DATA packet sent to DATA-GATEWAY',self._system)
self.sendDataToOBP('DATA-GATEWAY',_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_source_rptr,_ber,_rssi) self.sendDataToOBP('DATA-GATEWAY',_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_source_rptr,_ber,_rssi)
#Send other openbridges #Send other openbridges
for system in systems: for system in systems:
@ -1503,7 +1503,7 @@ class routerOBP(OPENBRIDGE):
else: else:
logger.debug('(%s) UNIT Data not bridged to HBP on slot 1 - target busy: %s DST_ID: %s',self._system,_d_system,_int_dst_id) logger.debug('(%s) UNIT Data not bridged to HBP on slot 1 - target busy: %s DST_ID: %s',self._system,_d_system,_int_dst_id)
else: else:
#If destination ID is logged in as a hotspot #If destination ID is logged in as a hotspot
for _d_system in systems: for _d_system in systems:
@ -1593,8 +1593,8 @@ class routerOBP(OPENBRIDGE):
#LoopControl #LoopControl
hr_times = {} hr_times = {}
for system in systems: for system in systems:
# if system == self._system: # if system == self._system:
# continue # continue
if system != self._system and CONFIG['SYSTEMS'][system]['MODE'] != 'OPENBRIDGE': if system != self._system and CONFIG['SYSTEMS'][system]['MODE'] != 'OPENBRIDGE':
for _sysslot in systems[system].STATUS: for _sysslot in systems[system].STATUS:
if 'RX_STREAM_ID' in systems[system].STATUS[_sysslot] and _stream_id == systems[system].STATUS[_sysslot]['RX_STREAM_ID']: if 'RX_STREAM_ID' in systems[system].STATUS[_sysslot] and _stream_id == systems[system].STATUS[_sysslot]['RX_STREAM_ID']:
@ -1606,7 +1606,7 @@ class routerOBP(OPENBRIDGE):
else: else:
#if _stream_id in systems[system].STATUS and systems[system].STATUS[_stream_id]['START'] <= self.STATUS[_stream_id]['START']: #if _stream_id in systems[system].STATUS and systems[system].STATUS[_stream_id]['START'] <= self.STATUS[_stream_id]['START']:
if _stream_id in systems[system].STATUS and '1ST' in systems[system].STATUS[_stream_id] and systems[system].STATUS[_stream_id]['TGID'] == _dst_id: if _stream_id in systems[system].STATUS and '1ST' in systems[system].STATUS[_stream_id] and systems[system].STATUS[_stream_id]['TGID'] == _dst_id:
hr_times[system] = systems[system].STATUS[_stream_id]['1ST'] hr_times[system] = systems[system].STATUS[_stream_id]['1ST']
#use the minimum perf_counter to ensure #use the minimum perf_counter to ensure
#We always use only the earliest packet #We always use only the earliest packet
@ -1671,7 +1671,7 @@ class routerOBP(OPENBRIDGE):
self.STATUS[_stream_id]['lastSeq'] = _seq self.STATUS[_stream_id]['lastSeq'] = _seq
#Save this packet #Save this packet
self.STATUS[_stream_id]['lastData'] = _data self.STATUS[_stream_id]['lastData'] = _data
self.STATUS[_stream_id]['crcs'].add(_pkt_crc) self.STATUS[_stream_id]['crcs'].add(_pkt_crc)
@ -1704,9 +1704,9 @@ class routerOBP(OPENBRIDGE):
logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f, Packet rate: %.2f/s, Loss: %.2f%%', \ logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f, Packet rate: %.2f/s, Loss: %.2f%%', \
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, call_duration, packet_rate,loss) 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, call_duration, packet_rate,loss)
if CONFIG['REPORTS']['REPORT']: if CONFIG['REPORTS']['REPORT']:
self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore')) self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore'))
self.STATUS[_stream_id]['_fin'] = True self.STATUS[_stream_id]['_fin'] = True
self.STATUS[_stream_id]['lastSeq'] = False self.STATUS[_stream_id]['lastSeq'] = False
class routerHBP(HBSYSTEM): class routerHBP(HBSYSTEM):
@ -1949,7 +1949,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,b'',_ber,_rssi,_source_server, _source_rptr) systems[_target['SYSTEM']].send_system(_tmp_data,b'',_ber,_rssi,_source_server, _source_rptr)
return _sysIgnore return _sysIgnore
def sendDataToHBP(self,_d_system,_d_slot,_dst_id,_tmp_bits,_data,dmrpkt,_rf_src,_stream_id,_peer_id): def sendDataToHBP(self,_d_system,_d_slot,_dst_id,_tmp_bits,_data,dmrpkt,_rf_src,_stream_id,_peer_id):
@ -1963,7 +1963,7 @@ class routerHBP(HBSYSTEM):
systems[_d_system]._report.send_bridgeEvent('UNIT DATA,DATA,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')) systems[_d_system]._report.send_bridgeEvent('UNIT DATA,DATA,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'',_ber = b'\x00', _rssi = b'\x00',_source_server = b'\x00\x00\x00\x00', _source_rptr = b'\x00\x00\x00\x00'): def sendDataToOBP(self,_target,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_hops = b'',_ber = b'\x00', _rssi = b'\x00',_source_server = b'\x00\x00\x00\x00', _source_rptr = b'\x00\x00\x00\x00'):
# _sysIgnore = sysIgnore # _sysIgnore = sysIgnore
_source_server = self._CONFIG['GLOBAL']['SERVER_ID'] _source_server = self._CONFIG['GLOBAL']['SERVER_ID']
_source_rptr = _peer_id _source_rptr = _peer_id
_int_dst_id = int_id(_dst_id) _int_dst_id = int_id(_dst_id)
@ -2059,14 +2059,14 @@ class routerHBP(HBSYSTEM):
#_bits = header(_slot,'unit',_bits) #_bits = header(_slot,'unit',_bits)
#logger.info('(%s) Type Rewrite - GPS data from ID: %s, on TG 900999 rewritten to unit call to ID 900999 : bits %s',self._system,int_id(_rf_src),_bits) #logger.info('(%s) Type Rewrite - GPS data from ID: %s, on TG 900999 rewritten to unit call to ID 900999 : bits %s',self._system,int_id(_rf_src),_bits)
#_call_type == 'unit' #_call_type == 'unit'
#Rewrite incoming loro request to group call #Rewrite incoming loro request to group call
#if _call_type == 'unit' and _int_dst_id == 9990: #if _call_type == 'unit' and _int_dst_id == 9990:
#_bits = header(_slot,'group',_bits) #_bits = header(_slot,'group',_bits)
#logger.info('(%s) Type Rewrite - Echo data from ID: %s, on PC 9990 rewritten to group call to TG 9990',self._system,int_id(_rf_src)) #logger.info('(%s) Type Rewrite - Echo data from ID: %s, on PC 9990 rewritten to group call to TG 9990',self._system,int_id(_rf_src))
#_call_type == 'group' #_call_type == 'group'
if _call_type == 'unit' and (_dtype_vseq == 6 or _dtype_vseq == 7 or _dtype_vseq == 8 or (_stream_id != self.STATUS[_slot]['RX_STREAM_ID'] and _dtype_vseq == 3)): if _call_type == 'unit' and (_dtype_vseq == 6 or _dtype_vseq == 7 or _dtype_vseq == 8 or (_stream_id != self.STATUS[_slot]['RX_STREAM_ID'] and _dtype_vseq == 3)):
_data_call = True _data_call = True
@ -2145,7 +2145,7 @@ class routerHBP(HBSYSTEM):
else: else:
logger.debug('(%s) UNIT Data not bridged to HBP on slot %s - target busy: %s DST_ID: %s',self._system,_d_slot,_d_system,_int_dst_id) logger.debug('(%s) UNIT Data not bridged to HBP on slot %s - target busy: %s DST_ID: %s',self._system,_d_slot,_d_system,_int_dst_id)
else: else:
#If destination ID is logged in as a hotspot #If destination ID is logged in as a hotspot
for _d_system in systems: for _d_system in systems:
@ -2174,7 +2174,7 @@ class routerHBP(HBSYSTEM):
#Handle AMI private calls #Handle AMI private calls
if _call_type == 'unit' and not _data_call and self.STATUS[_slot]['_allStarMode'] and CONFIG['ALLSTAR']['ENABLED']: if _call_type == 'unit' and not _data_call and self.STATUS[_slot]['_allStarMode'] and CONFIG['ALLSTAR']['ENABLED']:
if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']): if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']):
logger.info('(%s) AMI: Private call from %s to %s',self._system, int_id(_rf_src), _int_dst_id) logger.info('(%s) AMI: Private call from %s to %s',self._system, int_id(_rf_src), _int_dst_id)
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):
@ -2302,8 +2302,8 @@ class routerHBP(HBSYSTEM):
logger.info('(%s) Reflector: voice called - 4000 "not linked"', self._system) logger.info('(%s) Reflector: voice called - 4000 "not linked"', self._system)
_say.append(words[_lang]['notlinked']) _say.append(words[_lang]['notlinked'])
_say.append(words[_lang]['silence']) _say.append(words[_lang]['silence'])
#If status called #If status called
elif _int_dst_id == 5000: elif _int_dst_id == 5000:
_active = False _active = False
for _bridge in BRIDGES: for _bridge in BRIDGES:
@ -2350,7 +2350,7 @@ class routerHBP(HBSYSTEM):
for num in str(_int_dst_id): for num in str(_int_dst_id):
_say.append(words[_lang][num]) _say.append(words[_lang][num])
if _say: if _say:
speech = pkt_gen(bytes_3(5000), _nine, bytes_4(9), 1, _say) speech = pkt_gen(bytes_3(5000), _nine, bytes_4(9), 1, _say)
#call speech in a thread as it contains sleep() and hence could block the reactor #call speech in a thread as it contains sleep() and hence could block the reactor
@ -2501,7 +2501,7 @@ class routerHBP(HBSYSTEM):
self.STATUS[_slot]['lastSeq'] = _seq self.STATUS[_slot]['lastSeq'] = _seq
#Save this packet #Save this packet
self.STATUS[_slot]['lastData'] = _data self.STATUS[_slot]['lastData'] = _data
_sysIgnore = deque() _sysIgnore = deque()
for _bridge in BRIDGES: for _bridge in BRIDGES:
#if _bridge[0:1] != '#': #if _bridge[0:1] != '#':
@ -2529,7 +2529,7 @@ class routerHBP(HBSYSTEM):
logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f, Packet rate: %.2f/s, LOSS: %.2f%%', \ logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f, Packet rate: %.2f/s, LOSS: %.2f%%', \
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, call_duration, packet_rate, loss) 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, call_duration, packet_rate, loss)
if CONFIG['REPORTS']['REPORT']: if CONFIG['REPORTS']['REPORT']:
self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore')) self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore'))
#Reset back to False #Reset back to False
self.STATUS[_slot]['lastSeq'] = False self.STATUS[_slot]['lastSeq'] = False
@ -2904,7 +2904,7 @@ if __name__ == '__main__':
words[lang][_mapword] = words[lang][_map[_mapword]] words[lang][_mapword] = words[lang][_map[_mapword]]
# HBlink instance creation # HBlink instance creation
logger.info('(GLOBAL) FreeDMR \'bridge_master.py\' -- SYSTEM STARTING...') logger.info('(GLOBAL) ADN \'bridge_master.py\' -- SYSTEM STARTING...')
listeningPorts = {} listeningPorts = {}
@ -2958,7 +2958,7 @@ if __name__ == '__main__':
stream_trimmer_task = task.LoopingCall(stream_trimmer_loop) stream_trimmer_task = task.LoopingCall(stream_trimmer_loop)
stream_trimmer = stream_trimmer_task.start(5) stream_trimmer = stream_trimmer_task.start(5)
stream_trimmer.addErrback(loopingErrHandle) stream_trimmer.addErrback(loopingErrHandle)
# Ident # Ident
#This runs in a thread so as not to block the reactor #This runs in a thread so as not to block the reactor
ident_task = task.LoopingCall(threadIdent) ident_task = task.LoopingCall(threadIdent)

@ -169,7 +169,7 @@ def build_config(_config_file):
'LOG_FILE': config.get(section, 'LOG_FILE', fallback='/dev/null'), 'LOG_FILE': config.get(section, 'LOG_FILE', fallback='/dev/null'),
'LOG_HANDLERS': config.get(section, 'LOG_HANDLERS', fallback='console-timed'), 'LOG_HANDLERS': config.get(section, 'LOG_HANDLERS', fallback='console-timed'),
'LOG_LEVEL': config.get(section, 'LOG_LEVEL', fallback='INFO'), 'LOG_LEVEL': config.get(section, 'LOG_LEVEL', fallback='INFO'),
'LOG_NAME': config.get(section, 'LOG_NAME', fallback='FreeDMR') 'LOG_NAME': config.get(section, 'LOG_NAME', fallback='ADN')
}) })
@ -406,7 +406,7 @@ if __name__ == '__main__':
# CLI argument parser - handles picking up the config file from the command line, and sending a "help" message # CLI argument parser - handles picking up the config file from the command line, and sending a "help" message
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', action='store', dest='CONFIG_FILE', help='/full/path/to/config.file (usually freedmr.cfg)') parser.add_argument('-c', '--config', action='store', dest='CONFIG_FILE', help='/full/path/to/config.file (usually adn.cfg)')
cli_args = parser.parse_args() cli_args = parser.parse_args()

@ -329,7 +329,7 @@ class Proxy(DatagramProtocol):
if data[8:].upper().startswith(b"PASS="): if data[8:].upper().startswith(b"PASS="):
_psswd = data[13:] _psswd = data[13:]
if len(_psswd) >= 6: if len(_psswd) >= 6:
dk = pbkdf2_hmac("sha256", _psswd, b"FreeDMR", 2000).hex() dk = pbkdf2_hmac("sha256", _psswd, b"ADN", 2000).hex()
self.db_proxy.updt_tbl("psswd", _peer_id, psswd=dk) self.db_proxy.updt_tbl("psswd", _peer_id, psswd=dk)
self.transport.write(b"".join([RPTACK, _peer_id]), addr) self.transport.write(b"".join([RPTACK, _peer_id]), addr)
print(f"Password stored for: {int_id(_peer_id)}") print(f"Password stored for: {int_id(_peer_id)}")
@ -454,7 +454,7 @@ if __name__ == "__main__":
"--config", "--config",
action="store", action="store",
dest="CONFIG_FILE", dest="CONFIG_FILE",
help="/full/path/to/config.file (usually freedmr.cfg)", help="/full/path/to/config.file (usually adn.cfg)",
) )
cli_args = parser.parse_args() cli_args = parser.parse_args()

@ -301,7 +301,7 @@ if __name__ == '__main__':
# CLI argument parser - handles picking up the config file from the command line, and sending a "help" message # CLI argument parser - handles picking up the config file from the command line, and sending a "help" message
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', action='store', dest='CONFIG_FILE', help='/full/path/to/config.file (usually freedmr.cfg)') parser.add_argument('-c', '--config', action='store', dest='CONFIG_FILE', help='/full/path/to/config.file (usually adn.cfg)')
cli_args = parser.parse_args() cli_args = parser.parse_args()

@ -115,7 +115,7 @@ voiceMap = {
'en_US': { 'en_US': {
'to': '2', 'to': '2',
'freedmr': 'silence', 'adn': 'silence',
'this-is': 'silence', 'this-is': 'silence',
'allstar-link-mode': 'alpha' 'allstar-link-mode': 'alpha'
}, },
@ -269,7 +269,7 @@ voiceMap = {
'dk_DK': { 'dk_DK': {
'to': 'silence', 'to': 'silence',
'freedmr': 'silence', 'adn': 'silence',
'this-is': 'silence', 'this-is': 'silence',
'allstar-link-mode': 'A' 'allstar-link-mode': 'A'
@ -277,35 +277,35 @@ voiceMap = {
'it_IT': { 'it_IT': {
'to': 'silence', 'to': 'silence',
'freedmr': 'silence', 'adn': 'silence',
'this-is': 'silence', 'this-is': 'silence',
'allstar-link-mode': 'A' 'allstar-link-mode': 'A'
}, },
'no_NO': { 'no_NO': {
'to': 'silence', 'to': 'silence',
'freedmr': 'silence', 'adn': 'silence',
'this-is': 'silence', 'this-is': 'silence',
'allstar-link-mode': 'A' 'allstar-link-mode': 'A'
}, },
'pl_PL': { 'pl_PL': {
'to': 'silence', 'to': 'silence',
'freedmr': 'silence', 'adn': 'silence',
'this-is': 'silence', 'this-is': 'silence',
'allstar-link-mode': 'A' 'allstar-link-mode': 'A'
}, },
'se_SE': { 'se_SE': {
'to': 'silence', 'to': 'silence',
'freedmr': 'silence', 'adn': 'silence',
'this-is': 'silence', 'this-is': 'silence',
'allstar-link-mode': 'A' 'allstar-link-mode': 'A'
}, },
'CW': { 'CW': {
'to': 'silence', 'to': 'silence',
'freedmr': 'silence', 'adn': 'silence',
'this-is': 'silence', 'this-is': 'silence',
'linkedto': 'silence', 'linkedto': 'silence',
'allstar-link-mode': 'T' 'allstar-link-mode': 'T'

@ -270,7 +270,7 @@ if __name__ == '__main__':
report_server = config_reports(CONFIG, reportFactory) report_server = config_reports(CONFIG, reportFactory)
# HBlink instance creation # HBlink instance creation
logger.info('FreeDMR \'playback_file.py\' (c) 2022 Simon Adlem based on work from 2017-2019 Cort Buffington, N0MJS & Mike Zingman, N4IRR -- SYSTEM STARTING...') logger.info('ADN \'playback_file.py\' (c) 2022 Simon Adlem based on work from 2017-2019 Cort Buffington, N0MJS & Mike Zingman, N4IRR -- SYSTEM STARTING...')
for system in CONFIG['SYSTEMS']: for system in CONFIG['SYSTEMS']:
if CONFIG['SYSTEMS'][system]['ENABLED']: if CONFIG['SYSTEMS'][system]['ENABLED']:
if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE': if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE':

@ -16,7 +16,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################### ###############################################################################
#This is example code to connect to the report service in FreeDMR / HBLink3 #This is example code to connect to the report service in ADN / HBLink3
#It can be used as a skeleton to build logging and monitoring tools. #It can be used as a skeleton to build logging and monitoring tools.
import pickle import pickle

@ -24,7 +24,7 @@ __license__ = 'GNU GPLv3'
__maintainer__ = 'Simon Adlem G7RZU' __maintainer__ = 'Simon Adlem G7RZU'
__email__ = 'simon@gb7fr.org.uk' __email__ = 'simon@gb7fr.org.uk'
#This is example code to connect to the report service in FreeDMR / HBLink3 #This is example code to connect to the report service in ADN / HBLink3
#It can be used as a skeleton to build logging and monitoring tools. #It can be used as a skeleton to build logging and monitoring tools.
import pickle import pickle

@ -1,7 +1,7 @@
''' '''
THIS EXAMPLE WILL NOT WORK AS IT IS - YOU MUST SPECIFY YOUR OWN VALUES!!! THIS EXAMPLE WILL NOT WORK AS IT IS - YOU MUST SPECIFY YOUR OWN VALUES!!!
In FreeDMR, the rules file should be *empty* unless you have static routing required. Please see the In ADN, the rules file should be *empty* unless you have static routing required. Please see the
documentation for more details. documentation for more details.
This file is organized around the "Conference Bridges" that you wish to use. If you're a c-Bridge This file is organized around the "Conference Bridges" that you wish to use. If you're a c-Bridge

@ -0,0 +1,11 @@
[Unit]
Description= ADN DMR Repeaters Service
After=syslog.target network.target
[Service]
User=root
WorkingDirectory=/opt/adn
ExecStart=/usr/bin/python3 bridge_master.py -c ./config/adn.cfg -r ./config/rules.py
[Install]
WantedBy=multi-user.target

@ -1,25 +0,0 @@
[Unit]
Description= FreeDMR Repeaters Service
After=syslog.target network.target
[Service]
User=root
WorkingDirectory=/opt/FreeDMR
ExecStart=/usr/bin/python3 bridge_master.py -c ./config/hblink.cfg -r ./config/rules.py
[Install]
WantedBy=multi-user.target

@ -20,7 +20,7 @@
#Some utilty functions from dmr_utils3 have been modified. These live here. #Some utilty functions from dmr_utils3 have been modified. These live here.
# Also new FreeDMR specific functions. # Also new ADN specific functions.
import ssl import ssl
from time import time from time import time

Loading…
Cancel
Save

Powered by TurnKey Linux.