[asterisk-commits] rmudgett: branch rmudgett/bridge_tasks r395434 - in /team/rmudgett/bridge_tas...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 25 14:13:43 CDT 2013


Author: rmudgett
Date: Thu Jul 25 14:13:41 2013
New Revision: 395434

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395434
Log:
Restore mute functions.

Modified:
    team/rmudgett/bridge_tasks/include/asterisk/bridge.h
    team/rmudgett/bridge_tasks/main/bridge.c

Modified: team/rmudgett/bridge_tasks/include/asterisk/bridge.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_tasks/include/asterisk/bridge.h?view=diff&rev=395434&r1=395433&r2=395434
==============================================================================
--- team/rmudgett/bridge_tasks/include/asterisk/bridge.h (original)
+++ team/rmudgett/bridge_tasks/include/asterisk/bridge.h Thu Jul 25 14:13:41 2013
@@ -951,6 +951,32 @@
  */
 void ast_bridge_features_remove(struct ast_bridge_features *features, enum ast_bridge_hook_remove_flags flags);
 
+/*!
+ * \brief Set the mute setting of a channel in the bridge.
+ * \since 12.0.0
+ *
+ * \param brige Bridge channel is in.
+ * \param chan Channel to set mute.
+ * \param mute_setting TRUE to enable mute
+ *
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_mute_set(struct ast_bridge *bridge, struct ast_channel *chan, int mute_setting);
+
+/*!
+ * \brief Get the mute setting of a channel in the bridge.
+ * \since 12.0.0
+ *
+ * \param brige Bridge channel is in.
+ * \param chan Channel to get mute.
+ *
+ * \retval 0 Channel is not muted.
+ * \retval 1 Channel is muted.
+ * \retval -1 on error.
+ */
+int ast_bridge_mute_get(struct ast_bridge *bridge, struct ast_channel *chan);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/rmudgett/bridge_tasks/main/bridge.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_tasks/main/bridge.c?view=diff&rev=395434&r1=395433&r2=395434
==============================================================================
--- team/rmudgett/bridge_tasks/main/bridge.c (original)
+++ team/rmudgett/bridge_tasks/main/bridge.c Thu Jul 25 14:13:41 2013
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 395432 $")
 
 #include "asterisk/logger.h"
 #include "asterisk/channel.h"
@@ -3512,6 +3512,33 @@
 	ast_bridge_unlock(bridge);
 
 	return peer;
+}
+
+int ast_bridge_mute_set(struct ast_bridge *bridge, struct ast_channel *chan, int mute_setting)
+{
+	struct ast_bridge_channel *bridge_channel;
+
+	ast_bridge_lock(bridge);
+	bridge_channel = bridge_find_channel(bridge, chan);
+	if (bridge_channel) {
+		bridge_channel->features->mute = mute_setting ? 1 : 0;
+	}
+	ast_bridge_unlock(bridge);
+	return bridge_channel ? 0 : -1;
+}
+
+int ast_bridge_mute_get(struct ast_bridge *bridge, struct ast_channel *chan)
+{
+	struct ast_bridge_channel *bridge_channel;
+	int mute = -1;
+
+	ast_bridge_lock(bridge);
+	bridge_channel = bridge_find_channel(bridge, chan);
+	if (bridge_channel) {
+		mute = bridge_channel->features->mute;
+	}
+	ast_bridge_unlock(bridge);
+	return mute;
 }
 
 /*!




More information about the asterisk-commits mailing list