mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
It is possible for no audio to pass between the current digit and next digit so expand logic that clears emulation to AST_FRAME_NULL.
(closes issue #11911) Reported by: edgreenberg Patches: v1-11911.patch uploaded by dimas (license 88) Tested by: tbsky git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2166,9 +2166,16 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AST_FRAME_NULL:
|
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)) {
|
if (ast_test_flag(chan, AST_FLAG_EMULATE_DTMF)) {
|
||||||
struct timeval now = ast_tvnow();
|
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;
|
chan->emulate_dtmf_duration = 0;
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
f = &chan->dtmff;
|
f = &chan->dtmff;
|
||||||
|
Reference in New Issue
Block a user