aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-12 17:16:28 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-12 17:16:28 +0000
commitf376f7e3597d18efa6ccb3fd8c25ce7d51ef749f (patch)
treefa3f326c71ac624a4898883f86c3b3c5c0dfcb3c
parent901c512da94846432d87c7fea98d617dfe4aa7ce (diff)
When waiting for a digit ensure that a begin frame was received with it, not just an end frame. (issue #10084 reported by rushowr)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74888 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/channel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index 37fd2b45d..dd2ed6781 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2079,7 +2079,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);
@@ -2098,7 +2098,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;