[asterisk-commits] mmichelson: branch mmichelson/atxfer_features r390582 - in /team/mmichelson/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 5 15:29:45 CDT 2013


Author: mmichelson
Date: Wed Jun  5 15:29:42 2013
New Revision: 390582

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390582
Log:
REsolve conflict and reset automerge.


Modified:
    team/mmichelson/atxfer_features/   (props changed)
    team/mmichelson/atxfer_features/bridges/bridge_builtin_interval_features.c
    team/mmichelson/atxfer_features/include/asterisk/bridging_features.h
    team/mmichelson/atxfer_features/main/bridging.c
    team/mmichelson/atxfer_features/main/bridging_basic.c
    team/mmichelson/atxfer_features/main/features.c
    team/mmichelson/atxfer_features/res/parking/parking_bridge_features.c

Propchange: team/mmichelson/atxfer_features/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/mmichelson/atxfer_features/
------------------------------------------------------------------------------
    automerge-email = mmichelson at digium.com

Propchange: team/mmichelson/atxfer_features/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jun  5 15:29:42 2013
@@ -1,1 +1,1 @@
-/trunk:1-390521
+/trunk:1-390569

Modified: team/mmichelson/atxfer_features/bridges/bridge_builtin_interval_features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/bridges/bridge_builtin_interval_features.c?view=diff&rev=390582&r1=390581&r2=390582
==============================================================================
--- team/mmichelson/atxfer_features/bridges/bridge_builtin_interval_features.c (original)
+++ team/mmichelson/atxfer_features/bridges/bridge_builtin_interval_features.c Wed Jun  5 15:29:42 2013
@@ -146,7 +146,8 @@
 	ast_string_field_set(dst, connect_sound, src->connect_sound);
 }
 
-static int bridge_builtin_set_limits(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, int remove_on_pull)
+static int bridge_builtin_set_limits(struct ast_bridge_features *features,
+		struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags)
 {
 	struct ast_bridge_features_limits *feature_limits;
 
@@ -173,7 +174,7 @@
 
 /* BUGBUG feature interval hooks need to be reimplemented to be more stand alone. */
 	if (ast_bridge_interval_hook(features, feature_limits->duration,
-		bridge_features_duration_callback, feature_limits, NULL, remove_on_pull)) {
+		bridge_features_duration_callback, feature_limits, NULL, remove_flags)) {
 		ast_log(LOG_ERROR, "Failed to schedule the duration limiter to the bridge channel.\n");
 		return -1;
 	}
@@ -182,14 +183,14 @@
 
 	if (!ast_strlen_zero(feature_limits->connect_sound)) {
 		if (ast_bridge_interval_hook(features, 1,
-			bridge_features_connect_callback, feature_limits, NULL, remove_on_pull)) {
+			bridge_features_connect_callback, feature_limits, NULL, remove_flags)) {
 			ast_log(LOG_WARNING, "Failed to schedule connect sound to the bridge channel.\n");
 		}
 	}
 
 	if (feature_limits->warning && feature_limits->warning < feature_limits->duration) {
 		if (ast_bridge_interval_hook(features, feature_limits->duration - feature_limits->warning,
-			bridge_features_warning_callback, feature_limits, NULL, remove_on_pull)) {
+			bridge_features_warning_callback, feature_limits, NULL, remove_flags)) {
 			ast_log(LOG_WARNING, "Failed to schedule warning sound playback to the bridge channel.\n");
 		}
 	}

Modified: team/mmichelson/atxfer_features/include/asterisk/bridging_features.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/include/asterisk/bridging_features.h?view=diff&rev=390582&r1=390581&r2=390582
==============================================================================
--- team/mmichelson/atxfer_features/include/asterisk/bridging_features.h (original)
+++ team/mmichelson/atxfer_features/include/asterisk/bridging_features.h Wed Jun  5 15:29:42 2013
@@ -182,7 +182,7 @@
 
 enum ast_bridge_hook_remove_flags {
 	/*! The hook is removed when the channel is pulled from the bridge. */
-	AST_BRIDGE_HOOK_REMOVE_ON_PULL,
+	AST_BRIDGE_HOOK_REMOVE_ON_PULL = (1 << 0),
 	/*! The hook is removed when the bridge's personality changes. */
 	AST_BRIDGE_HOOK_REMOVE_ON_PERSONALITY_CHANGE,
 };
