[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r242422 - in /team/group/CC...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 22 15:33:36 CST 2010


Author: mmichelson
Date: Fri Jan 22 15:33:32 2010
New Revision: 242422

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


Modified:
    team/group/CCSS_Monitor_Restructure/   (props changed)
    team/group/CCSS_Monitor_Restructure/apps/app_dial.c
    team/group/CCSS_Monitor_Restructure/channels/chan_sip.c
    team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h
    team/group/CCSS_Monitor_Restructure/main/ccss.c

Propchange: team/group/CCSS_Monitor_Restructure/
------------------------------------------------------------------------------
--- Monitor_Restructure-integrated (original)
+++ Monitor_Restructure-integrated Fri Jan 22 15:33:32 2010
@@ -1,1 +1,1 @@
-/team/group/CCSS:1-242410
+/team/group/CCSS:1-242420

Modified: team/group/CCSS_Monitor_Restructure/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/apps/app_dial.c?view=diff&rev=242422&r1=242421&r2=242422
==============================================================================
--- team/group/CCSS_Monitor_Restructure/apps/app_dial.c (original)
+++ team/group/CCSS_Monitor_Restructure/apps/app_dial.c Fri Jan 22 15:33:32 2010
@@ -945,7 +945,7 @@
 		}
 	}
 
-	is_cc_recall = ast_cc_is_recall(in, &cc_recall_core_id);
+	is_cc_recall = ast_cc_is_recall(in, &cc_recall_core_id, NULL);
 
 #ifdef HAVE_EPOLL
 	for (epollo = outgoing; epollo; epollo = epollo->next)

Modified: team/group/CCSS_Monitor_Restructure/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/channels/chan_sip.c?view=diff&rev=242422&r1=242421&r2=242422
==============================================================================
--- team/group/CCSS_Monitor_Restructure/channels/chan_sip.c (original)
+++ team/group/CCSS_Monitor_Restructure/channels/chan_sip.c Fri Jan 22 15:33:32 2010
@@ -6802,8 +6802,7 @@
 		return -1;
 	}
 
-	if (ast_get_cc_monitor_policy(ast_channel_get_cc_config_params(ast)) == AST_CC_MONITOR_NATIVE &&
-			ast_cc_is_recall(ast, &cc_core_id)) {
+	if (ast_cc_is_recall(ast, &cc_core_id, "SIP")) {
 		/* If this is a CC recall, then we have a particular
 		 * URI that we are supposed to send the INVITE to. We
 		 * get this information from the corresponding sip_monitor_instance

Modified: team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h?view=diff&rev=242422&r1=242421&r2=242422
==============================================================================
--- team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h (original)
+++ team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h Fri Jan 22 15:33:32 2010
@@ -1269,10 +1269,12 @@
  * \param chan The channel to check
  * \param core_id[out] If this is a valid CC recall, the core_id of the failed call
  * will be placed in this output parameter
+ * \param monitor_type Clarify which type of monitor type we are looking for if this
+ * is happening on a called channel. For incoming channels, this parameter is not used.
  * \retval 0 Either this is not a recall or it is but this channel is not part of the recall
  * \retval non-zero This is a recall and the channel in question is directly involved.
  */
-int ast_cc_is_recall(struct ast_channel *chan, int *core_id);
+int ast_cc_is_recall(struct ast_channel *chan, int *core_id, const char * const monitor_type);
 
 /*!
  * \since 1.8

Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=242422&r1=242421&r2=242422
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Fri Jan 22 15:33:32 2010
@@ -2205,7 +2205,7 @@
 	 */
 	kill_duplicate_offers(caller);
 
-	ast_cc_is_recall(caller_chan, &recall_core_id);
+	ast_cc_is_recall(caller_chan, &recall_core_id, NULL);
 
 	cc_params = ast_channel_get_cc_config_params(caller_chan);
 	if (!cc_params) {
@@ -2656,7 +2656,7 @@
 	return 0;
 }
 
-int ast_cc_is_recall(struct ast_channel *chan, int *core_id)
+int ast_cc_is_recall(struct ast_channel *chan, int *core_id, const char * const monitor_type)
 {
 	struct ast_datastore *recall_datastore;
 	struct cc_recall_ds_data *recall_data;
@@ -2698,6 +2698,16 @@
 		return 1;
 	}
 
+	if (ast_strlen_zero(monitor_type)) {
+		/* If someone passed a NULL or empty monitor type, then it is clear
+		 * the channel they passed in was an incoming channel, and so searching
+		 * the list of dialed interfaces is not going to be helpful. Just return
+		 * false immediately.
+		 */
+		ast_channel_unlock(chan);
+		return 0;
+	}
+
 	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_channel_unlock(chan);
@@ -2708,14 +2718,17 @@
 	 */
 	AST_LIST_LOCK(interface_tree);
 	AST_LIST_TRAVERSE(interface_tree, device_monitor, next) {
-		if (!strcmp(device_monitor->interface->name, device_name)) {
+		if (!strcmp(device_monitor->interface->name, device_name) &&
+				!strcmp(device_monitor->interface->monitor_type, monitor_type)) {
 			/* BOOM! Device is in the tree! We have a winner! */
 			*core_id = recall_data->core_id;
 			AST_LIST_UNLOCK(interface_tree);
+			cc_unref(interface_tree, "Found a match in recall tree.");
 			return 1;
 		}
 	}
 	AST_DLLIST_UNLOCK(interface_tree);
+	cc_unref(interface_tree, "No match in recall tree.");
 	return 0;
 }
 




More information about the asterisk-commits mailing list