diff --git a/bridge_master.py b/bridge_master.py index 743d0b0..d54ca9e 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -380,6 +380,11 @@ def stream_trimmer_loop(): if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE': remove_list = [] for stream_id in systems[system].STATUS: + + #if stream already marked as finished, just remove it + if '_fin' in [system].STATUS[stream_id] and systems[system].STATUS[stream_id]['LAST'] < _now - 5: + removed = systems[system].STATUS.pop(stream_id) + try: if systems[system].STATUS[stream_id]['LAST'] < _now - 5: remove_list.append(stream_id) @@ -1304,6 +1309,7 @@ class routerOBP(OPENBRIDGE): self._system, int_id(_stream_id), get_alias(_rf_src, subscriber_ids), int_id(_rf_src), get_alias(_peer_id, peer_ids), int_id(_peer_id), get_alias(_dst_id, talkgroup_ids), int_id(_dst_id), _slot, call_duration) if CONFIG['REPORTS']['REPORT']: self._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), call_duration).encode(encoding='utf-8', errors='ignore')) + self.STATUS[_stream_id]['_fin'] = True #removed = self.STATUS.pop(_stream_id) #logger.debug('(%s) OpenBridge sourced call stream end, remove terminated Stream ID: %s', self._system, int_id(_stream_id)) #if not removed: