diff options
-rw-r--r-- | main/channel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index cac9beb63..53f48c8a4 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2166,9 +2166,16 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio) } break; case AST_FRAME_NULL: + /* The EMULATE_DTMF flag must be cleared here as opposed to when the duration + * is reached , because we want to make sure we pass at least one + * voice frame through before starting the next digit, to ensure a gap + * between DTMF digits. */ if (ast_test_flag(chan, AST_FLAG_EMULATE_DTMF)) { struct timeval now = ast_tvnow(); - if (ast_tvdiff_ms(now, chan->dtmf_tv) >= chan->emulate_dtmf_duration) { + if (!chan->emulate_dtmf_duration) { + ast_clear_flag(chan, AST_FLAG_EMULATE_DTMF); + chan->emulate_dtmf_digit = 0; + } else if (ast_tvdiff_ms(now, chan->dtmf_tv) >= chan->emulate_dtmf_duration) { chan->emulate_dtmf_duration = 0; ast_frfree(f); f = &chan->dtmff; |