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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 19 12:00:41 CST 2010


Author: mmichelson
Date: Tue Jan 19 12:00:37 2010
New Revision: 241234

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=241234
Log:
Step one of this mess. Add components to the core_instance and tree_item structs.


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=241234&r1=241233&r2=241234
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Tue Jan 19 12:00:37 2010
@@ -221,6 +221,7 @@
 	 * whether CC has been requested yet.
 	 */
 	struct ast_cc_monitor *monitor;
+	struct ast_cc_interface_tree *monitors;
 };
 
 static int cc_core_instance_hash_fn(const void *obj, const int flags)
@@ -1259,6 +1260,14 @@
 	 * dial string to know that the call is a recall.
 	 */
 	char *dialable_name;
+	/*!
+	 * The ID of the available timer used by the current monitor
+	 */
+	int available_timer_id;
+	/*!
+	 * Monitor callbacks
+	 */
+	const struct ast_cc_monitor_callbacks *callbacks;
 	AST_LIST_ENTRY(cc_tree_item) next;
 };
 
@@ -1625,6 +1634,12 @@
 		return NULL;
 	}
 
+	if (!(tree_item->callbacks = find_monitor_callbacks(cc_interface->monitor_type))) {
+		ao2_t_ref(cc_interface, -1, "Failed to find monitor callbacks\n");
+		cc_tree_item_destroy(tree_item);
+		return NULL;
+	}
+
 	strcpy(cc_interface->name, device_name);
 	tree_item->id = ast_atomic_fetchadd_int(&dialed_cc_interface_counter, +1);
 	tree_item->parent_id = parent_id;
@@ -1632,6 +1647,7 @@
 	cc_interface->monitor_type = cc_data->monitor_type;
 	cc_interface->monitor_class = AST_CC_DEVICE_MONITOR;
 	tree_item->interface = cc_interface;
+	tree_item->available_timer_id = -1;
 	ast_cc_copy_config_params(cc_interface->config_params, &cc_data->config_params);
 	ast_log_dynamic_level(cc_logger_level, "Created a device cc interface for '%s' with id %d and parent %d\n", cc_interface->name, tree_item->id, tree_item->parent_id);
 	return tree_item;
@@ -2240,6 +2256,7 @@
 	if (core_instance->agent) {
 		cc_unref(core_instance->agent, "Core instance is done with the agent now");
 	}
+	cc_unref(core_instance->monitors, "Core instance is done with interface list");
 }
 
 static struct cc_core_instance *cc_core_init_instance(struct ast_channel *caller_chan,
@@ -2292,6 +2309,8 @@
 		kill_interface_tree_monitors(called_tree, core_id);
 		return NULL;
 	}
+
+	core_instance->monitors = cc_ref(called_tree, "Core instance getting ref to interface tree");
 
 	ao2_t_link(cc_core_instances, core_instance, "Link core instance into container");
 




More information about the asterisk-commits mailing list