[asterisk-commits] mmichelson: branch mmichelson/atxfer_features r392191 - /team/mmichelson/atxf...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 18 18:02:08 CDT 2013


Author: mmichelson
Date: Tue Jun 18 18:02:06 2013
New Revision: 392191

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392191
Log:
Set appropriate bridge flags when changing personalities.

A transfer bridge cannot dissolve when it becomes empty or
when a channel hangs up. Instead, the monitoring thread will
let the bridge know when to dissolve.


Modified:
    team/mmichelson/atxfer_features/main/bridging_basic.c

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=392191&r1=392190&r2=392191
==============================================================================
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Tue Jun 18 18:02:06 2013
@@ -42,6 +42,12 @@
 #include "asterisk/file.h"
 #include "asterisk/app.h"
 
+#define NORMAL_FLAGS	AST_BRIDGE_FLAG_DISSOLVE_HANGUP | AST_BRIDGE_FLAG_DISSOLVE_EMPTY \
+			| AST_BRIDGE_FLAG_SMART
+
+#define TRANSFER_FLAGS AST_BRIDGE_FLAG_SMART
+ 
+
 /* ------------------------------------------------------------------- */
 
 static const struct ast_datastore_info dtmf_features_info = {
@@ -175,7 +181,7 @@
 	.push = bridge_personality_normal_push,
 };
 
-static struct bridge_basic_personality __attribute__((unused)) bridge_atxfer_personality = {
+static struct bridge_basic_personality bridge_atxfer_personality = {
 	.name = "atxfer",
 	.push = bridge_personality_atxfer_push,
 };
@@ -187,9 +193,7 @@
 	bridge = ast_bridge_alloc(sizeof(struct ast_bridge), &ast_bridge_basic_v_table);
 	bridge = ast_bridge_base_init(bridge,
 		AST_BRIDGE_CAPABILITY_NATIVE | AST_BRIDGE_CAPABILITY_1TO1MIX
-			| AST_BRIDGE_CAPABILITY_MULTIMIX,
-		AST_BRIDGE_FLAG_DISSOLVE_HANGUP | AST_BRIDGE_FLAG_DISSOLVE_EMPTY
-			| AST_BRIDGE_FLAG_SMART);
+			| AST_BRIDGE_CAPABILITY_MULTIMIX, NORMAL_FLAGS);
 	bridge->personality = &bridge_normal_personality;
 	bridge = ast_bridge_register(bridge);
 	return bridge;
@@ -213,6 +217,8 @@
 
 	if (bridge->personality != &bridge_atxfer_personality) {
 		bridge->personality = &bridge_atxfer_personality;
+		ast_clear_flag(&bridge->feature_flags, AST_FLAG_ALL);
+		ast_set_flag(&bridge->feature_flags, TRANSFER_FLAGS);
 		remove_hooks_on_personality_change(bridge);
 	}
 }
@@ -225,6 +231,8 @@
 
 	if (bridge->personality != &bridge_normal_personality) {
 		bridge->personality = &bridge_normal_personality;
+		ast_clear_flag(&bridge->feature_flags, AST_FLAG_ALL);
+		ast_set_flag(&bridge->feature_flags, BASIC_FLAGS);
 		remove_hooks_on_personality_change(bridge);
 	}
 }




More information about the asterisk-commits mailing list