From 638e585a46a97227f0244aa9fd2caf3727cf2fad Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 26 Feb 2021 19:13:58 +0000 Subject: [PATCH] Take callsign for voice ident from callsign sent in connection rather than from system name. Now it will work with proxy setups too! --- bridge_master.py | 14 ++++++++++---- hotspot_proxy_v2.py | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index 219a421..33305bf 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -487,9 +487,15 @@ def ident(): if CONFIG['SYSTEMS'][system]['MODE'] != 'MASTER': continue if CONFIG['SYSTEMS'][system]['VOICE_IDENT'] == True: - # if CONFIG['SYSTEMS'][system]['PEERS'] == False: - # logger.debug('(%s) System has no peers, not sending ident',system) - #We only care about slot 2 - idents go out on slot 2 + if CONFIG['SYSTEMS'][system]['MAX_PEERS'] > 1: + logger.debug("(%s) System has MAX_PEERS > 1, skipping",system) + continue + _callsign = False + for _peerid in CONFIG['SYSTEMS'][system]['PEERS']: + _callsign = CONFIG['SYSTEMS'][system]['PEERS'][_peerid]['CALLSIGN'].decode() + if not _callsign: + logger.debug("(%s) System has no peers or no recorded callsign (%s), skipping",system,_callsign) + continue _slot = systems[system].STATUS[2] #If slot is idle for RX and TX #print("RX:"+str(_slot['RX_TYPE'])+" TX:"+str(_slot['TX_TYPE'])+" TIME:"+str(time() - _slot['TX_TIME'])) @@ -498,7 +504,7 @@ def ident(): logger.info('(%s) Repeater idle. Sending voice ident',system) _say = [words['silence']] _say.append(words['silence']) - _systemcs = re.sub(r'\W+', '', system) + _systemcs = re.sub(r'\W+', '', _callsign) _systemcs.upper() for character in _systemcs: _say.append(words[character]) diff --git a/hotspot_proxy_v2.py b/hotspot_proxy_v2.py index ac13d9d..57a8347 100644 --- a/hotspot_proxy_v2.py +++ b/hotspot_proxy_v2.py @@ -153,8 +153,8 @@ if __name__ == '__main__': DestportStart = 54100 DestPortEnd = 54200 Timeout = 30 - Stats = False - Debug = False + Stats = True + Debug = True BlackList = [1234567] #*******************