diff options
author | Corey Farrell <git@cfware.com> | 2017-07-12 14:24:36 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-07-12 19:08:23 -0400 |
commit | 6b138046e7db59e975fc06ee3aea54fe0c143f5d (patch) | |
tree | 5d1297d795a8640b0b1f15b52652131688541197 /res/res_agi.c | |
parent | 27aeca3594ae6618ffcafc8fe764fb0c9507ec14 (diff) |
core: Add digit filtering to ast_waitfordigit_full
This adds a parameter to ast_waitfordigit_full which can be used to only
stop waiting when certain expected digits are received. Any unexpected
DTMF digits are simply ignored.
This also creates a new dialplan application WaitDigit.
ASTERISK-27129 #close
Change-Id: Id233935ea3d13e71c75a0861834c5936c3700ef9
Diffstat (limited to 'res/res_agi.c')
-rw-r--r-- | res/res_agi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index e8497f7ca..466063557 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -2393,7 +2393,7 @@ static int handle_waitfordigit(struct ast_channel *chan, AGI *agi, int argc, con return RESULT_SHOWUSAGE; if (sscanf(argv[3], "%30d", &to) != 1) return RESULT_SHOWUSAGE; - res = ast_waitfordigit_full(chan, to, agi->audio, agi->ctrl); + res = ast_waitfordigit_full(chan, to, NULL, agi->audio, agi->ctrl); ast_agi_send(agi->fd, chan, "200 result=%d\n", res); return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE; } @@ -2673,7 +2673,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, const /* If the user didnt press a key, wait for digitTimeout*/ if (res == 0 ) { - res = ast_waitfordigit_full(chan, timeout, agi->audio, agi->ctrl); + res = ast_waitfordigit_full(chan, timeout, NULL, agi->audio, agi->ctrl); /* Make sure the new result is in the escape digits of the GET OPTION */ if ( !strchr(edigits,res) ) res=0; |