fix(parity): align in-band scope and CRC dedup with legacy

Restrict in-band signalling callback to group/vcsbk VTERM paths and restore
legacy CRC semantics for OBP/HBP packet deduplication.
pull/4/head
Rodrigo Pérez 6 months ago
parent 8e6f03d680
commit bab9f3db84

@ -1692,7 +1692,7 @@ class BridgeUseCases:
((st["loss"] / st["packets"]) * 100) if st.get("packets") else 0.0,
)
return False
if _pkt_crc in st["crcs"]:
if seq > 0 and _pkt_crc in st["crcs"]:
st["loss"] += 1
logger.debug(
"(%s) *PacketControl* DMR packet payload with hash: %s seen before in this stream, disgarding. Stream ID:, %s TGID: %s: SEQ:%s PACKETS: %s, LOSS: %.2f%% ",
@ -1983,12 +1983,10 @@ class BridgeUseCases:
if seq and _slot_st.get("lastSeq") and seq != 1 and seq < _slot_st.get("lastSeq", 0):
_slot_st["loss"] = _slot_st.get("loss", 0) + 1
return
_pkt_crc = None
if seq > 0:
_h = blake2b(digest_size=16)
_h.update(data)
_pkt_crc = _h.digest()
if "crcs" in _slot_st and _pkt_crc in _slot_st["crcs"]:
if seq > 0 and "crcs" in _slot_st and _pkt_crc in _slot_st["crcs"]:
_slot_st["loss"] = _slot_st.get("loss", 0) + 1
return
# Missed packets (legacy ~3392-3394): just increment loss, don't drop
@ -1996,7 +1994,7 @@ class BridgeUseCases:
_slot_st["loss"] = _slot_st.get("loss", 0) + 1
_slot_st["lastSeq"] = seq
_slot_st["lastData"] = data
if _pkt_crc and "crcs" in _slot_st:
if "crcs" in _slot_st:
_slot_st["crcs"].add(_pkt_crc)
# Legacy bridge.py: BRDG_EVENT (OBP group/vcsbk START/END handled in _obp_group_voice_router_obp / post-forward VTERM)

@ -536,6 +536,8 @@ class HBPProtocol(DatagramProtocol):
):
reactor.callInThread(self._on_play_file_request, str(_int_dst_id), self._system)
if (
_call_type in ("group", "vcsbk")
and
_frame_type == HBPF_DATA_SYNC
and _dtype_vseq == HBPF_SLT_VTERM
and _slot in self.STATUS
@ -886,6 +888,8 @@ class HBPProtocol(DatagramProtocol):
):
reactor.callInThread(self._on_play_file_request, str(_int_dst_id), self._system)
if (
_call_type in ("group", "vcsbk")
and
_frame_type == HBPF_DATA_SYNC
and _dtype_vseq == HBPF_SLT_VTERM
and _slot in self.STATUS

Loading…
Cancel
Save

Powered by TurnKey Linux.