From: Alexei Gradinari Date: Wed, 19 Dec 2018 21:27:12 +0000 (-0500) Subject: RTP: reset DTMF last seqno/timestamp on RTP renegotiation X-Git-Tag: 13.25.0-rc1~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9face361283b37bd4387696e1b33928fecad396;p=thirdparty%2Fasterisk.git RTP: reset DTMF last seqno/timestamp on RTP renegotiation The remote side may start a new stream when renegotiating RTP. Need to reset the DTMF last sequence number and the timestamp of the last END packet on RTP renegotiation. If the new time stamp is lower then the timestamp of the last DTMF END packet the asterisk drops all DTMF frames as out of order. This bug was caught using Cisco ip-phone SPA5XX and codec g722. On SIP session update the SPA50X resets stream and a new timestamp is twice smaller then the previous. ASTERISK-28162 #close Change-Id: Ic72b4497e74d801b27a635559c1cf29c16c95254 --- diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index c0e9e63e3a..77eba21384 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -6042,6 +6042,10 @@ static void ast_rtp_remote_address_set(struct ast_rtp_instance *instance, struct rtp->rtcp->local_addr_str = ast_strdup(ast_sockaddr_stringify(&local)); } + /* Need to reset the DTMF last sequence number and the timestamp of the last END packet */ + rtp->last_seqno = 0; + rtp->last_end_timestamp = 0; + if (strictrtp && rtp->strict_rtp_state != STRICT_RTP_OPEN && !ast_sockaddr_isnull(addr) && ast_sockaddr_cmp(addr, &rtp->strict_rtp_address)) { /* We only need to learn a new strict source address if we've been told the source is