[svn-commits] mmichelson: branch group/CCSS r246670 - in /team/group/CCSS: include/asterisk...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Feb 15 16:12:10 CST 2010


Author: mmichelson
Date: Mon Feb 15 16:12:07 2010
New Revision: 246670

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=246670
Log:
Use "device_name" instead of "name" for ast_cc_interface.


Modified:
    team/group/CCSS/include/asterisk/ccss.h
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=246670&r1=246669&r2=246670
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Mon Feb 15 16:12:07 2010
@@ -784,7 +784,7 @@
 	 * have 'exten at context' for a name. Other channel types will
 	 * have 'tech/device' for a name.
 	 */
-	char name[1];
+	char device_name[1];
 };
 
 /* BEGIN STRUCTURES FOR AGENTS */

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=246670&r1=246669&r2=246670
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Mon Feb 15 16:12:07 2010
@@ -954,18 +954,18 @@
 		return NULL;
 	}
 
-	if (!(generic_list->device_name = ast_strdup(monitor->interface->name))) {
+	if (!(generic_list->device_name = ast_strdup(monitor->interface->device_name))) {
 		cc_unref(generic_list, "Failed to strdup the monitor's device name");
 		return NULL;
 	}
 
 	if (!(generic_list->sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, generic_monitor_devstate_cb,
 				"Requesting CC", NULL, AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, 
-				monitor->interface->name, AST_EVENT_IE_END))) {
+				monitor->interface->device_name, AST_EVENT_IE_END))) {
 		cc_unref(generic_list, "Failed to subscribe to device state");
 		return NULL;
 	}
-	generic_list->current_state = ast_device_state(monitor->interface->name);
+	generic_list->current_state = ast_device_state(monitor->interface->device_name);
 	ao2_link(generic_monitors, generic_list);
 	return generic_list;
 }
@@ -1047,7 +1047,7 @@
 	struct ast_cc_monitor *monitor = (struct ast_cc_monitor *) data;
 	int res;
 	monitor->available_timer_id = -1;
-	res = ast_cc_monitor_failed(monitor->core_id, monitor->interface->name, "Available timer expired for monitor");
+	res = ast_cc_monitor_failed(monitor->core_id, monitor->interface->device_name, "Available timer expired for monitor");
 	cc_unref(monitor, "Unref reference from scheduler\n");
 	return res;
 }
@@ -1068,7 +1068,7 @@
 		return -1;
 	}
 