@@ -340,12 +340,13 @@
  *
  * \param features Bridge features structure
  * \param limits Configured limits applicable to the channel
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
- *
- * \retval 0 on success
- * \retval -1 on failure
- */
-typedef int (*ast_bridge_builtin_set_limits_fn)(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, int remove_on_pull);
+ * \param remove_flags Dictates what situations the hook should be removed.
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ */
+typedef int (*ast_bridge_builtin_set_limits_fn)(struct ast_bridge_features *features,
+		struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief Register a handler for a built in interval feature
@@ -392,7 +393,7 @@
  * \param callback Function to execute upon activation
  * \param hook_pvt Unique data
  * \param destructor Optional destructor callback for hook_pvt data
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval 0 on success
  * \retval -1 on failure
@@ -413,7 +414,7 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull);
+	enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief Attach a bridge channel leave hook to a bridge features structure
@@ -422,7 +423,7 @@
  * \param callback Function to execute upon activation
  * \param hook_pvt Unique data
  * \param destructor Optional destructor callback for hook_pvt data
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval 0 on success
  * \retval -1 on failure
@@ -443,7 +444,7 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull);
+	enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief Attach a hangup hook to a bridge features structure
@@ -452,7 +453,7 @@
  * \param callback Function to execute upon activation
  * \param hook_pvt Unique data
  * \param destructor Optional destructor callback for hook_pvt data
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval 0 on success
  * \retval -1 on failure
@@ -473,7 +474,7 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull);
+	enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief Attach a DTMF hook to a bridge features structure
@@ -483,7 +484,7 @@
  * \param callback Function to execute upon activation
  * \param hook_pvt Unique data
  * \param destructor Optional destructor callback for hook_pvt data
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval 0 on success
  * \retval -1 on failure
@@ -505,7 +506,7 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull);
+	enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief attach an interval hook to a bridge features structure
@@ -515,7 +516,7 @@
  * \param callback Function to execute upon activation
  * \param hook_pvt Unique data
  * \param destructor Optional destructor callback for hook_pvt data
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval 0 on success
  * \retval -1 on failure
@@ -534,7 +535,7 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull);
+	enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief Set a callback on the features structure to receive talking notifications on.
@@ -559,7 +560,7 @@
  * \param dtmf Optionally the DTMF stream to trigger the feature, if not specified it will be the default
  * \param config Configuration structure unique to the built in type
  * \param destructor Optional destructor callback for config data
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval 0 on success
  * \retval -1 on failure
@@ -581,7 +582,7 @@
 	const char *dtmf,
 	void *config,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull);
+	enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief Constructor function for ast_bridge_features_limits
@@ -608,7 +609,7 @@
  *
  * \param features Bridge features structure
  * \param limits Configured limits applicable to the channel
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval 0 on success
  * \retval -1 on failure
@@ -629,7 +630,7 @@
  * \note This API call can only be used on a features structure that will be used in association with a bridge channel.
  * \note The ast_bridge_features_limits structure must remain accessible for the lifetime of the features structure.
  */
-int ast_bridge_features_set_limits(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, int remove_on_pull);
+int ast_bridge_features_set_limits(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags);
 
 /*!
  * \brief Set a flag on a bridge channel features structure

Modified: team/mmichelson/atxfer_features/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging.c?view=diff&rev=390582&r1=390581&r2=390582
==============================================================================
--- team/mmichelson/atxfer_features/main/bridging.c (original)
+++ team/mmichelson/atxfer_features/main/bridging.c Wed Jun  5 15:29:42 2013
@@ -4383,7 +4383,7 @@
  * \param callback Function to execute upon activation
  * \param hook_pvt Unique data
  * \param destructor Optional destructor callback for hook_pvt data
- * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge.
+ * \param remove_flags Dictates what situations the hook should be removed.
  *
  * \retval hook on success.
  * \retval NULL on error.
@@ -4392,7 +4392,7 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull)
+	enum ast_bridge_hook_remove_flags remove_flags)
 {
 	struct ast_bridge_hook *hook;
 
@@ -4402,7 +4402,7 @@
 		hook->callback = callback;
 		hook->destructor = destructor;
 		hook->hook_pvt = hook_pvt;
-		ast_set_flag(&hook->remove_flags, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
+		ast_set_flag(&hook->remove_flags, remove_flags);
 	}
 
 	return hook;
@@ -4413,14 +4413,14 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull)
+	enum ast_bridge_hook_remove_flags remove_flags)
 {
 	struct ast_bridge_hook *hook;
 	int res;
 
 	/* Allocate new hook and setup it's various variables */
 	hook = bridge_hook_generic(sizeof(*hook), callback, hook_pvt, destructor,
-		remove_on_pull);
+		remove_flags);
 	if (!hook) {
 		return -1;
 	}
