From: Torrey Searle Date: Mon, 25 Feb 2019 15:41:44 +0000 (+0100) Subject: res/res_rtp_asterisk: smoother can cause wrong timestamps if dtmf happen X-Git-Tag: 13.26.0-rc1~40^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9bd8c420455ba19465e15a2dd4f0c6305a6bdda;p=thirdparty%2Fasterisk.git res/res_rtp_asterisk: smoother can cause wrong timestamps if dtmf happen Delivery timeval in the smoother object will fall behind while a DTMF is being generated. This can eventually lead to invalid rtp timestamps. To prevent this from happening the smoother needs to be reset after every DTMF to keep the timing up to date. ASTERISK-28303 #close Change-Id: Iaba3f7b428ebd72a4caa90e13b829ab4f088310f --- diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 8fc52a0e4b..c5d557ec1e 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -3566,6 +3566,12 @@ static int ast_rtp_dtmf_end_with_duration(struct ast_rtp_instance *instance, cha /* Oh and we can't forget to turn off the stuff that says we are sending DTMF */ rtp->lastts += calc_txstamp(rtp, NULL) * DTMF_SAMPLE_RATE_MS; + + /* Reset the smoother as the delivery time stored in it is now out of date */ + if (rtp->smoother) { + ast_smoother_free(rtp->smoother); + rtp->smoother = NULL; + } cleanup: rtp->sending_digit = 0; rtp->send_digit = 0;