Squashed commit of the following:

commit 650ac29dc4
Author: Simon <simon@gb7fr.org.uk>
Date:   Wed Nov 10 00:42:48 2021 +0000

    Allow both slots for PC to a peer-connected D-APRS server

commit 6ba9c40c58
Author: Simon <simon@gb7fr.org.uk>
Date:   Wed Nov 10 00:38:45 2021 +0000

    bits

commit 34a8aaf1d2
Author: Simon <simon@gb7fr.org.uk>
Date:   Wed Nov 10 00:14:14 2021 +0000

    slot2

commit 01aa95e65b
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Nov 9 23:49:28 2021 +0000

    debug 900999

commit 067e598ae0
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Nov 9 23:38:04 2021 +0000

    indent

commit 716935cb4c
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Nov 9 23:37:04 2021 +0000

    route D-APRS ID 900999 via master connection if D-APRS system exists

commit ab0fc7c108
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Nov 9 23:02:32 2021 +0000

    perform slot rewrites on unit data calls

commit d5c4315dcb
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Nov 9 22:37:20 2021 +0000

    we need to recognise slot1 PC too

commit 67e397c523
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Nov 9 12:37:55 2021 +0000

    output bit pattern

commit 03b2316771
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Nov 9 00:36:20 2021 +0000

    remove txtime updating for data calls

commit 0de4a503cb
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 23:11:13 2021 +0000

    remove txtime updating for data calls

commit db802ce3a1
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 23:03:53 2021 +0000

    more testing stuffyta

commit 339ad578a3
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 22:50:27 2021 +0000

    more testing stuffyt

commit c8b0e5bceb
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 22:49:34 2021 +0000

    more testing stuffy

commit 3559a16fd1
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 22:48:46 2021 +0000

    more testing stuff

commit 766485a50a
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 22:34:52 2021 +0000

    s 2

commit 4060bd3946
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 22:32:08 2021 +0000

    d_system again

commit f3fc33f538
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 22:30:43 2021 +0000

    fixy fixy

commit 741cd87834
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 22:19:50 2021 +0000

    kk

commit f3b44af9d9
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 19:40:47 2021 +0000

    kk

commit 48fffecd26
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 19:15:52 2021 +0000

    typo

commit 21486b55c7
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 19:15:14 2021 +0000

    dd

commit 024af2d458
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 19:12:18 2021 +0000

    d

commit 2f1df72994
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 19:02:34 2021 +0000

    add more debug, slice ID as string

commit 7a0744e839
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 18:57:39 2021 +0000

    fix bug in hs, log sub_map fo test

commit 9738020e21
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 18:21:24 2021 +0000

    test ID in SUB_MAP

commit 10d1c06303
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 17:53:33 2021 +0000

    only try hotspot ID when SUB_MAP not matched. Some fixes in logging

commit cad82c4cfe
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 01:34:50 2021 +0000

    lvkbl

commit 8c24f39a5e
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 01:32:48 2021 +0000

    system

commit f9e7416f6d
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Nov 8 01:28:16 2021 +0000

    Send data to system if logged in with destination ID

commit 44d93c7691
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 23:08:30 2021 +0000

    remiove

commit eb7e091796
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 20:20:35 2021 +0000

    sub map trimmer loop - correction

commit a27f5172ab
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 20:18:40 2021 +0000

    sub map trimmer loop

commit f32f372bbb
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 17:48:13 2021 +0000

    indent

commit e5d510b55e
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 17:47:33 2021 +0000

    typo

commit d283aa7b6b
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 17:46:58 2021 +0000

    typo

commit 48b7c0e05d
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 17:45:13 2021 +0000

    more logging corrections

commit 6fb9f57f95
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 14:30:02 2021 +0000

    remove slot rewrite

commit 3ed13d56a3
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 14:25:45 2021 +0000

    _d_system

commit d4979fa40e
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 14:24:09 2021 +0000

    d_system

commit 56de60dd07
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 14:22:00 2021 +0000

    duh

commit ef9e68b1e8
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 14:01:44 2021 +0000

    duh

commit a11e284249
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 14:00:01 2021 +0000

    log SUB_MAP

commit b855b204e6
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 13:35:30 2021 +0000

    more logging...

