From edf3288bcc5395ab21e7e82042b16f7e2cfdcea6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 15 Mar 2024 08:45:41 -0400 Subject: [PATCH] MT#55283 fix DTMF end event sequencing Make sure we increase the output RTP sequence number for each generated packet in the case of packets that need to be duplicated or sent repeatedly (DTMF end event) Change-Id: Ia16ffefc0791d01575248ac5d8025eb30ccaec67 (cherry picked from commit 41a9894cce16d47ad59c468f6bc9b4f7f2ed464a) --- daemon/codec.c | 2 ++ t/auto-daemon-tests.pl | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index 2a0d96864..ad637f9ea 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -2227,10 +2227,12 @@ static int packet_dtmf(struct codec_ssrc_handler *ch, struct codec_ssrc_handler ret = 1; // consumed else ret = packet_dtmf_fwd(ch, input_ch, dup, mp); + mp->ssrc_out->parent->seq_diff++; if (ret == 0) __transcode_packet_free(dup); } + mp->ssrc_out->parent->seq_diff--; // discard the received event do_blocking = true; diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 1b31979da..d6b73b83c 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -1066,12 +1066,12 @@ snd($sock_a, $port_b, rtp(101, 1028, 6040, 0x1234, "\x03\xa6\x03\xc0")); rcv_no($sock_b); # send audio, receive end event snd($sock_a, $port_b, rtp(8, 1029, 7000, 0x1234, "\x00" x 160)); +rcv($sock_b, $port_a, rtpm(101, 1029, 6200, 0x1234, "\x01\x8c\x03\xc0")); +rcv($sock_b, $port_a, rtpm(101, 1030, 6200, 0x1234, "\x01\x8c\x03\xc0")); rcv($sock_b, $port_a, rtpm(101, 1031, 6200, 0x1234, "\x01\x8c\x03\xc0")); -rcv($sock_b, $port_a, rtpm(101, 1032, 6200, 0x1234, "\x01\x8c\x03\xc0")); -rcv($sock_b, $port_a, rtpm(101, 1033, 6200, 0x1234, "\x01\x8c\x03\xc0")); snd($sock_a, $port_b, rtp(8, 1030, 7160, 0x1234, "\x00" x 160)); -rcv($sock_b, $port_a, rtpm(8, 1034, 7160, 0x1234, "\x00" x 160)); +rcv($sock_b, $port_a, rtpm(8, 1032, 7160, 0x1234, "\x00" x 160));