From cf7ae511053f51a294e7a035c9c10b0854053d5b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 29 Jun 2022 11:26:01 -0400 Subject: [PATCH] TT#14008 retain "codec touched" status after answer The codec answer routine resets the codec storage and so also resets the clock rate tracker for "touched" codecs. This leads to all codecs seen as "not touched" in the answer routine, which in turn leads to supplemental codecs present in the answer SDP that should not be there. Use the "for transcoding" flag for previously present codecs to retain the "touched" status across the codec answer routine. Change-Id: Idc4624606f7f10d7983e22ddf856432b07421157 --- daemon/codec.c | 2 + t/auto-daemon-tests.pl | 95 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 4 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index 0362821a4..3cd06026c 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -4357,6 +4357,8 @@ void codec_store_populate(struct codec_store *dst, struct codec_store *src, GHas str_free_dup(&pt->codec_opts); pt->codec_opts = orig_pt->codec_opts; orig_pt->codec_opts = STR_NULL; + if (pt->for_transcoding) + codec_touched(dst, pt); } __codec_options_set(call, pt, codec_set); codec_store_add_end(dst, pt); diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index a0a928ebb..3ba1b17c7 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -78,6 +78,93 @@ sub stun_succ { }; +new_call; + +offer('DTMF PT reduction', + { codec => { transcode => ['PCMA', 'PCMU'] } }, <