From 56e6486aa61b93a317de09845fca93e473029944 Mon Sep 17 00:00:00 2001 From: under Date: Thu, 22 Jul 2021 19:39:11 +0300 Subject: [PATCH] codec_builtin.c: G729 audio gets corrupted by Asterisk due to smoother If Asterisk gets G.729 6-byte VAD frames inbound, then at outbound Asterisk sends this G.729 stream with non-continuous timestamps. This makes the audio stream not-playable at the receiver side. Linphone isn't able to play such an audio - lots of disruptions are heard. Also I had complains of bad audio from users which use other types of phones. After debugging, I found this is a regression connected with RTP Smoother (main/smoother.c). Smoother has a special code to handle G.729 VAD frames (search for AST_SMOOTHER_FLAG_G729 in smoother.c). However, this flag is never set in Asterisk-12 and newer. Previously it has been set (see Asterisk-11). ASTERISK-29526 #close Change-Id: I6f51ecb1a3ecd9c6d59ec5a6811a27446e17065d --- main/codec_builtin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main/codec_builtin.c b/main/codec_builtin.c index ce65754fe4..5c460bf120 100644 --- a/main/codec_builtin.c +++ b/main/codec_builtin.c @@ -457,6 +457,7 @@ static struct ast_codec g729a = { .samples_count = g729_samples, .get_length = g729_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_G729, }; static unsigned char get_n_bits_at(unsigned char *data, int n, int bit) -- 2.47.2