mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Add support for using epoll instead of poll. This should increase scalability and is done in such a way that we should be able to add support for other poll() replacements.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -560,6 +560,9 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
struct ast_channel *peer = NULL;
|
||||
/* single is set if only one destination is enabled */
|
||||
int single = outgoing && !outgoing->next && !ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK);
|
||||
#ifdef HAVE_EPOLL
|
||||
struct chanlist *epollo;
|
||||
#endif
|
||||
|
||||
if (single) {
|
||||
/* Turn off hold music, etc */
|
||||
@@ -567,7 +570,11 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
/* If we are calling a single channel, make them compatible for in-band tone purpose */
|
||||
ast_channel_make_compatible(outgoing->chan, in);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_EPOLL
|
||||
for (epollo = outgoing; epollo; epollo = epollo->next)
|
||||
ast_poll_channel_add(in, epollo->chan);
|
||||
#endif
|
||||
|
||||
while (*to && !peer) {
|
||||
struct chanlist *o;
|
||||
@@ -814,6 +821,11 @@ 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);
|
||||
#endif
|
||||
|
||||
return peer;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user