commit 5cd474dff7
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 13:33:14 2021 +0000

    more logging

commit baea91905f
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 13:23:34 2021 +0000

    boing

commit 738286c495
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Nov 7 12:35:56 2021 +0000

    add login for SUB_MAP hits

commit 41228f4589
Author: Simon <simon@gb7fr.org.uk>
Date:   Sat Nov 6 21:33:34 2021 +0000

    d_system

commit cd4b0444c6
Author: Simon <simon@gb7fr.org.uk>
Date:   Sat Nov 6 21:29:50 2021 +0000

    rf src

commit a186cd233c
Author: Simon <simon@gb7fr.org.uk>
Date:   Sat Nov 6 21:27:33 2021 +0000

    dst_id

commit 1684d7d7c3
Author: Simon <simon@gb7fr.org.uk>
Date:   Sat Nov 6 21:25:47 2021 +0000

    use correct ID for SUB_MAP

commit 0102d9dad5
Author: Simon <simon@gb7fr.org.uk>
Date:   Sat Nov 6 21:20:48 2021 +0000

    Add first support for SUB_MAP and sending data calls to HBP.

commit 4e81176a92
Author: Simon <simon@gb7fr.org.uk>
Date:   Sat Nov 6 13:49:51 2021 +0000

    Start work on unit data to other HBP systems

commit d6b6712889
Author: Simon <simon@gb7fr.org.uk>
Date:   Sat Nov 6 13:26:24 2021 +0000

    Tidy up and remove some commented lines
kf7eel-inc
Simon 4 years ago
parent f1066168eb
commit 60d99523f3