@@ -4437,14 +4437,14 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull)
+	enum ast_bridge_hook_remove_flags remove_flags)
 {
 	struct ast_bridge_hook *hook;
 	int res;
 
 	/* Allocate new hook and setup it's various variables */
 	hook = bridge_hook_generic(sizeof(*hook), callback, hook_pvt, destructor,
-		remove_on_pull);
+		remove_flags);
 	if (!hook) {
 		return -1;
 	}
@@ -4460,14 +4460,14 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull)
+	enum ast_bridge_hook_remove_flags remove_flags)
 {
 	struct ast_bridge_hook *hook;
 	int res;
 
 	/* Allocate new hook and setup it's various variables */
 	hook = bridge_hook_generic(sizeof(*hook), callback, hook_pvt, destructor,
-		remove_on_pull);
+		remove_flags);
 	if (!hook) {
 		return -1;
 	}
@@ -4483,14 +4483,14 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull)
+	enum ast_bridge_hook_remove_flags remove_flags)
 {
 	struct ast_bridge_hook *hook;
 	int res;
 
 	/* Allocate new hook and setup it's various variables */
 	hook = bridge_hook_generic(sizeof(*hook), callback, hook_pvt, destructor,
-		remove_on_pull);
+		remove_flags);
 	if (!hook) {
 		return -1;
 	}
@@ -4517,7 +4517,7 @@
 	ast_bridge_hook_callback callback,
 	void *hook_pvt,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull)
+	enum ast_bridge_hook_remove_flags remove_flags)
 {
 	struct ast_bridge_hook *hook;
 	int res;
@@ -4536,7 +4536,7 @@
 
 	/* Allocate new hook and setup it's various variables */
 	hook = bridge_hook_generic(sizeof(*hook), callback, hook_pvt, destructor,
-		remove_on_pull);
+		remove_flags);
 	if (!hook) {
 		return -1;
 	}
@@ -4562,7 +4562,7 @@
 	const char *dtmf,
 	void *config,
 	ast_bridge_hook_pvt_destructor destructor,
-	int remove_on_pull)
+	enum ast_bridge_hook_remove_flags remove_flags)
 {
 	if (ARRAY_LEN(builtin_features_handlers) <= feature
 		|| !builtin_features_handlers[feature]) {
@@ -4585,7 +4585,7 @@
 	 * using the built in feature's DTMF callback.  Easy as pie.
 	 */
 	return ast_bridge_dtmf_hook(features, dtmf, builtin_features_handlers[feature],
-		config, destructor, remove_on_pull);
+		config, destructor, remove_flags);
 }
 
 int ast_bridge_features_limits_construct(struct ast_bridge_features_limits *limits)
@@ -4605,13 +4605,14 @@
 	ast_string_field_free_memory(limits);
 }
 
