From 3209fce7828092c0a862080f683d205d68d7acfd Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Sat, 10 Sep 2016 10:41:42 -0500 Subject: [PATCH] remove duplicate voice start header log messages --- bridge.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bridge.py b/bridge.py index f926b55..a206d21 100755 --- a/bridge.py +++ b/bridge.py @@ -175,6 +175,8 @@ class bridgeIPSC(IPSC): 'TS2': {'RX_GROUP':'\x00', 'TX_GROUP':'\x00', 'RX_TIME':0, 'TX_TIME':0, 'RX_SRC_SUB':'\x00', 'TX_SRC_SUB':'\x00'} } + last_seq_id = '' + # Setup the backup/polite bridging maintenance loop (based on keep-alive timer) if BRIDGES: @@ -219,6 +221,7 @@ class bridgeIPSC(IPSC): # Process the packet logger.debug('(%s) Group Voice Packet Received From: %s, IPSC Peer %s, Destination %s', _network, int_id(_src_sub), int_id(_peerid), int_id(_dst_group)) _burst_data_type = _data[30] # Determine the type of voice packet this is (see top of file for possible types) + _seq_id = _data[5] if _ts == 0: _TS = 'TS1' elif _ts == 1: @@ -330,7 +333,9 @@ class bridgeIPSC(IPSC): # Action happens on key up if _burst_data_type == BURST_DATA_TYPE['VOICE_HEAD']: - logger.info('(%s) GROUP VOICE START: PEER: %s, SUB: %s, TS: %s, TGID: %s', _network, int_id(_peerid), int_id(_src_sub), _ts+1, int_id(_dst_group)) + if last_seq_id != seq_id: + last_seq_id = seq_id: + logger.info('(%s) GROUP VOICE START: PEER: %s, SUB: %s, TS: %s, TGID: %s', _network, int_id(_peerid), int_id(_src_sub), _ts+1, int_id(_dst_group)) # Action happens on un-key if _burst_data_type == BURST_DATA_TYPE['VOICE_TERM']: