summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index a39a3ad13..b8dbc2282 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1999,7 +1999,7 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
/* Wait for a digit, no more than ms milliseconds total. */
while (ms) {
struct ast_channel *rchan;
- int outfd;
+ int outfd, begin_digit = 0;
errno = 0;
rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
@@ -2018,7 +2018,12 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
return -1;
switch (f->frametype) {
- case AST_FRAME_DTMF:
+ case AST_FRAME_DTMF_BEGIN:
+ begin_digit = f->subclass;
+ break;
+ case AST_FRAME_DTMF_END:
+ if (begin_digit != f->subclass)
+ break;
res = f->subclass;
ast_frfree(f);
return res;