MT#55283 codec: fix not processing DTMF during block-media when audio sent along with DTMF

this fixes an edge case where `DTMF-security=silence`, `block-media`
is enabled and the endpoint sends silence packets in between each RTP
event packet of a single DTMF hit. When that happens, the DTMF doesn't
get processed as `packet_sequencer_next_packet` returns NULL, and the
while loop is broken due to the ts_diff being 0
By checking if media is currently blocked and that the current packet
is a supplemental DTMF, we can force the packet to be processed so the
dropped packet is considered lost and we don't lose the DTMF event

Change-Id: I78bc8e273e872b3ab88f7a84e26a79fad1793476
pull/1964/head
Tom Briden 6 months ago committed by Richard Fuchs
parent 621d86918a
commit 101d9ae0ef

@ -2333,6 +2333,16 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa
|| !h->dest_pt.codec_def)
break;
// it's possible to receive audio packets between dtmf event packets for the same event. if this is
// happening while media is being blocked, then packet_sequencer_next_packet will have returned NULL
// above. this check forces processing of the dtmf event while media blocking is enabled so they can
// be detected correctly and sent on dtmf-log-dest endpoints
if (h->source_pt.codec_def && h->source_pt.codec_def->supplemental && !handler_silence_block(h, mp)) {
packet = packet_sequencer_force_next_packet(seq);
if (!packet)
break;
}
else {
uint32_t ts_diff = packet_ts - ch->csch.last_ts;
// if packet TS is larger than last tracked TS, we can force the next packet if packets were lost and the TS
@ -2353,6 +2363,7 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa
else
break;
}
}
if (ch) {
if (!ch->csch.last_ts)

Loading…
Cancel
Save