-int ast_bridge_features_set_limits(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, int remove_on_pull)
+int ast_bridge_features_set_limits(struct ast_bridge_features *features,
+		struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags)
 {
 	if (builtin_interval_handlers[AST_BRIDGE_BUILTIN_INTERVAL_LIMITS]) {
 		ast_bridge_builtin_set_limits_fn bridge_features_set_limits_callback;
 
 		bridge_features_set_limits_callback = builtin_interval_handlers[AST_BRIDGE_BUILTIN_INTERVAL_LIMITS];
-		return bridge_features_set_limits_callback(features, limits, remove_on_pull);
+		return bridge_features_set_limits_callback(features, limits, remove_flags);
 	}
 
 	ast_log(LOG_ERROR, "Attempted to set limits without an AST_BRIDGE_BUILTIN_INTERVAL_LIMITS callback registered.\n");
@@ -4626,7 +4627,7 @@
 
 /*!
  * \internal
- * \brief ao2 object match remove_on_pull hooks.
+ * \brief ao2 object match hooks with appropriate remove_flags.
  * \since 12.0.0
  *
  * \param obj Feature hook object.
@@ -4650,7 +4651,7 @@
 
 /*!
  * \internal
- * \brief Remove all remove_on_pull hooks in the container.
+ * \brief Remove all hooks with appropriate remove_flags in the container.
  * \since 12.0.0
  *
  * \param hooks Hooks container to work on.
@@ -4666,7 +4667,7 @@
 
 /*!
  * \internal
- * \brief Remove all remove_on_pull hooks in the heap.
+ * \brief Remove all hooks in the heap with appropriate remove_flags set.
  * \since 12.0.0
  *
  * \param hooks Hooks heap to work on.

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diff&rev=390582&r1=390581&r2=390582
==============================================================================
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Wed Jun  5 15:29:42 2013
@@ -135,7 +135,7 @@
  */
 static int bridge_personality_normal_push(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap)
 {
-	if (ast_bridge_hangup_hook(bridge_channel->features, basic_hangup_hook, NULL, NULL, 1)
+	if (ast_bridge_hangup_hook(bridge_channel->features, basic_hangup_hook, NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL)
 		|| ast_bridge_channel_setup_features(bridge_channel)) {
 		return -1;
 	}

Modified: team/mmichelson/atxfer_features/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/features.c?view=diff&rev=390582&r1=390581&r2=390582
==============================================================================
--- team/mmichelson/atxfer_features/main/features.c (original)
+++ team/mmichelson/atxfer_features/main/features.c Wed Jun  5 15:29:42 2013
@@ -3246,33 +3246,35 @@
 				&& !ast_strlen_zero(dtmf)) {
 		/* Add atxfer and blind transfer. */
 /* BUGBUG need to supply a blind transfer structure and destructor to use other than defaults */
-			res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_BLINDTRANSFER, dtmf, NULL, NULL, 1);
+			res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_BLINDTRANSFER, dtmf,
+					NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
 		}
 		if (!builtin_feature_get_exten(chan, "atxfer", dtmf, sizeof(dtmf)) &&
 				!ast_strlen_zero(dtmf)) {
 /* BUGBUG need to supply an attended transfer structure and destructor to use other than defaults */
-			res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_ATTENDEDTRANSFER, dtmf, NULL, NULL, 1);
+			res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_ATTENDEDTRANSFER, dtmf,
+					NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
 		}
 	}
 	if (ast_test_flag(flags, AST_FEATURE_DISCONNECT) &&
 			!builtin_feature_get_exten(chan, "disconnect", dtmf, sizeof(dtmf)) &&
 			!ast_strlen_zero(dtmf)) {
-		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_HANGUP, dtmf, NULL, NULL, 1);
+		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_HANGUP, dtmf, NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
 	}
 	if (ast_test_flag(flags, AST_FEATURE_PARKCALL) &&
 			!builtin_feature_get_exten(chan, "parkcall", dtmf, sizeof(dtmf)) &&
 			!ast_strlen_zero(dtmf)) {
-		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_PARKCALL, dtmf, NULL, NULL, 1);
+		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_PARKCALL, dtmf, NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
 	}
 	if (ast_test_flag(flags, AST_FEATURE_AUTOMON) &&
 			!builtin_feature_get_exten(chan, "automon", dtmf, sizeof(dtmf)) &&
 			!ast_strlen_zero(dtmf)) {
-		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_AUTOMON, dtmf, NULL, NULL, 1);
+		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_AUTOMON, dtmf, NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
 	}
 	if (ast_test_flag(flags, AST_FEATURE_AUTOMIXMON) &&
 			!builtin_feature_get_exten(chan, "automixmon", dtmf, sizeof(dtmf)) &&
 			!ast_strlen_zero(dtmf)) {
-		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_AUTOMIXMON, dtmf, NULL, NULL, 1);
+		res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_AUTOMIXMON, dtmf, NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
 	}
 
 #if 0	/* BUGBUG don't report errors untill all of the builtin features are supported. */

Modified: team/mmichelson/atxfer_features/res/parking/parking_bridge_features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/res/parking/parking_bridge_features.c?view=diff&rev=390582&r1=390581&r2=390582
==============================================================================
--- team/mmichelson/atxfer_features/res/parking/parking_bridge_features.c (original)
+++ team/mmichelson/atxfer_features/res/parking/parking_bridge_features.c Wed Jun  5 15:29:42 2013
@@ -458,7 +458,7 @@
 	ao2_ref(user, +1);
 
 	if (ast_bridge_interval_hook(features, time_limit,
-		parking_duration_callback, user, parking_duration_cb_destroyer, 1)) {
+		parking_duration_callback, user, parking_duration_cb_destroyer, AST_BRIDGE_HOOK_REMOVE_ON_PULL)) {
 		ast_log(LOG_ERROR, "Failed to apply duration limits to the parking call.\n");
 	}
 }




More information about the asterisk-commits mailing list