[asterisk-commits] file: branch file/bridging r126118 - /team/file/bridging/main/bridging.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 27 18:51:55 CDT 2008
Author: file
Date: Fri Jun 27 18:51:55 2008
New Revision: 126118
URL: http://svn.digium.com/view/asterisk?view=rev&rev=126118
Log:
Ditto. This only needs to be an internal function.
Modified:
team/file/bridging/main/bridging.c
Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=126118&r1=126117&r2=126118
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Fri Jun 27 18:51:55 2008
@@ -122,6 +122,19 @@
return 0;
}
+/*! \brief Helper function to tell the bridge thread to rebuild the bridge it is handling */
+static void bridge_rebuild(struct ast_bridge *bridge)
+{
+ /* Just set a bit to tell the bridge to rebuild, easy as pie */
+ bridge->rebuild = 1;
+
+ /* Poke the thread just in case */
+ if (bridge->thread != AST_PTHREADT_NULL && bridge->thread != AST_PTHREADT_STOP)
+ pthread_kill(bridge->thread, SIGURG);
+
+ return;
+}
+
/*! \brief Helper function to find a bridge channel given a channel */
static struct ast_bridge_channel *find_bridge_channel(struct ast_bridge *bridge, struct ast_channel *chan)
{
@@ -172,7 +185,7 @@
ast_frfree(frame);
frame = NULL;
bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_FEATURE);
- ast_bridge_rebuild(bridge);
+ bridge_rebuild(bridge);
break;
}
}
@@ -703,7 +716,7 @@
}
/* Tell the bridge to rebuild as we are joining in */
- ast_bridge_rebuild(bridge_channel->bridge);
+ bridge_rebuild(bridge_channel->bridge);
/* Actually execute the respective threading model, and keep our bridge thread alive */
while (state == AST_BRIDGE_CHANNEL_STATE_WAIT) {
@@ -726,7 +739,7 @@
}
/* Tell the bridge to rebuild as we are leaving */
- ast_bridge_rebuild(bridge_channel->bridge);
+ bridge_rebuild(bridge_channel->bridge);
/* Tell the bridge technology we are leaving so they tear us down */
if (bridge_channel->bridge->technology->leave) {
@@ -890,18 +903,6 @@
return 0;
}
-int ast_bridge_rebuild(struct ast_bridge *bridge)
-{
- /* Right now this is simple... just set an integer */
- bridge->rebuild = 1;
-
- /* Poke the thread just in case */
- if (bridge->thread != AST_PTHREADT_NULL && bridge->thread != AST_PTHREADT_STOP)
- pthread_kill(bridge->thread, SIGURG);
-
- return 0;
-}
-
int ast_bridge_merge(struct ast_bridge *bridge0, struct ast_bridge *bridge1)
{
struct ast_bridge_channel *bridge_channel = NULL;
@@ -934,8 +935,8 @@
}
/* Tell each bridge that something is going to happen */
- ast_bridge_rebuild(bridge0);
- ast_bridge_rebuild(bridge1);
+ bridge_rebuild(bridge0);
+ bridge_rebuild(bridge1);
/* Move channels from bridge1 over to bridge0 */
while ((bridge_channel = AST_LIST_REMOVE_HEAD(&bridge1->channels, entry))) {
@@ -994,7 +995,7 @@
return -1;
}
- ast_bridge_rebuild(bridge);
+ bridge_rebuild(bridge);
bridge_channel->suspended = 1;
@@ -1018,7 +1019,7 @@
return -1;
}
- ast_bridge_rebuild(bridge);
+ bridge_rebuild(bridge);
bridge_channel->suspended = 0;
@@ -1298,7 +1299,7 @@
struct ast_bridge_channel *bridge_channel = NULL;
/* Trigger a rebuild now just in case */
- ast_bridge_rebuild(bridge);
+ bridge_rebuild(bridge);
AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
if (bridge_channel->chan == chan)
More information about the asterisk-commits
mailing list