mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
Fix timeouts for ast_waitfordigit[_full].
ast_waitfordigit_full would simply pass its timeout to ast_waitfor_nandfds, expecting it to decrement the timeout by however many milliseconds were waited. This is a problem if it consistently waits less than 1ms. The timeout will never be decremented, and we wait... FOREVER! This patch makes ast_waitfordigit_full manage the timeout itself. It maintains the previously undocumented behavior that negative timeouts wait forever. (closes issue ASTERISK-20375) Reported by: Mark Michelson Tested by: Mark Michelson Review: https://reviewboard.asterisk.org/r/2109/ ........ Merged revisions 373024 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 373025 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 373029 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1896,7 +1896,7 @@ char *ast_recvtext(struct ast_channel *chan, int timeout);
|
||||
/*!
|
||||
* \brief Waits for a digit
|
||||
* \param c channel to wait for a digit on
|
||||
* \param ms how many milliseconds to wait
|
||||
* \param ms how many milliseconds to wait (<0 for indefinite).
|
||||
* \return Returns <0 on error, 0 on no entry, and the digit on success.
|
||||
*/
|
||||
int ast_waitfordigit(struct ast_channel *c, int ms);
|
||||
@@ -1905,7 +1905,7 @@ int ast_waitfordigit(struct ast_channel *c, int ms);
|
||||
* \brief Wait for a digit
|
||||
* 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
|
||||
* \param ms how many milliseconds to wait (<0 for indefinite).
|
||||
* \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
|
||||
|
Reference in New Issue
Block a user