aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-08 21:44:58 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-08 21:44:58 +0000
commita4803d15a244be2cbd7f852c4fcefe71f5ffaabc (patch)
treed42170fbe8a83884d32f1ed09f238da151554071 /main/rtp.c
parent21b3ffbe757d2c93610ab1c069116399ef4fdaee (diff)
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: http://svn.digium.com/svn/asterisk/trunk@78683 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c
index d8d99012f..465755afe 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -3212,6 +3212,8 @@ static enum ast_bridge_result bridge_native_loop(struct ast_channel *c0, struct
ast_channel_unlock(c0);
ast_channel_unlock(c1);
+ ast_poll_channel_add(c0, c1);
+
/* Throw our channels into the structure and enter the loop */
cs[0] = c0;
cs[1] = c1;
@@ -3228,6 +3230,7 @@ static enum ast_bridge_result bridge_native_loop(struct ast_channel *c0, struct
if (c1->tech_pvt == pvt1)
if (pr1->set_rtp_peer(c1, NULL, NULL, NULL, 0, 0))
ast_log(LOG_WARNING, "Channel '%s' failed to break RTP bridge\n", c1->name);
+ ast_poll_channel_del(c0, c1);
return AST_BRIDGE_RETRY;
}
@@ -3313,6 +3316,7 @@ static enum ast_bridge_result bridge_native_loop(struct ast_channel *c0, struct
if (c1->tech_pvt == pvt1)
if (pr1->set_rtp_peer(c1, NULL, NULL, NULL, 0, 0))
ast_log(LOG_WARNING, "Channel '%s' failed to break RTP bridge\n", c1->name);
+ ast_poll_channel_del(c0, c1);
return AST_BRIDGE_COMPLETE;
} else if ((fr->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS)) {
if ((fr->subclass == AST_CONTROL_HOLD) ||
@@ -3353,11 +3357,15 @@ static enum ast_bridge_result bridge_native_loop(struct ast_channel *c0, struct
ast_frfree(fr);
}
/* Swap priority */
+#ifndef HAVE_EPOLL
cs[2] = cs[0];
cs[0] = cs[1];
cs[1] = cs[2];
+#endif
}
+ ast_poll_channel_del(c0, c1);
+
if (pr0->set_rtp_peer(c0, NULL, NULL, NULL, 0, 0))
ast_log(LOG_WARNING, "Channel '%s' failed to break RTP bridge\n", c0->name);
if (pr1->set_rtp_peer(c1, NULL, NULL, NULL, 0, 0))
@@ -3488,6 +3496,8 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
ast_channel_unlock(c0);
ast_channel_unlock(c1);
+ ast_poll_channel_add(c0, c1);
+
/* Go into a loop forwarding frames until we don't need to anymore */
cs[0] = c0;
cs[1] = c1;
@@ -3591,6 +3601,8 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
p2p_set_bridge(p0, NULL);
p2p_set_bridge(p1, NULL);
+ ast_poll_channel_del(c0, c1);
+
return res;
}