[asterisk-commits] rmudgett: branch group/CCSS r242401 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 22 11:29:51 CST 2010


Author: rmudgett
Date: Fri Jan 22 11:29:48 2010
New Revision: 242401

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242401
Log:
Multiple context dialplans would not recognize if a channel was doing CC recall.

Simplified fix.  We only need to search for the channel device name in the
interface tree.

Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=242401&r1=242400&r2=242401
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Jan 22 11:29:48 2010
@@ -2868,8 +2868,7 @@
 	struct cc_recall_ds_data *recall_data;
 	struct ast_cc_interface_tree *interface_tree;
 	char device_name[AST_CHANNEL_NAME];
-	struct cc_tree_item *exten_tree_item;
-	struct ast_str *extencontext = ast_str_alloca(128);
+	struct cc_tree_item *device_tree_item;
 
 	ast_assert(core_id != NULL);
 
@@ -2907,33 +2906,19 @@
 
 	interface_tree = cc_ref(recall_data->interface_tree, "Bump refcount for tree while we search for specific channel");
 	ast_channel_get_device_name(chan, device_name, sizeof(device_name));
-	ast_str_set(&extencontext, 0, "%s@%s", S_OR(chan->macroexten, chan->exten), S_OR(chan->dialcontext, S_OR(chan->macrocontext, chan->context)));
 	ast_channel_unlock(chan);
 
-	/* Now we need to find out if the channel in question is in the list of interfaces in the
-	 * called tree. Finding a match based on the device name is not enough here. We need to find
-	 * a match based on device name and a parent extension tree item with the same extension and
-	 * context as the channel.
+	/*
+	 * Now we need to find out if the channel device name
+	 * is in the list of interfaces in the called tree.
 	 */
 	AST_LIST_LOCK(interface_tree);
-	AST_LIST_TRAVERSE(interface_tree, exten_tree_item, next) {
-		/* First we try to find an extension interface with the proper
-		 * exten and context.
-		 */
-		if (!strcmp(exten_tree_item->interface->name, ast_str_buffer(extencontext))) {
-			/* Found a matching extension, now see if the channel in question is one
-			 * of its children
-			 */
-			struct cc_tree_item *device_tree_item = exten_tree_item;
-			while ((device_tree_item = AST_LIST_NEXT(device_tree_item, next))) {
-				if ((device_tree_item->parent_id == exten_tree_item->id) &&
-						!strcmp(device_tree_item->interface->name, device_name)) {
-					/* BOOM! Device is in the tree! We have a winner! */
-					*core_id = recall_data->core_id;
-					AST_LIST_UNLOCK(interface_tree);
-					return 1;
-				}
-			}
+	AST_LIST_TRAVERSE(interface_tree, device_tree_item, next) {
+		if (!strcmp(device_tree_item->interface->name, device_name)) {
+			/* BOOM! Device is in the tree! We have a winner! */
+			*core_id = recall_data->core_id;
+			AST_LIST_UNLOCK(interface_tree);
+			return 1;
 		}
 	}
 	AST_LIST_UNLOCK(interface_tree);




More information about the asterisk-commits mailing list