-	if (!(gen_mon_pvt->device_name = ast_strdup(monitor->interface->name))) {
+	if (!(gen_mon_pvt->device_name = ast_strdup(monitor->interface->device_name))) {
 		ast_free(gen_mon_pvt);
 		return -1;
 	}
@@ -1077,7 +1077,7 @@
 
 	monitor->private_data = gen_mon_pvt;
 
-	if (!(generic_list = find_generic_monitor_instance_list(monitor->interface->name))) {
+	if (!(generic_list = find_generic_monitor_instance_list(monitor->interface->device_name))) {
 		if (!(generic_list = create_new_generic_list(monitor))) {
 			return -1;
 		}
@@ -1111,9 +1111,9 @@
 {
 	struct generic_monitor_instance_list *generic_list;
 	struct generic_monitor_instance *generic_instance;
-	enum ast_device_state state = ast_device_state(monitor->interface->name);
-
-	if (!(generic_list = find_generic_monitor_instance_list(monitor->interface->name))) {
+	enum ast_device_state state = ast_device_state(monitor->interface->device_name);
+
+	if (!(generic_list = find_generic_monitor_instance_list(monitor->interface->device_name))) {
 		return -1;
 	}
 
@@ -1160,8 +1160,8 @@
 static int cc_generic_monitor_unsuspend(struct ast_cc_monitor *monitor)
 {
 	struct generic_monitor_instance *generic_instance;
-	struct generic_monitor_instance_list *generic_list = find_generic_monitor_instance_list(monitor->interface->name);
-	enum ast_device_state state = ast_device_state(monitor->interface->name);
+	struct generic_monitor_instance_list *generic_list = find_generic_monitor_instance_list(monitor->interface->device_name);
+	enum ast_device_state state = ast_device_state(monitor->interface->device_name);
 
 	if (!generic_list) {
 		return -1;
@@ -1192,7 +1192,7 @@
 		return 0;
 	}
 
-	ast_log_dynamic_level(cc_logger_level, "Canceling generic monitor available timer for monitor %s\n", monitor->interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Canceling generic monitor available timer for monitor %s\n", monitor->interface->device_name);
 	ast_sched_thread_del(cc_sched_thread, *sched_id);
 	*sched_id = -1;
 	cc_unref(monitor, "Remove scheduler's reference to the monitor");
@@ -1249,7 +1249,7 @@
 static void cc_interface_destroy(void *data)
 {
 	struct ast_cc_interface *interface = data;
-	ast_log_dynamic_level(cc_logger_level, "Destroying cc interface %s\n", interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Destroying cc interface %s\n", interface->device_name);
 	ast_cc_config_params_destroy(interface->config_params);
 }
 
@@ -1262,7 +1262,7 @@
 	 * assigned to them, so we wouldn't want to segfault when we try
 	 * to destroy one of them.
 	 */
-	ast_log_dynamic_level(cc_logger_level, "Calling destructor for monitor %s, core ID %d\n", monitor->interface->name, monitor->core_id);
+	ast_log_dynamic_level(cc_logger_level, "Calling destructor for monitor %s, core ID %d\n", monitor->interface->device_name, monitor->core_id);
 	if (monitor->callbacks) {
 		monitor->callbacks->destructor(monitor->private_data);
 	}
@@ -1467,9 +1467,9 @@
 	monitor->parent_id = parent_id;
 	cc_interface->monitor_type = "extension";
 	cc_interface->monitor_class = AST_CC_EXTENSION_MONITOR;
-	strcpy(cc_interface->name, ast_str_buffer(str));
+	strcpy(cc_interface->device_name, ast_str_buffer(str));
 	monitor->interface = cc_interface;
-	ast_log_dynamic_level(cc_logger_level, "Created an extension cc interface for '%s' with id %d and parent %d\n", cc_interface->name, monitor->id, monitor->parent_id);
+	ast_log_dynamic_level(cc_logger_level, "Created an extension cc interface for '%s' with id %d and parent %d\n", cc_interface->device_name, monitor->id, monitor->parent_id);
 	return monitor;
 }
 
@@ -1641,7 +1641,7 @@
 		return NULL;
 	}
 
-	strcpy(cc_interface->name, device_name);
+	strcpy(cc_interface->device_name, device_name);
 	monitor->id = ast_atomic_fetchadd_int(&dialed_cc_interface_counter, +1);
 	monitor->parent_id = parent_id;
 	monitor->core_id = core_id;
@@ -1652,7 +1652,7 @@
 	monitor->interface = cc_interface;
 	monitor->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, monitor->id, monitor->parent_id);
+	ast_log_dynamic_level(cc_logger_level, "Created a device cc interface for '%s' with id %d and parent %d\n", cc_interface->device_name, monitor->id, monitor->parent_id);
 	return monitor;
 }
 
@@ -1734,7 +1734,7 @@
 	 */
 	AST_DLLIST_LOCK(cc_interfaces->interface_tree);
 	AST_DLLIST_TRAVERSE(cc_interfaces->interface_tree, monitor, next) {
-		if (!strcmp(monitor->interface->name, device_name)) {
+		if (!strcmp(monitor->interface->device_name, device_name)) {
 			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");
@@ -2405,7 +2405,7 @@
 					"CoreID: %d\r\n"
 					"Caller: %s\r\n"
 					"Callee: %s\r\n",
-					core_instance->core_id, core_instance->agent->interface, monitor_iter->interface->name);
+					core_instance->core_id, core_instance->agent->interface, monitor_iter->interface->device_name);
 			}
 		} else if (!has_children(monitor_iter)) {
 			AST_DLLIST_REMOVE_CURRENT(next);
@@ -2786,7 +2786,7 @@
 	 */
 	AST_DLLIST_LOCK(interface_tree);
 	AST_DLLIST_TRAVERSE(interface_tree, device_monitor, next) {
-		if (!strcmp(device_monitor->interface->name, device_name) &&
+		if (!strcmp(device_monitor->interface->device_name, device_name) &&
 				!strcmp(device_monitor->interface->monitor_type, monitor_type)) {
 			/* BOOM! Device is in the tree! We have a winner! */
 			*core_id = core_id_candidate;
@@ -2811,7 +2811,7 @@
 
 	AST_DLLIST_LOCK(core_instance->monitors);
 	AST_DLLIST_TRAVERSE(core_instance->monitors, monitor_iter, next) {
-		if (!strcmp(monitor_iter->interface->name, device_name)) {
+		if (!strcmp(monitor_iter->interface->device_name, device_name)) {
 			/* Found a monitor. */
 			cc_ref(monitor_iter, "Hand the requester of the monitor a reference");
 			break;
@@ -2887,7 +2887,7 @@
 
 	AST_DLLIST_LOCK(interface_tree);
 	AST_DLLIST_TRAVERSE(interface_tree, monitor_iter, next) {
-		if (!strcmp(monitor_iter->interface->name, extension)) {
+		if (!strcmp(monitor_iter->interface->device_name, extension)) {
 			exten_id = monitor_iter->id;
 			break;
 		}
@@ -3062,7 +3062,7 @@
 	AST_DLLIST_LOCK(core_instance->monitors);
 	AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN(core_instance->monitors, monitor_iter, next) {
 		if (monitor_iter->interface->monitor_class == AST_CC_DEVICE_MONITOR) {
-			if (!strcmp(monitor_iter->interface->name, failure_data->device_name)) {
+			if (!strcmp(monitor_iter->interface->device_name, failure_data->device_name)) {
 				AST_DLLIST_REMOVE_CURRENT(next);
 				monitor_iter->callbacks->cancel_available_timer(monitor_iter, &monitor_iter->available_timer_id);
 				cc_unref(monitor_iter, "Monitor reported failure. Unref list's reference.");
@@ -3472,7 +3472,7 @@
 
 	AST_DLLIST_LOCK(core_instance->monitors);
 	AST_DLLIST_TRAVERSE(core_instance->monitors, monitor_iter, next) {
-		if (!strcmp(monitor_iter->interface->name, device_name) && 
+		if (!strcmp(monitor_iter->interface->device_name, device_name) && 
 				!strcmp(monitor_iter->interface->monitor_type, monitor_type)) {
 			cb_data->count++;
 			break;
@@ -3530,7 +3530,7 @@
 		return;
 	}
 
-	ast_cli(fd, "\t\t|-->%s", monitor->interface->name);
+	ast_cli(fd, "\t\t|-->%s", monitor->interface->device_name);
 	if (monitor->interface->monitor_class == AST_CC_DEVICE_MONITOR) {
 		ast_cli(fd, "(%s)", cc_service_to_string(monitor->service_offered));
 	}




More information about the svn-commits mailing list