|
|
|
|
@ -1033,7 +1033,7 @@ def stream_trimmer_loop():
|
|
|
|
|
logger.info('(%s) *TIME OUT* RX STREAM ID: %s SUB: %s TGID %s, TS %s, Duration: %.2f', \
|
|
|
|
|
system, int_id(_slot['RX_STREAM_ID']), int_id(_slot['RX_RFS']), int_id(_slot['RX_TGID']), slot, _slot['RX_TIME'] - _slot['RX_START'])
|
|
|
|
|
if CONFIG['REPORTS']['REPORT'] and _slot.get('RX_GROUP_VOICE_STREAM') and not _slot.get('RX_DATA_STREAM'):
|
|
|
|
|
systems[system]._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(system, int_id(_slot['RX_STREAM_ID']), int_id(_slot['RX_PEER']), int_id(_slot['RX_RFS']), slot, int_id(_slot['RX_TGID']), _slot['RX_TIME'] - _slot['RX_START']).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[system]._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(system, int_id(_slot['RX_STREAM_ID']), int_id(_slot['RX_PEER']), int_id(_slot['RX_RFS']), slot, int_id(_slot['RX_TGID']), _slot['RX_TIME'] - _slot['RX_START']).encode(encoding='utf-8', errors='ignore'), _slot.get('RX_SOURCE_SERVER'), _slot.get('RX_SOURCE_RPTR'))
|
|
|
|
|
_slot['RX_DATA_STREAM'] = False
|
|
|
|
|
_slot['RX_GROUP_VOICE_STREAM'] = False
|
|
|
|
|
#Null stream_id - for loop control
|
|
|
|
|
@ -1048,7 +1048,7 @@ def stream_trimmer_loop():
|
|
|
|
|
logger.debug('(%s) *TIME OUT* TX STREAM ID: %s SUB: %s TGID %s, TS %s, Duration: %.2f', \
|
|
|
|
|
system, int_id(_slot['TX_STREAM_ID']), int_id(_slot['TX_RFS']), int_id(_slot['TX_TGID']), slot, _slot['TX_TIME'] - _slot['TX_START'])
|
|
|
|
|
if CONFIG['REPORTS']['REPORT'] and not _slot.get('TX_DATA_STREAM'):
|
|
|
|
|
systems[system]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(system, int_id(_slot['TX_STREAM_ID']), int_id(_slot['TX_PEER']), int_id(_slot['TX_RFS']), slot, int_id(_slot['TX_TGID']), _slot['TX_TIME'] - _slot['TX_START']).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[system]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(system, int_id(_slot['TX_STREAM_ID']), int_id(_slot['TX_PEER']), int_id(_slot['TX_RFS']), slot, int_id(_slot['TX_TGID']), _slot['TX_TIME'] - _slot['TX_START']).encode(encoding='utf-8', errors='ignore'), _slot.get('TX_SOURCE_SERVER'), _slot.get('TX_SOURCE_RPTR'))
|
|
|
|
|
_slot['TX_DATA_STREAM'] = False
|
|
|
|
|
|
|
|
|
|
# OBP systems
|
|
|
|
|
@ -1088,7 +1088,7 @@ def stream_trimmer_loop():
|
|
|
|
|
system, int_id(stream_id), get_alias(int_id(_stream['RFS']), subscriber_ids), get_alias(int_id(_stream['RX_PEER']), peer_ids), get_alias(int_id(_stream['TGID']), talkgroup_ids), _stream['LAST'] - _stream['START'])
|
|
|
|
|
|
|
|
|
|
if CONFIG['REPORTS']['REPORT'] and not _stream.get('DATA_STREAM'):
|
|
|
|
|
systems[system]._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(system, int_id(stream_id), int_id(_stream['RX_PEER']), int_id(_stream['RFS']), 1, int_id(_stream['TGID']), _stream['LAST'] - _stream['START']).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[system]._report.send_bridgeEvent('GROUP VOICE,END,RX,{},{},{},{},{},{},{:.2f}'.format(system, int_id(stream_id), int_id(_stream['RX_PEER']), int_id(_stream['RFS']), 1, int_id(_stream['TGID']), _stream['LAST'] - _stream['START']).encode(encoding='utf-8', errors='ignore'), _stream.get('SOURCE_SERVER'), _stream.get('SOURCE_RPTR'))
|
|
|
|
|
systems[system].STATUS[stream_id]['_to'] = True
|
|
|
|
|
continue
|
|
|
|
|
except Exception as e:
|
|
|
|
|
@ -1824,7 +1824,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
logger.debug('(%s) Conference Bridge: %s, Call Bridged to OBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
if not _data_control:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
else:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('{},DATA,TX,{},{},{},{},{},{}'.format(_data_event, _target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
|
|
|
|
|
@ -1852,7 +1852,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
logger.warning('(%s) KeyError - T_LC, Skipping', self._system)
|
|
|
|
|
if CONFIG['REPORTS']['REPORT'] and not _target_status[_stream_id].get('DATA_STREAM'):
|
|
|
|
|
call_duration = pkt_time - _target_status[_stream_id]['START']
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
if not _target_status[_stream_id].get('DATA_STREAM'):
|
|
|
|
|
_target_status[_stream_id]['_fin'] = True
|
|
|
|
|
# Create a Burst B-E packet (Embedded LC)
|
|
|
|
|
@ -1907,6 +1907,8 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
_target_status[_target['TS']]['TX_RFS'] = _rf_src
|
|
|
|
|
_target_status[_target['TS']]['TX_PEER'] = _peer_id
|
|
|
|
|
_target_status[_target['TS']]['TX_DATA_STREAM'] = _data_control
|
|
|
|
|
_target_status[_target['TS']]['TX_SOURCE_SERVER'] = _source_server
|
|
|
|
|
_target_status[_target['TS']]['TX_SOURCE_RPTR'] = _source_rptr
|
|
|
|
|
# Generate LCs (full and EMB) for the TX stream
|
|
|
|
|
dst_lc = b''.join([self.STATUS[_stream_id]['LC'][0:3], _target['TGID'], _rf_src])
|
|
|
|
|
_target_status[_target['TS']]['TX_H_LC'] = dmr_codec.encode_header_lc(dst_lc)
|
|
|
|
|
@ -1916,7 +1918,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
logger.debug('(%s) Conference Bridge: %s, Call Bridged to HBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
if not _data_control:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
else:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('{},DATA,TX,{},{},{},{},{},{}'.format(_data_event, _target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
|
|
|
|
|
@ -1946,7 +1948,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
dmrbits = _target_status[_target['TS']]['TX_T_LC'][0:98] + dmrbits[98:166] + _target_status[_target['TS']]['TX_T_LC'][98:197]
|
|
|
|
|
if CONFIG['REPORTS']['REPORT'] and not _target_status[_target['TS']].get('TX_DATA_STREAM'):
|
|
|
|
|
call_duration = pkt_time - _target_status[_target['TS']]['TX_START']
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
# Create a Burst B-E packet (Embedded LC)
|
|
|
|
|
elif target_requires_emb_lc_rewrite(_dst_id, _target['TGID']) and _frame_type == HBPF_VOICE and _dtype_vseq in [1,2,3,4]:
|
|
|
|
|
dmrbits = dmrbits[0:116] + _target_status[_target['TS']]['TX_EMB_LC'][_dtype_vseq] + dmrbits[148:264]
|
|
|
|
|
@ -2200,7 +2202,9 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
'packets': 0,
|
|
|
|
|
'loss': 0,
|
|
|
|
|
'crcs': set(),
|
|
|
|
|
'DATA_STREAM': _data_control
|
|
|
|
|
'DATA_STREAM': _data_control,
|
|
|
|
|
'SOURCE_SERVER': _source_server,
|
|
|
|
|
'SOURCE_RPTR': _source_rptr
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -2222,7 +2226,7 @@ class routerOBP(OPENBRIDGE):
|
|
|
|
|
self._system, _rx_event, int_id(_stream_id),get_alias(_rf_src, subscriber_ids),int_id(_rf_src),self.get_rptr(_source_rptr), int_id(_source_rptr), get_alias(_peer_id, peer_ids), int_id(_peer_id), get_alias(_dst_id, talkgroup_ids), int_id(_dst_id), _slot,int_id(_source_server),_inthops)
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
if not _data_control:
|
|
|
|
|
self._report.send_bridgeEvent('GROUP VOICE,START,RX,{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id)).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
self._report.send_bridgeEvent('GROUP VOICE,START,RX,{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id)).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
else:
|
|
|
|
|
self._report.send_bridgeEvent('{},DATA,RX,{},{},{},{},{},{}'.format(_data_event, self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id)).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
|
|
|
|
|
@ -2368,7 +2372,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, packet_rate,loss)
|
|
|
|
|
if not self.STATUS[_stream_id].get('DATA_STREAM'):
|
|
|
|
|
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._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'), _source_server, _source_rptr)
|
|
|
|
|
self.STATUS[_stream_id]['_fin'] = True
|
|
|
|
|
|
|
|
|
|
self.STATUS[_stream_id]['lastSeq'] = False
|
|
|
|
|
@ -2527,7 +2531,7 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
logger.debug('(%s) Conference Bridge: %s, Call Bridged to OBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
if not _data_control:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
else:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('{},DATA,TX,{},{},{},{},{},{}'.format(_data_event, _target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
|
|
|
|
|
@ -2552,7 +2556,7 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
dmrbits = _target_status[_stream_id]['T_LC'][0:98] + dmrbits[98:166] + _target_status[_stream_id]['T_LC'][98:197]
|
|
|
|
|
if CONFIG['REPORTS']['REPORT'] and not _target_status[_stream_id].get('DATA_STREAM'):
|
|
|
|
|
call_duration = pkt_time - _target_status[_stream_id]['START']
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
if not _target_status[_stream_id].get('DATA_STREAM'):
|
|
|
|
|
_target_status[_stream_id]['_fin'] = True
|
|
|
|
|
# Create a Burst B-E packet (Embedded LC)
|
|
|
|
|
@ -2599,6 +2603,8 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
_target_status[_target['TS']]['TX_RFS'] = _rf_src
|
|
|
|
|
_target_status[_target['TS']]['TX_PEER'] = _peer_id
|
|
|
|
|
_target_status[_target['TS']]['TX_DATA_STREAM'] = _data_control
|
|
|
|
|
_target_status[_target['TS']]['TX_SOURCE_SERVER'] = _source_server
|
|
|
|
|
_target_status[_target['TS']]['TX_SOURCE_RPTR'] = _source_rptr
|
|
|
|
|
# Generate LCs (full and EMB) for the TX stream
|
|
|
|
|
dst_lc = b''.join([self.STATUS[_slot]['RX_LC'][0:3],_target['TGID'],_rf_src])
|
|
|
|
|
_target_status[_target['TS']]['TX_H_LC'] = dmr_codec.encode_header_lc(dst_lc)
|
|
|
|
|
@ -2608,7 +2614,7 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
logger.debug('(%s) Conference Bridge: %s, Call Bridged to HBP System: %s TS: %s, TGID: %s', self._system, _bridge, _target['SYSTEM'], _target['TS'], int_id(_target['TGID']))
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
if not _data_control:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
else:
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('{},DATA,TX,{},{},{},{},{},{}'.format(_data_event, _target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID'])).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
|
|
|
|
|
@ -2638,7 +2644,7 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
dmrbits = _target_status[_target['TS']]['TX_T_LC'][0:98] + dmrbits[98:166] + _target_status[_target['TS']]['TX_T_LC'][98:197]
|
|
|
|
|
if CONFIG['REPORTS']['REPORT'] and not _target_status[_target['TS']].get('TX_DATA_STREAM'):
|
|
|
|
|
call_duration = pkt_time - _target_status[_target['TS']]['TX_START']
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
systems[_target['SYSTEM']]._report.send_bridgeEvent('GROUP VOICE,END,TX,{},{},{},{},{},{},{:.2f}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _target['TS'], int_id(_target['TGID']), call_duration).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
# Create a Burst B-E packet (Embedded LC)
|
|
|
|
|
elif target_requires_emb_lc_rewrite(_dst_id, _target['TGID']) and _frame_type == HBPF_VOICE and _dtype_vseq in [1,2,3,4]:
|
|
|
|
|
dmrbits = dmrbits[0:116] + _target_status[_target['TS']]['TX_EMB_LC'][_dtype_vseq] + dmrbits[148:264]
|
|
|
|
|
@ -3147,6 +3153,8 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
self.STATUS[_slot]['RX_START'] = pkt_time
|
|
|
|
|
self.STATUS[_slot]['RX_DATA_STREAM'] = _data_control
|
|
|
|
|
self.STATUS[_slot]['RX_GROUP_VOICE_STREAM'] = not _data_control
|
|
|
|
|
self.STATUS[_slot]['RX_SOURCE_SERVER'] = _source_server
|
|
|
|
|
self.STATUS[_slot]['RX_SOURCE_RPTR'] = _source_rptr
|
|
|
|
|
|
|
|
|
|
if _call_type == 'vcsbk' and _data_event == 'OTHER DATA':
|
|
|
|
|
logger.info('(%s) *VCSBK* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s _dtype_vseq: %s',
|
|
|
|
|
@ -3162,7 +3170,7 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
logger.info('(%s) *CALL START* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s', \
|
|
|
|
|
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)
|
|
|
|
|
if CONFIG['REPORTS']['REPORT']:
|
|
|
|
|
self._report.send_bridgeEvent('GROUP VOICE,START,RX,{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id)).encode(encoding='utf-8', errors='ignore'))
|
|
|
|
|
self._report.send_bridgeEvent('GROUP VOICE,START,RX,{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id)).encode(encoding='utf-8', errors='ignore'), _source_server, _source_rptr)
|
|
|
|
|
|
|
|
|
|
# If we can, use the LC from the voice header as to keep all options intact
|
|
|
|
|
if _frame_type == HBPF_DATA_SYNC and _dtype_vseq == HBPF_SLT_VHEAD:
|
|
|
|
|
@ -3287,7 +3295,7 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
logger.info('(%s) *CALL END* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s, Duration: %.2f, Packet rate: %.2f/s, LOSS: %.2f%%', \
|
|
|
|
|
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, packet_rate, loss)
|
|
|
|
|
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._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'), _source_server, _source_rptr)
|
|
|
|
|
self.STATUS[_slot]['RX_FINISHED_STREAM_ID'] = _stream_id
|
|
|
|
|
self.STATUS[_slot]['RX_FINISHED_STREAM_LOG'] = False
|
|
|
|
|
|
|
|
|
|
@ -3396,13 +3404,20 @@ class routerHBP(HBSYSTEM):
|
|
|
|
|
#
|
|
|
|
|
class bridgeReportFactory(reportFactory):
|
|
|
|
|
|
|
|
|
|
def send_bridge(self):
|
|
|
|
|
def send_bridge(self, client=None):
|
|
|
|
|
serialized = pickle.dumps(BRIDGES, protocol=2) #.decode("utf-8", errors='ignore')
|
|
|
|
|
self.send_clients(b''.join([REPORT_OPCODES['BRIDGE_SND'],serialized]))
|
|
|
|
|
message = b''.join([REPORT_OPCODES['BRIDGE_SND'],serialized])
|
|
|
|
|
if client is None:
|
|
|
|
|
self.send_clients(message)
|
|
|
|
|
else:
|
|
|
|
|
self.send_client(client, message)
|
|
|
|
|
|
|
|
|
|
def send_bridgeEvent(self, _data):
|
|
|
|
|
def send_bridgeEvent(self, _data, _source_server=None, _source_rptr=None):
|
|
|
|
|
if isinstance(_data, str):
|
|
|
|
|
_data = _data.decode('utf-8', error='ignore')
|
|
|
|
|
_data = _data.encode('utf-8', errors='ignore')
|
|
|
|
|
if _source_server is not None and _source_rptr is not None:
|
|
|
|
|
origin = '{},{}'.format(int_id(_source_server), int_id(_source_rptr)).encode('ascii')
|
|
|
|
|
_data = b','.join([_data, origin])
|
|
|
|
|
self.send_clients(b''.join([REPORT_OPCODES['BRDG_EVENT'],_data]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|