From bf33f3893e98f05f2df964701f753021abf74a7b Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Sat, 16 Jan 2016 18:28:39 -0600 Subject: [PATCH] Alternate Subscriber ID for repeat transmission Added a feature whereby a user can configure an alternate subscriber ID in the config file that will be used for all group traffic repeated. --- playback.py | 11 ++++++++--- playback_config_SAMPLE.py | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/playback.py b/playback.py index 9e4340a..72d2a7d 100755 --- a/playback.py +++ b/playback.py @@ -30,9 +30,12 @@ try: 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' +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): @@ -61,6 +64,8 @@ class playbackIPSC(IPSC): for i in self.CALL_DATA: _tmp_data = i _tmp_data = _tmp_data.replace(_peerid, NETWORK[_network]['LOCAL']['RADIO_ID']) + if GROUP_SRC_SUB: + _tmp_data = _tmp_data.replace(_src_sub, HEX_GRP_SUB) _tmp_data = self.hashed_packet(NETWORK[_network]['LOCAL']['AUTH_KEY'], _tmp_data) # Send the packet to all peers in the target IPSC self.send_to_ipsc(_tmp_data) diff --git a/playback_config_SAMPLE.py b/playback_config_SAMPLE.py index f7c4190..ddccc35 100755 --- a/playback_config_SAMPLE.py +++ b/playback_config_SAMPLE.py @@ -13,6 +13,13 @@ TGID = 12345 # one, you still have to use the parenthesis and comma. Just # deal with it, or make it better. TS1 = 0, TS2 = 1. GROUP_TS = (1,) +# ALTERNATE SOURCE SUBSCRIBER ID FOR REPEATED TRANSMISSION +# Some folks have radios that don't respond to their own subscriber +# IDs. Some just don't want to have the playback come from the same +# subscriber ID. If this variable is set to something, it will +# be used as the source subscriber for playback. +# SET TO 0 TO NOT USE THIS FEATURE!!! +GROUP_SRC_SUB = 0 # ENABLE PRIVATE VOICE PLAYBACK?