diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-03 14:14:43 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-03 14:14:43 +0000 |
commit | 344ae791b9ec042468b2932ffc7780491f79c096 (patch) | |
tree | f029c97cdf05f68ee3ab13de17bf25b234316efc /apps/app_dial.c | |
parent | 814e0a28cf1986ad61ae7ad7deae04f052b2c466 (diff) |
Remove the file descriptors from the main poll channel when the channel is hung up during the dialing attempt, and make sure a channel exists before trying to remove it at the end.
(closes issue #11441)
Reported by: blitzrage
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90508 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 265b49be7..a071f5e0f 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -646,6 +646,9 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, f = ast_read(winner); if (!f) { in->hangupcause = c->hangupcause; +#ifdef HAVE_EPOLL + ast_poll_channel_del(in, c); +#endif ast_hangup(c); c = o->chan = NULL; ast_clear_flag64(o, DIAL_STILLGOING); @@ -852,8 +855,10 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } #ifdef HAVE_EPOLL - for (epollo = outgoing; epollo; epollo = epollo->next) - ast_poll_channel_del(in, epollo->chan); + for (epollo = outgoing; epollo; epollo = epollo->next) { + if (epollo->chan) + ast_poll_channel_del(in, epollo->chan); + } #endif return peer; |