@ -377,6 +377,19 @@ def kaReporting():
logger.warning('(ROUTER) not sending to system %s as KeepAlive never seen',system)
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']))
#Subscriber Map trimmer loop
def SubMapTrimmer():
logger.debug('(SUBSCRIBER) Subscriber Map trimmer loop started')
_sub_time = time()
_remove_list = []
for _subscriber in SUB_MAP:
if _subscriber[2] < (_sub_time - 86400):
_remove_list.append(_subscriber)
for _remove in _remove_list:
SUB_MAP.pop(_remove)
# run this every 10 seconds to trim stream ids
def stream_trimmer_loop():
@ -1518,7 +1531,6 @@ class routerOBP(OPENBRIDGE):
if CONFIG['SYSTEMS'][self._system]['ENHANCED_OBP'] and '_bcsq' not in self.STATUS[_stream_id]:
systems[self._system].send_bcsq(_dst_id,_stream_id)
#logger.warning("(%s) OBP *BridgeControl* Sent BCSQ , STREAM ID: %s, TG %s",self._system, int_id(_stream_id), int_id(_dst_id))
self.STATUS[_stream_id]['_bcsq'] = True
return
@ -1557,8 +1569,6 @@ class routerOBP(OPENBRIDGE):
_sysIgnore = []
for _bridge in BRIDGES:
#if _bridge[0:1] != '#':
#if True:
for _system in BRIDGES[_bridge]:
if _system['SYSTEM'] == self._system and _system['TGID'] == _dst_id and _system['TS'] == _slot and _system['ACTIVE'] == True:
@ -1573,12 +1583,7 @@ class routerOBP(OPENBRIDGE):
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.STATUS[_stream_id]['_fin'] = True
#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))
#if not removed:
#selflogger.error('(%s) *CALL END* STREAM ID: %s NOT IN LIST -- THIS IS A REAL PROBLEM', self._system, int_id(_stream_id))
#Reset sequence number
self.STATUS[_stream_id]['lastSeq'] = False
class routerHBP(HBSYSTEM):
@ -1667,7 +1672,6 @@ class routerHBP(HBSYSTEM):
#If target has quenched us, don't send
if ('_bcsq' in _target_system) and (_dst_id in _target_system['_bcsq']) and (_target_system['_bcsq'][_target['TGID']] == _stream_id):
#logger.info('(%s) Conference Bridge: %s, is Source Quenched for Stream ID: %s, skipping system: %s TS: %s, TGID: %s', self._system, _bridge, int_id(_stream_id), _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
continue
#If target has missed 6 (on 1 min) of keepalives, don't send
@ -1677,12 +1681,10 @@ class routerHBP(HBSYSTEM):
#If talkgroup is prohibited by ACL
if self._CONFIG['GLOBAL']['USE_ACL']:
if not acl_check(_target['TGID'],self._CONFIG['GLOBAL']['TG1_ACL']):
#logger.info('(%s) TGID prohibited by ACL, not sending', _target['SYSTEM'])
continue
if _target_system['USE_ACL']:
if not acl_check(_target['TGID'],_target_system['TG1_ACL']):
#logger.info('(%s) TGID prohibited by ACL, not sending', _target['SYSTEM'])
continue
@ -1818,7 +1820,7 @@ class routerHBP(HBSYSTEM):
# Transmit the packet to the destination system
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']))
return _sysIgnore
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data):
@ -1835,28 +1837,13 @@ class routerHBP(HBSYSTEM):
# Assume this is not a data call. We use this to prevent SMS/GPS data from triggering a reflector.
_data_call = False
_voice_call = False
## print(self._system)
## print(UNIT_MAP)
# Make/update an entry in the UNIT_MAP for this subscriber
#UNIT_MAP[_rf_src] = (self._system, pkt_time)
## print()
## print(_call_type)
## print(_dtype_vseq)
## print(_frame_type)
## print(_stream_id)
## print(_seq)
## print(ahex(dmrpkt))
## if _dtype_vseq == 3:
## print(ahex(dmrpkt)[27:-27])
## print()
# Filter out SMS/GPS. Usually _dtype_vseq of 3, 6, and 7.
#logger.info('(%s) DBG Data call: dtype_vseq %s, src_id: %s, dst_id: %s, call_type: %s, stream_id: %s',self._system, _dtype_vseq, int_id(_rf_src), _int_dst_id, _call_type,int_id(_stream_id))
##
#Add system to SUB_MAP
SUB_MAP[_rf_src] = (self._system,_slot,pkt_time)
if _call_type == 'unit' and (_dtype_vseq == 6 or _dtype_vseq == 7 or (_stream_id != self.STATUS[_slot]['RX_STREAM_ID'] and _dtype_vseq == 3)):
## if ahex(dmrpkt)[27:-27] == b'd5d7f77fd757':
# This is a data call
_data_call = True
if _dtype_vseq == 3:
logger.info('(%s) *UNIT CSBK* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) DST_ID %s (%s), TS %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)
@ -1921,19 +1908,93 @@ class routerHBP(HBSYSTEM):
logger.warning('(%s) UNIT Data not Bridged - DATA_GATEWAY: %s not valid. DST_ID: %s',self._system, CONFIG['GLOBAL']['DATA_GATEWAY'],_int_dst_id)
elif CONFIG['SYSTEMS'][CONFIG['GLOBAL']['DATA_GATEWAY']]['MODE'] != 'OPENBRIDGE':
logger.warning('(%s) UNIT Data not Bridged - DATA_GATEWAY: %s not OPENBRIDGE. DST_ID: %s',self._system, CONFIG['GLOBAL']['DATA_GATEWAY'],_int_dst_id)
#If destination ID is in the Subscriber Map
if _dst_id in SUB_MAP:
(_d_system,_d_slot,_d_time) = SUB_MAP[_dst_id]
_dst_slot = systems[_d_system].STATUS[_d_slot]
logger.info('(%s) SUB_MAP matched, System: %s Slot: %s, Time: %s',self._system, _d_system,_d_slot,_d_time)
#If slot is idle for RX and TX
if (_dst_slot['RX_TYPE'] == HBPF_SLT_VTERM) and (_dst_slot['TX_TYPE'] == HBPF_SLT_VTERM) and (time() - _dst_slot['TX_TIME'] > CONFIG['SYSTEMS'][_d_system]['GROUP_HANGTIME']):
#rewrite slot if required
if _slot != _d_slot:
_tmp_bits = _bits ^ 1 << 7
else:
_tmp_bits = _bits
#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[_d_system].send_system(_tmp_data)
logger.info('(%s) UNIT Data Bridged to HBP on slot 1: %s DST_ID: %s',self._system,_d_system,_int_dst_id)
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'))
#_dst_slot['TX_TIME'] = pkt_time
else:
logger.info('(%s) UNIT Data not bridged to HBP on slot 1 - target busy: %s DST_ID: %s',self._system,_d_system,_int_dst_id)
elif _int_dst_id == 900999:
if 'D-APRS' in systems and CONFIG['SYSTEMS']['D-APRS']['MODE'] == 'MASTER':
_d_system = 'D-APRS'
_dst_slot = systems['D-APRS'].STATUS[2]
logger.info('(%s) D-APRS ID matched, System: %s Slot: 2',self._system, _d_system)
#If slot is idle for RX and TX
if (_dst_slot['RX_TYPE'] == HBPF_SLT_VTERM) and (_dst_slot['TX_TYPE'] == HBPF_SLT_VTERM) and (time() - _dst_slot['TX_TIME'] > CONFIG['SYSTEMS'][_d_system]['GROUP_HANGTIME']):
#We will allow the system to use both slots
_tmp_bits = _bits
#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[_d_system].send_system(_tmp_data)
logger.info('(%s) UNIT Data Bridged to HBP on slot: %s DST_ID: %s',self._system,_d_system,_int_dst_id)
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'))
#_dst_slot['TX_TIME'] = pkt_time
else:
logger.info('(%s) UNIT Data not bridged to HBP on slot 1 - target busy: %s DST_ID: %s',self._system,_d_system,_int_dst_id)
else:
#If destination ID is logged in as a hotspot
for _d_system in systems:
if CONFIG['SYSTEMS'][_d_system]['MODE'] == 'MASTER':
for _to_peer in CONFIG['SYSTEMS'][_d_system]['PEERS']:
_int_to_peer = int_id(_to_peer)
if (str(_int_to_peer)[:7] == str(_int_dst_id)[:7]):
#(_d_system,_d_slot,_d_time) = SUB_MAP[_dst_id]
_d_slot = _slot
_dst_slot = systems[_d_system].STATUS[_d_slot]
logger.info('(%s) User Peer Hotspot ID matched, System: %s Slot: %s',self._system, _d_system,_d_slot)
#If slot is idle for RX and TX
if (_dst_slot['RX_TYPE'] == HBPF_SLT_VTERM) and (_dst_slot['TX_TYPE'] == HBPF_SLT_VTERM) and (time() - _dst_slot['TX_TIME'] > CONFIG['SYSTEMS'][_d_system]['GROUP_HANGTIME']):
#Always use slot2 for hotspots - many of them are simplex and this
#is the convention
#rewrite slot if required (slot 2 is used on hotspots)
if _slot != 2:
_tmp_bits = _bits ^ 1 << 7
else:
_tmp_bits = _bits
#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[_d_system].send_system(_tmp_data)
logger.info('(%s) UNIT Data Bridged to HBP on slot: %s DST_ID: %s',self._system,_d_system,_int_dst_id)
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'))
#_dst_slot['TX_TIME'] = pkt_time
else:
logger.info('(%s) UNIT Data not bridged to HBP on slot 1 - target busy: %s DST_ID: %s',self._system,_d_system,_int_dst_id)
#Handle private calls (for reflectors)
if _call_type == 'unit' and _slot == 2 and not _data_call:
#Handle private voice calls (for reflectors)
if _call_type == 'unit' and not _data_call:
if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']):
self.STATUS[_slot]['_stopTgAnnounce'] = False
logger.warning('(%s) Reflector: Private call from %s to %s',self._system, int_id(_rf_src), _int_dst_id)
#if _int_dst_id >= 4000 and _int_dst_id <= 5000:
if _int_dst_id >= 5 and _int_dst_id != 9 and _int_dst_id <= 999999:
_bridgename = '#'+ str(_int_dst_id)
if _bridgename not in BRIDGES and not (_int_dst_id >= 4000 and _int_dst_id <= 5000) and not (_int_dst_id >=9991 and _int_dst_id <= 9999):
@ -1974,7 +2035,6 @@ class routerHBP(HBSYSTEM):
# Set the matching rule as ACTIVE
#Single TG mode
if _dst_id in _system['OFF'] or _int_dst_id != int(_dehash_bridge) :
#if _dst_id in _system['OFF']:
if _system['ACTIVE'] == True:
_system['ACTIVE'] = False
logger.info('(%s) [F] Reflector: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE'])
@ -1994,14 +2054,8 @@ class routerHBP(HBSYSTEM):
if (_frame_type == HBPF_DATA_SYNC) and (_dtype_vseq == HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != HBPF_SLT_VTERM):
#Speak callsign before message
_say = [words[_lang]['silence']]
# _systemcs = re.sub(r'\W+', '', self._system)
# _systemcs.upper()
# for character in _systemcs:
# _say.append(words[character])
# _say.append(words['silence'])
if _int_dst_id <= 5 or _int_dst_id == 9:
logger.info('(%s) Reflector: voice called - TG < 5 or 9 - "busy""', self._system)
_say.append(words[_lang]['busy'])
@ -2149,7 +2203,6 @@ class routerHBP(HBSYSTEM):
self.STATUS[_slot]['LAST'] = pkt_time
return
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 '1ST' in systems[system].STATUS[_stream_id] and systems[system].STATUS[_stream_id]['TGID'] == _dst_id:
if 'LOOPLOG' not in self.STATUS[_slot] or not self.STATUS[_slot]['LOOPLOG']:
logger.info("(%s) OBP *LoopControl* FIRST OBP %s, STREAM ID: %s, TG %s, IGNORE THIS SOURCE",self._system, system, int_id(_stream_id), int_id(_dst_id))
@ -2158,7 +2211,6 @@ class routerHBP(HBSYSTEM):
if CONFIG['SYSTEMS'][self._system]['ENHANCED_OBP'] and '_bcsq' not in self.STATUS[_slot]:
systems[self._system].send_bcsq(_dst_id,_stream_id)
#logger.warning("(%s) OBP *BridgeControl* Sent BCSQ , STREAM ID: %s, TG %s",self._system, int_id(_stream_id), int_id(_dst_id))
self.STATUS[_slot]['_bcsq'] = True
return
@ -2272,10 +2324,8 @@ class routerHBP(HBSYSTEM):
else:
if (_dst_id in _system['OFF'] or _dst_id in _system['RESET']) and _slot == _system['TS']:
#if (_dst_id in _system['OFF'] or _dst_id in _system['RESET']) and _slot == _system['TS']:
# Set the matching rule as ACTIVE
if _dst_id in _system['OFF']:
#if _dst_id in _system['OFF']:
if _system['ACTIVE'] == True:
_system['ACTIVE'] = False
logger.info('(%s) [9] Bridge: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE'])
@ -2422,6 +2472,9 @@ if __name__ == '__main__':
# Build the routing rules file
BRIDGES = make_bridges(rules_module.BRIDGES)
#Subscriber map for unit calls - complete with test entry
SUB_MAP = {bytes_3(73578):('REP-1',1,time())}
#Generator
generator = {}
systemdelete = []
@ -2466,12 +2519,6 @@ if __name__ == '__main__':
if CONFIG['SYSTEMS'][system]['TS2_STATIC']:
ts2 = CONFIG['SYSTEMS'][system]['TS2_STATIC'].split(',')
#if CONFIG['SYSTEMS'][system]['SINGLE_MODE'] == True:
#if ts1:
#make_static_tg(int(ts1[0]),1,system)
#if ts2:
#make_static_tg(int(ts2[0]),2,system)
#else:
for tg in ts1:
if not tg:
continue
@ -2516,9 +2563,6 @@ if __name__ == '__main__':
for system in CONFIG['SYSTEMS']:
if CONFIG['SYSTEMS'][system]['ENABLED']:
# if CONFIG['SYSTEMS'][system]['MODE'] == 'XLXPEER':
# logger.warning('(GLOBAL) system %s not started - XLXPEER connections currently unsupported ', system)
# continue
if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE':
systems[system] = routerOBP(system, CONFIG, report_server)
else:
@ -2572,6 +2616,11 @@ if __name__ == '__main__':
ka = ka_task.start(60)
ka.addErrback(loopingErrHandle)
#Subscriber map trimmer
sub_trimmer_task = task.LoopingCall(SubMapTrimmer)
sub_trimmer = sub_trimmer_task.start(3600)#3600
sub_trimmer.addErrback(loopingErrHandle)
#more threads
reactor.suggestThreadPoolSize(100)

Loading…
Cancel
Save

Powered by TurnKey Linux.