channel: Remove old epoll support and fixed max number of file descriptors.

This change removes the old epoll support which has not been used or
maintained in quite some time.

The fixed number of file descriptors on a channel has also been removed.
File descriptors are now contained in a growable vector. This can be
used like before by specifying a specific position to store a file
descriptor at or using a new API call, ast_channel_fd_add, which adds
a file descriptor to the channel and returns its position.

Tests have been added which cover the growing behavior of the vector
and the new API call.

ASTERISK-26885

Change-Id: I1a754b506c009b83dfdeeb08c2d2815db30ef928
This commit is contained in:
Joshua Colp
2017-03-08 13:24:46 +00:00
parent f5603cb1ec
commit 5d938045d4
7 changed files with 201 additions and 405 deletions

View File

@@ -1186,9 +1186,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
int prestart = num.busy + num.congestion + num.nochan;
int orig = *to;
struct ast_channel *peer = NULL;
#ifdef HAVE_EPOLL
struct chanlist *epollo;
#endif
struct chanlist *outgoing = AST_LIST_FIRST(out_chans);
/* single is set if only one destination is enabled */
int single = outgoing && !AST_LIST_NEXT(outgoing, node);
@@ -1227,12 +1224,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
is_cc_recall = ast_cc_is_recall(in, &cc_recall_core_id, NULL);
#ifdef HAVE_EPOLL
AST_LIST_TRAVERSE(out_chans, epollo, node) {
ast_poll_channel_add(in, epollo->chan);
}
#endif
while ((*to = ast_remaining_ms(start, orig)) && !peer) {
struct chanlist *o;
int pos = 0; /* how many channels do we handle */
@@ -1359,9 +1350,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
f = ast_read(winner);
if (!f) {
ast_channel_hangupcause_set(in, ast_channel_hangupcause(c));
#ifdef HAVE_EPOLL
ast_poll_channel_del(in, c);
#endif
ast_channel_publish_dial(in, c, NULL, ast_hangup_cause_to_dial_status(ast_channel_hangupcause(c)));
ast_hangup(c);
c = o->chan = NULL;
@@ -1786,13 +1774,6 @@ skip_frame:;
publish_dial_end_event(in, out_chans, NULL, "NOANSWER");
}
#ifdef HAVE_EPOLL
AST_LIST_TRAVERSE(out_chans, epollo, node) {
if (epollo->chan)
ast_poll_channel_del(in, epollo->chan);
}
#endif
if (is_cc_recall) {
ast_cc_completed(in, "Recall completed!");
}