diff options
author | Mark Michelson <mmichelson@digium.com> | 2007-09-05 21:59:52 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2007-09-05 21:59:52 +0000 |
commit | e9548619cf0fb42fba6892f3ac8601c88c37e66f (patch) | |
tree | b9497fcc47be8cfd441085086987f146f0582ebf | |
parent | 9169ac8ef4553a297a91540106fad22a67c6299e (diff) |
Not having this epoll specific code in wait_for_answer was causing app_queue to infinitely loop.
This makes it so it doesn't. Thanks to file for pointing out where the problem was and showing
a similar function in app_dial as an example of how to fix it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | apps/app_queue.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index fde483895..6054670a6 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2041,9 +2041,16 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte char on[80] = ""; char membername[80] = ""; long starttime = 0; - long endtime = 0; + long endtime = 0; +#ifdef HAVE_EPOLL + struct callattempt *epollo; +#endif starttime = (long) time(NULL); +#ifdef HAVE_EPOLL + for (epollo = outgoing; epollo; epollo = epollo->q_next) + ast_poll_channel_add(in, epollo->chan); +#endif while (*to && !peer) { int numlines, retry, pos = 1; @@ -2248,6 +2255,11 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte rna(orig, qe, on, membername); } +#ifdef HAVE_EPOLL + for(epollo = outgoing; epollo; epollo = epollo->q_next) + ast_poll_channel_del(in, epollo->chan); +#endif + return peer; } |