NON-WORKING
This commit is contained in:
parent
0622f8a9bf
commit
a8c868dc26
20
bridge.py
20
bridge.py
@ -48,6 +48,7 @@ from twisted.internet import reactor
|
|||||||
from twisted.internet import task
|
from twisted.internet import task
|
||||||
from binascii import b2a_hex as ahex
|
from binascii import b2a_hex as ahex
|
||||||
from time import time
|
from time import time
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -74,17 +75,20 @@ TS_CLEAR_TIME = .2
|
|||||||
# configuration file and listed as "active". It can be empty,
|
# configuration file and listed as "active". It can be empty,
|
||||||
# but it has to exist.
|
# but it has to exist.
|
||||||
#
|
#
|
||||||
try:
|
def make_rules(_dmrlink_routing_rules):
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
from bridge_rules import RULES as RULES_FILE
|
from bridge_rules import RULES as RULES_FILE
|
||||||
logger.info('Bridge rules file found and rules imported')
|
logger.info('Bridge rules file found and rules imported')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sys.exit('Bridging rules file not found or invalid')
|
sys.exit('Bridging rules file not found or invalid')
|
||||||
|
|
||||||
# Convert integer GROUP ID numbers from the config into hex strings
|
# Convert integer GROUP ID numbers from the config into hex strings
|
||||||
# we need to send in the actual data packets.
|
# we need to send in the actual data packets.
|
||||||
#
|
#
|
||||||
|
|
||||||
for _ipsc in RULES_FILE:
|
for _ipsc in RULES_FILE:
|
||||||
for _rule in RULES_FILE[_ipsc]['GROUP_VOICE']:
|
for _rule in RULES_FILE[_ipsc]['GROUP_VOICE']:
|
||||||
_rule['SRC_GROUP'] = hex_str_3(_rule['SRC_GROUP'])
|
_rule['SRC_GROUP'] = hex_str_3(_rule['SRC_GROUP'])
|
||||||
_rule['DST_GROUP'] = hex_str_3(_rule['DST_GROUP'])
|
_rule['DST_GROUP'] = hex_str_3(_rule['DST_GROUP'])
|
||||||
@ -98,11 +102,11 @@ for _ipsc in RULES_FILE:
|
|||||||
_rule['TIMER'] = time() + _rule['TIMEOUT']
|
_rule['TIMER'] = time() + _rule['TIMEOUT']
|
||||||
if _ipsc not in CONFIG['SYSTEMS']:
|
if _ipsc not in CONFIG['SYSTEMS']:
|
||||||
sys.exit('ERROR: Bridge rules found for an IPSC network not configured in main configuration')
|
sys.exit('ERROR: Bridge rules found for an IPSC network not configured in main configuration')
|
||||||
for _ipsc in CONFIG['SYSTEMS']:
|
for _ipsc in CONFIG['SYSTEMS']:
|
||||||
if _ipsc not in RULES_FILE:
|
if _ipsc not in RULES_FILE:
|
||||||
sys.exit('ERROR: Bridge rules not found for all IPSC network configured')
|
sys.exit('ERROR: Bridge rules not found for all IPSC network configured')
|
||||||
|
|
||||||
RULES = RULES_FILE
|
RULES = RULES_FILE
|
||||||
|
|
||||||
# Import List of Bridges
|
# Import List of Bridges
|
||||||
# This is how we identify known bridges. If one of these is present
|
# This is how we identify known bridges. If one of these is present
|
||||||
|
Loading…
x
Reference in New Issue
Block a user