# configuration file and listed as "active". It can be empty, # but it has to exist. # try: from bridge_rules import RULES as RULES_FILE logger.info('Bridge rules file found and rules imported') except ImportError: sys.exit('Bridging rules file not found or invalid') # Convert integer GROUP ID numbers from the config into hex strings # we need to send in the actual data packets. # for _ipsc in RULES_FILE: for _rule in RULES_FILE[_ipsc]['GROUP_VOICE']: _rule['SRC_GROUP'] = hex_str_3(_rule['SRC_GROUP']) _rule['DST_GROUP'] = hex_str_3(_rule['DST_GROUP']) _rule['SRC_TS'] = _rule['SRC_TS'] - 1 _rule['DST_TS'] = _rule['DST_TS'] - 1 if _ipsc not in NETWORK: sys.exit('ERROR: Bridge rules found for an IPSC network not configured in main configuration') for _ipsc in NETWORK: if _ipsc not in RULES_FILE: sys.exit('ERROR: Bridge rules not found for all IPSC network configured') RULES = RULES_FILE # Import List of Bridges # This is how we identify known bridges. If one of these is present # and it's mode byte is set to bridge, we don't #
__author__ = 'Cortney T. Buffington, N0MJS' __copyright__ = 'Copyright (c) 2014 Cortney T. Buffington, N0MJS and the K0USY Group' __credits__ = 'Adam Fast, KC0YLK; Dave Kierzkowski, KD8EYF' __license__ = 'Creative Commons Attribution-ShareAlike 3.0 Unported' __maintainer__ = 'Cort Buffington, N0MJS' __email__ = '*****@*****.**' __status__ = 'beta' try: from playback_config import * except ImportError: sys.exit('Configuration file not found or invalid') HEX_TGID = hex_str_3(TGID) HEX_SUB = hex_str_3(SUB) BOGUS_SUB = '\xFF\xFF\xFF' if GROUP_SRC_SUB: logger.info('Playback: USING SUBSCRIBER ID: %s FOR GROUP REPEAT', GROUP_SRC_SUB) HEX_GRP_SUB = hex_str_3(GROUP_SRC_SUB) class playbackIPSC(IPSC): def __init__(self, *args, **kwargs): IPSC.__init__(self, *args, **kwargs) self.CALL_DATA = [] #************************************************ # CALLBACK FUNCTIONS FOR USER PACKET TYPES #************************************************
__author__ = 'Cortney T. Buffington, N0MJS' __copyright__ = 'Copyright (c) 2014 Cortney T. Buffington, N0MJS and the K0USY Group' __credits__ = 'Adam Fast, KC0YLK; Dave K; and he who wishes not to be named' __license__ = 'Creative Commons Attribution-ShareAlike 3.0 Unported' __version__ = '0.1a' __maintainer__ = 'Cort Buffington, N0MJS' __email__ = '*****@*****.**' __status__ = 'pre-alpha' try: from playback_config import * except ImportError: sys.exit('Configuration file not found or invalid') HEX_TGID = hex_str_3(TGID) HEX_SUB = hex_str_3(SUB) BOGUS_SUB = '\xFF\xFF\xFF' class playbackIPSC(IPSC): def __init__(self, *args, **kwargs): IPSC.__init__(self, *args, **kwargs) self.CALL_DATA = [] #************************************************ # CALLBACK FUNCTIONS FOR USER PACKET TYPES #************************************************ # if GROUP_REPEAT: logger.info('Playback: DEFINING GROUP REPEAT FUNCTION')
while True: ts = raw_input('Which timeslot (1, 2 or \'both\')? ') if ts == '1' or ts == '2' or ts == 'both': if ts == '1': ts = (0, ) if ts == '2': ts = (1, ) if ts == 'both': ts = (0, 1) break print('...input must be \'1\', \'2\' or \'both\'') id = raw_input('Which Group or Subscriber ID to record? ') id = int(id) id = hex_str_3(id) filename = raw_input('Filename to use for this recording? ') class recordIPSC(IPSC): def __init__(self, *args, **kwargs): IPSC.__init__(self, *args, **kwargs) self.CALL_DATA = [] #************************************************ # CALLBACK FUNCTIONS FOR USER PACKET TYPES #************************************************ # if tx_type == 'g': print('Initializing to record GROUP VOICE transmission')
while True: ts = raw_input('Which timeslot (1, 2 or \'both\')? ') if ts == '1' or ts == '2' or ts =='both': if ts == '1': ts = (0,) if ts == '2': ts = (1,) if ts == 'both': ts = (0,1) break print('...input must be \'1\', \'2\' or \'both\'') id = raw_input('Which Group or Subscriber ID to record? ') id = int(id) id = hex_str_3(id) filename = raw_input('Filename to use for this recording? ') class recordIPSC(IPSC): def __init__(self, *args, **kwargs): IPSC.__init__(self, *args, **kwargs) self.CALL_DATA = [] #************************************************ # CALLBACK FUNCTIONS FOR USER PACKET TYPES #************************************************ # if tx_type == 'g': print('Initializing to record GROUP VOICE transmission')
# configuration file and listed as "active". It can be empty, # but it has to exist. # try: from bridge_rules import RULES as RULES_FILE logger.info('Bridge rules file found and rules imported') except ImportError: sys.exit('Bridging rules file not found or invalid') # Convert integer GROUP ID numbers from the config into hex strings # we need to send in the actual data packets. # for _ipsc in RULES_FILE: for _rule in RULES_FILE[_ipsc]['GROUP_VOICE']: _rule['SRC_GROUP'] = hex_str_3(_rule['SRC_GROUP']) _rule['DST_GROUP'] = hex_str_3(_rule['DST_GROUP']) _rule['SRC_TS'] = _rule['SRC_TS'] - 1 _rule['DST_TS'] = _rule['DST_TS'] - 1 for i, e in enumerate(_rule['ON']): _rule['ON'][i] = hex_str_3(_rule['ON'][i]) for i, e in enumerate(_rule['OFF']): _rule['OFF'][i] = hex_str_3(_rule['OFF'][i]) if _ipsc not in NETWORK: sys.exit('ERROR: Bridge rules found for an IPSC network not configured in main configuration') for _ipsc in NETWORK: if _ipsc not in RULES_FILE: sys.exit('ERROR: Bridge rules not found for all IPSC network configured') RULES = RULES_FILE
__author__ = 'Cortney T. Buffington, N0MJS' __copyright__ = 'Copyright (c) 2014 Cortney T. Buffington, N0MJS and the K0USY Group' __credits__ = 'Adam Fast, KC0YLK; Dave K; and he who wishes not to be named' __license__ = 'Creative Commons Attribution-ShareAlike 3.0 Unported' __version__ = '0.1b' __maintainer__ = 'Cort Buffington, N0MJS' __email__ = '*****@*****.**' __status__ = 'pre-alpha' try: from playback_config import * except ImportError: sys.exit('Configuration file not found or invalid') HEX_TGID = hex_str_3(TGID) class playbackIPSC(IPSC): def __init__(self, *args, **kwargs): IPSC.__init__(self, *args, **kwargs) self.CALL_DATA = [] #************************************************ # CALLBACK FUNCTIONS FOR USER PACKET TYPES #************************************************ # def group_voice(self, _network, _src_sub, _dst_sub, _ts, _end, _peerid, _data): if HEX_TGID == _dst_sub and TS == _ts: if not _end: if not self.CALL_DATA:
from dmrlink import IPSC, NETWORK, networks, logger, dmr_nat, int_id, hex_str_3 __author__ = 'Cortney T. Buffington, N0MJS' __copyright__ = 'Copyright (c) 2014 Cortney T. Buffington, N0MJS and the K0USY Group' __credits__ = 'Adam Fast, KC0YLK; Dave Kierzkowski, KD8EYF' __license__ = 'Creative Commons Attribution-ShareAlike 3.0 Unported' __maintainer__ = 'Cort Buffington, N0MJS' __email__ = '*****@*****.**' __status__ = 'beta' try: from playback_config import * except ImportError: sys.exit('Configuration file not found or invalid') HEX_TGID = hex_str_3(TGID) HEX_SUB = hex_str_3(SUB) BOGUS_SUB = '\xFF\xFF\xFF' if GROUP_SRC_SUB: logger.info('Playback: USING SUBSCRIBER ID: %s FOR GROUP REPEAT', GROUP_SRC_SUB) HEX_GRP_SUB = hex_str_3(GROUP_SRC_SUB) class playbackIPSC(IPSC): def __init__(self, *args, **kwargs): IPSC.__init__(self, *args, **kwargs) self.CALL_DATA = [] #************************************************ # CALLBACK FUNCTIONS FOR USER PACKET TYPES