Do stream ID change on playback
This commit is contained in:
parent
b1372bb488
commit
18e206318f
11
playback.py
11
playback.py
@ -115,7 +115,6 @@ class playback(HBSYSTEM):
|
|||||||
dmrpkt = _data[20:53]
|
dmrpkt = _data[20:53]
|
||||||
_bits = _data[15]
|
_bits = _data[15]
|
||||||
|
|
||||||
_new_stream_id = bytes_4(randint(0x00, 0xFFFFFFFF))
|
|
||||||
|
|
||||||
if _call_type == 'group':
|
if _call_type == 'group':
|
||||||
|
|
||||||
@ -124,8 +123,6 @@ class playback(HBSYSTEM):
|
|||||||
self.STATUS['RX_START'] = pkt_time
|
self.STATUS['RX_START'] = pkt_time
|
||||||
logger.info('(%s) *START RECORDING* STREAM ID: %s SUB: %s (%s) REPEATER: %s (%s) TGID %s (%s), TS %s', \
|
logger.info('(%s) *START RECORDING* STREAM ID: %s SUB: %s (%s) REPEATER: %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)
|
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)
|
||||||
#Change the stream ID
|
|
||||||
_data = _data[:16] + _new_stream_id + _data[21:]
|
|
||||||
self.CALL_DATA.append(_data)
|
self.CALL_DATA.append(_data)
|
||||||
self.STATUS[_slot]['RX_STREAM_ID'] = _stream_id
|
self.STATUS[_slot]['RX_STREAM_ID'] = _stream_id
|
||||||
return
|
return
|
||||||
@ -134,13 +131,15 @@ class playback(HBSYSTEM):
|
|||||||
if (_frame_type == const.HBPF_DATA_SYNC) and (_dtype_vseq == const.HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != const.HBPF_SLT_VTERM) and (self.CALL_DATA):
|
if (_frame_type == const.HBPF_DATA_SYNC) and (_dtype_vseq == const.HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != const.HBPF_SLT_VTERM) and (self.CALL_DATA):
|
||||||
call_duration = pkt_time - self.STATUS['RX_START']
|
call_duration = pkt_time - self.STATUS['RX_START']
|
||||||
#Change the stream ID
|
#Change the stream ID
|
||||||
_data = _data[:16] + _new_stream_id + _data[21:]
|
|
||||||
self.CALL_DATA.append(_data)
|
self.CALL_DATA.append(_data)
|
||||||
logger.info('(%s) *END RECORDING* STREAM ID: %s', self._system, int_id(_stream_id))
|
logger.info('(%s) *END RECORDING* STREAM ID: %s', self._system, int_id(_stream_id))
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
_new_stream_id = bytes_4(randint(0x00, 0xFFFFFFFF))
|
||||||
logger.info('(%s) *START PLAYBACK* STREAM ID: %s SUB: %s (%s) REPEATER: %s (%s) TGID %s (%s), TS %s, Duration: %s', \
|
logger.info('(%s) *START PLAYBACK* STREAM ID: %s SUB: %s (%s) REPEATER: %s (%s) TGID %s (%s), TS %s, Duration: %s', \
|
||||||
self._system, int_id(_new_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)
|
self._system, int_id(_new_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)
|
||||||
|
|
||||||
for i in self.CALL_DATA:
|
for i in self.CALL_DATA:
|
||||||
|
i = i[:15] + _new_stream_id + i[21:]
|
||||||
self.send_system(i)
|
self.send_system(i)
|
||||||
#print(i)
|
#print(i)
|
||||||
sleep(0.06)
|
sleep(0.06)
|
||||||
@ -150,11 +149,7 @@ class playback(HBSYSTEM):
|
|||||||
else:
|
else:
|
||||||
if self.CALL_DATA:
|
if self.CALL_DATA:
|
||||||
#Change the stream ID
|
#Change the stream ID
|
||||||
print(_data)
|
|
||||||
print("----")
|
|
||||||
_data = _data[:16] + _new_stream_id + _data[21:]
|
|
||||||
self.CALL_DATA.append(_data)
|
self.CALL_DATA.append(_data)
|
||||||
print(_data)
|
|
||||||
|
|
||||||
|
|
||||||
# Mark status variables for use later
|
# Mark status variables for use later
|
||||||
|
Loading…
x
Reference in New Issue
Block a user