From 6b138046e7db59e975fc06ee3aea54fe0c143f5d Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Wed, 12 Jul 2017 14:24:36 -0400 Subject: 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 --- include/asterisk/channel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/asterisk/channel.h') diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 197cc990d..cb2e0e6a4 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -2219,11 +2219,12 @@ int ast_waitfordigit(struct ast_channel *c, int ms); * Same as ast_waitfordigit() with audio fd for outputting read audio and ctrlfd to monitor for reading. * \param c channel to wait for a digit on * \param ms how many milliseconds to wait (<0 for indefinite). + * \param breakon string of DTMF digits to break upon or NULL for any. * \param audiofd audio file descriptor to write to if audio frames are received * \param ctrlfd control file descriptor to monitor for reading * \return Returns 1 if ctrlfd becomes available */ -int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int ctrlfd); +int ast_waitfordigit_full(struct ast_channel *c, int ms, const char *breakon, int audiofd, int ctrlfd); /*! * \brief Reads multiple digits -- cgit v1.2.3