|
|
@ -1991,12 +1991,14 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
|
|
|
|
if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
|
|
|
|
if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
/* Wait for a digit, no more than ms milliseconds total. */
|
|
|
|
/* Wait for a digit, no more than ms milliseconds total. */
|
|
|
|
|
|
|
|
|
|
|
|
while (ms) {
|
|
|
|
while (ms) {
|
|
|
|
struct ast_channel *rchan;
|
|
|
|
struct ast_channel *rchan;
|
|
|
|
int outfd;
|
|
|
|
int outfd=-1;
|
|
|
|
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
errno = 0;
|
|
|
|
rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
|
|
|
|
rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
|
|
|
|
|
|
|
|
|
|
|
|
if (!rchan && outfd < 0 && ms) {
|
|
|
|
if (!rchan && outfd < 0 && ms) {
|
|
|
|
if (errno == 0 || errno == EINTR)
|
|
|
|
if (errno == 0 || errno == EINTR)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -2004,6 +2006,7 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
} else if (outfd > -1) {
|
|
|
|
} else if (outfd > -1) {
|
|
|
|
/* The FD we were watching has something waiting */
|
|
|
|
/* The FD we were watching has something waiting */
|
|
|
|
|
|
|
|
ast_log(LOG_WARNING, "The FD we were waiting for has something waiting. Waitfordigit returning numeric 1\n");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
} else if (rchan) {
|
|
|
|
} else if (rchan) {
|
|
|
|
int res;
|
|
|
|
int res;
|
|
|
|