diff --git a/channel.c b/channel.c index 1f50afefbd..a56dfd91ee 100755 --- a/channel.c +++ b/channel.c @@ -893,8 +893,11 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, time(&now); for (x=0;xblocking = 0; - if (havewhen && c[x]->whentohangup && (now > c[x]->whentohangup)) + if (havewhen && c[x]->whentohangup && (now > c[x]->whentohangup)) { c[x]->_softhangup |= AST_SOFTHANGUP_TIMEOUT; + if (!winner) + winner = c[x]; + } for (y=0;yfds[y] > -1) { if ((FD_ISSET(c[x]->fds[y], &rfds) || FD_ISSET(c[x]->fds[y], &efds)) && !winner) {