[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r242031 - /team/group/CCSS_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 21 12:34:56 CST 2010


Author: mmichelson
Date: Thu Jan 21 12:34:52 2010
New Revision: 242031

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242031
Log:
Add calls to the monitor-less destruction call.

Another batch will be coming in the next commit. JUST YOU WAIT!


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

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=242031&r1=242030&r2=242031
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Thu Jan 21 12:34:52 2010
@@ -1575,6 +1575,17 @@
 	char device_name[AST_CHANNEL_NAME];
 	char dialable_name[AST_CHANNEL_NAME];
 };
+
+static void call_destructor_with_no_monitor(const char * const monitor_type, void *private_data)
+{
+	const struct ast_cc_monitor_callbacks *monitor_callbacks = find_monitor_callbacks(monitor_type);
+
+	if (!monitor_callbacks) {
+		return;
+	}
+
+	monitor_callbacks->destructor2(private_data);
+}
 
 /*!
  * \internal
@@ -1681,6 +1692,7 @@
 	if (!(cc_datastore = ast_channel_datastore_find(inbound, &dialed_cc_interfaces_info, NULL))) {
 		ast_log(LOG_WARNING, "Unable to retrieve CC datastore while processing CC frame from '%s'. CC services will be unavailable.\n", device_name);
 		ast_channel_unlock(inbound);
+		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return;
 	}
 
@@ -1688,6 +1700,7 @@
 
 	if (cc_interfaces->ignore) {
 		ast_channel_unlock(inbound);
+		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return;
 	}
 
@@ -1709,6 +1722,7 @@
 		if (!core_instance) {
 			cc_interfaces->ignore = 1;
 			ast_channel_unlock(inbound);
+			call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 			return;
 		}
 	}
@@ -1727,15 +1741,16 @@
 			ast_log_dynamic_level(cc_logger_level, "Device %s sent us multiple CC control frames. Ignoring those beyond the first.\n", device_name);
 			AST_DLLIST_UNLOCK(cc_interfaces->interface_tree);
 			cc_unref(core_instance, "Returning early from ast_handle_cc_control_frame");
+			call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 			return;
 		}
 	}
 	AST_DLLIST_UNLOCK(cc_interfaces->interface_tree);
-
 
 	if (!(monitor = cc_device_monitor_init(device_name, dialable_name, cc_data, cc_interfaces->core_id))) {
 		ast_log(LOG_WARNING, "Unable to create CC device interface for '%s'. CC services will be unavailable on this interface.\n", device_name);
 		cc_unref(core_instance, "Returning early from ast_handle_cc_control_frame");
+		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return;
 	}
 
@@ -2240,17 +2255,6 @@
 		}
 	}
 	AST_DLLIST_UNLOCK(interface_tree);
-}
-
-static void call_destructor_with_no_monitor(const char * const monitor_type, void *private_data)
-{
-	const struct ast_cc_monitor_callbacks *monitor_callbacks = find_monitor_callbacks(monitor_type);
-
-	if (!monitor_callbacks) {
-		return;
-	}
-
-	monitor_callbacks->destructor2(private_data);
 }
 
 static void cc_core_instance_destructor(void *data)




More information about the asterisk-commits mailing list