[asterisk-commits] rmudgett: branch group/bridge_construction r386015 - in /team/group/bridge_co...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 18 11:25:16 CDT 2013
Author: rmudgett
Date: Thu Apr 18 11:25:14 2013
New Revision: 386015
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386015
Log:
Update some bridging comments.
Modified:
team/group/bridge_construction/include/asterisk/bridging.h
team/group/bridge_construction/main/bridging.c
Modified: team/group/bridge_construction/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/include/asterisk/bridging.h?view=diff&rev=386015&r1=386014&r2=386015
==============================================================================
--- team/group/bridge_construction/include/asterisk/bridging.h (original)
+++ team/group/bridge_construction/include/asterisk/bridging.h Thu Apr 18 11:25:14 2013
@@ -130,7 +130,12 @@
struct ast_channel *chan;
/*! Asterisk channel we are swapping with (if swapping) */
struct ast_channel *swap;
- /*! Bridge this channel is participating in */
+ /*!
+ * \brief Bridge this channel is participating in
+ *
+ * \note The bridge pointer cannot change while the bridge or
+ * bridge_channel is locked.
+ */
struct ast_bridge *bridge;
/*!
* \brief Bridge class private channel data.
@@ -150,6 +155,7 @@
void *tech_pvt;
/*! Thread handling the bridged channel (Needed by ast_bridge_depart) */
pthread_t thread;
+ /* v-- These flags change while the bridge is locked or before the channel is in the bridge. */
/*! TRUE if the channel is in a bridge. */
unsigned int in_bridge:1;
/*! TRUE if the channel just joined the bridge. */
@@ -158,6 +164,7 @@
unsigned int suspended:1;
/*! TRUE if the channel must wait for an ast_bridge_depart to reclaim the channel. */
unsigned int depart_wait:1;
+ /* ^-- These flags change while the bridge is locked or before the channel is in the bridge. */
/*! Features structure for features that are specific to this channel */
struct ast_bridge_features *features;
/*! Technology optimization parameters used by bridging technologies capable of
@@ -630,7 +637,7 @@
*
* \note The features parameter must be NULL or obtained by
* ast_bridge_features_new(). You must not dereference features
- * after calling.
+ * after calling even if the call fails.
*
* \retval 0 on success
* \retval -1 on failure
Modified: team/group/bridge_construction/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/main/bridging.c?view=diff&rev=386015&r1=386014&r2=386015
==============================================================================
--- team/group/bridge_construction/main/bridging.c (original)
+++ team/group/bridge_construction/main/bridging.c Thu Apr 18 11:25:14 2013
@@ -209,10 +209,7 @@
ao2_ref(bridge, +1);
ast_bridge_channel_unlock(bridge_channel);
- /*
- * The bridge pointer cannot change while the bridge or
- * bridge_channel is locked.
- */
+ /* Lock the bridge and see if it is still the bridge we need to lock. */
ast_bridge_lock(bridge);
if (bridge == bridge_channel->bridge) {
ao2_ref(bridge, -1);
@@ -691,6 +688,12 @@
static void bridge_channel_write_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
{
ast_bridge_channel_lock_bridge(bridge_channel);
+/*
+ * BUGBUG need to implement a deferred write queue for when there is no peer channel in the bridge (yet or it was kicked).
+ *
+ * The tech decides if a frame needs to be pushed back for deferral.
+ * simple_bridge/native_bridge are likely the only techs that will do this.
+ */
bridge_channel->bridge->technology->write(bridge_channel->bridge, bridge_channel, frame);
ast_bridge_unlock(bridge_channel->bridge);
}
@@ -3020,7 +3023,10 @@
return -1;
}
- /* We are claiming the reference held by the depart thread. */
+ /*
+ * We are claiming the reference held by the depart bridge
+ * channel thread.
+ */
ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_HANGUP);
More information about the asterisk-commits
mailing list