--- res/res_rtp_asterisk.c.orig 2021-03-28 20:28:48.586296475 -0400 +++ res/res_rtp_asterisk.c 2021-03-29 09:58:21.375152082 -0400 @@ -5483,7 +5483,9 @@ instance, type == AST_FRAME_DTMF_END ? "END" : "BEGIN", rtp->resp, rtp->resp, ast_sockaddr_stringify(&remote_address)); - if (rtp->resp == 'X') { + /* To avoid duplicate flash events, ignore flash end events: + dtmf_duration and dtmf_timeout are 0 for start, > 0 for end */ + if (rtp->resp == 'X' && rtp->dtmf_duration == 0 && rtp->dtmf_timeout == 0) { rtp->f.frametype = AST_FRAME_CONTROL; rtp->f.subclass.integer = AST_CONTROL_FLASH; } else {