[asterisk-commits] rmudgett: branch rmudgett/bridge_phase r395180 - in /team/rmudgett/bridge_pha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 23 13:12:03 CDT 2013


Author: rmudgett
Date: Tue Jul 23 13:12:01 2013
New Revision: 395180

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395180
Log:
First step in making talker detection like the other bridge hooks.

Modified:
    team/rmudgett/bridge_phase/include/asterisk/bridging_features.h
    team/rmudgett/bridge_phase/main/bridging.c

Modified: team/rmudgett/bridge_phase/include/asterisk/bridging_features.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/include/asterisk/bridging_features.h?view=diff&rev=395180&r1=395179&r2=395180
==============================================================================
--- team/rmudgett/bridge_phase/include/asterisk/bridging_features.h (original)
+++ team/rmudgett/bridge_phase/include/asterisk/bridging_features.h Tue Jul 23 13:12:01 2013
@@ -190,8 +190,6 @@
 /* BUGBUG Need to be able to selectively remove DTMF, hangup, and interval hooks. */
 /*! \brief Structure that is the essence of a feature hook. */
 struct ast_bridge_hook {
-	/*! Linked list information */
-	AST_LIST_ENTRY(ast_bridge_hook) entry;
 	/*! Callback that is called when hook is tripped */
 	ast_bridge_hook_callback callback;
 	/*! Callback to destroy hook_pvt data right before destruction. */
@@ -211,6 +209,15 @@
 
 #define BRIDGE_FEATURES_INTERVAL_RATE 10
 
+struct talker_detection_hook {
+	/*! Callback to indicate when a bridge channel has started and stopped talking */
+	ast_bridge_talking_indicate_callback callback;
+	/*! Callback to destroy any pvt data stored for the talker. */
+	ast_bridge_talking_indicate_destructor destructor;
+	/*! Talker callback pvt data */
+	void *pvt_data;
+};
+
 /*!
  * \brief Structure that contains features information
  */
@@ -229,12 +236,8 @@
 	struct ast_timer *interval_timer;
 	/*! Limits feature data */
 	struct ast_bridge_features_limits *limits;
-	/*! Callback to indicate when a bridge channel has started and stopped talking */
-	ast_bridge_talking_indicate_callback talker_cb;
-	/*! Callback to destroy any pvt data stored for the talker. */
-	ast_bridge_talking_indicate_destructor talker_destructor_cb;
-	/*! Talker callback pvt data */
-	void *talker_pvt_data;
+	/*! Start/stop talking detection hook. */
+	struct talker_detection_hook talker_hook;
 	/*! Feature flags that are enabled */
 	struct ast_flags feature_flags;
 	/*! Used to assign the sequence number to the next interval hook added. */

Modified: team/rmudgett/bridge_phase/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/bridging.c?view=diff&rev=395180&r1=395179&r2=395180
==============================================================================
--- team/rmudgett/bridge_phase/main/bridging.c (original)
+++ team/rmudgett/bridge_phase/main/bridging.c Tue Jul 23 13:12:01 2013
@@ -2577,8 +2577,8 @@
 {
 	struct ast_bridge_features *features = bridge_channel->features;
 
-	if (features->talker_cb) {
-		features->talker_cb(bridge_channel, features->talker_pvt_data, talking);
+	if (features->talker_hook.callback) {
+		features->talker_hook.callback(bridge_channel, features->talker_hook.pvt_data, talking);
 	}
 }
 
@@ -5412,9 +5412,9 @@
 	ast_bridge_talking_indicate_destructor talker_destructor,
 	void *pvt_data)
 {
-	features->talker_cb = talker_cb;
-	features->talker_destructor_cb = talker_destructor;
-	features->talker_pvt_data = pvt_data;
+	features->talker_hook.callback = talker_cb;
+	features->talker_hook.destructor = talker_destructor;
+	features->talker_hook.pvt_data = pvt_data;
 }
 
 int ast_bridge_interval_hook(struct ast_bridge_features *features,
@@ -5739,9 +5739,9 @@
 		features->limits = NULL;
 	}
 
-	if (features->talker_destructor_cb && features->talker_pvt_data) {
-		features->talker_destructor_cb(features->talker_pvt_data);
-		features->talker_pvt_data = NULL;
+	if (features->talker_hook.destructor && features->talker_hook.pvt_data) {
+		features->talker_hook.destructor(features->talker_hook.pvt_data);
+		features->talker_hook.pvt_data = NULL;
 	}
 
 	/* Destroy the leave hooks container. */




More information about the asterisk-commits mailing list