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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 15 16:15:37 CST 2010


Author: mmichelson
Date: Mon Feb 15 16:15:34 2010
New Revision: 246671

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=246671
Log:
ast_cc_agent uses "device_name" instead of "interface" now.


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=246671&r1=246670&r2=246671
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Mon Feb 15 16:15:34 2010
@@ -820,7 +820,7 @@
 	/*! The name of the interface which this agent
 	 * represents/communicates with
 	 */
-	char interface[1];
+	char device_name[1];
 };
 
 struct ast_cc_agent_callbacks {

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=246671&r1=246670&r2=246671
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Mon Feb 15 16:15:34 2010
@@ -353,7 +353,7 @@
 		return 0;
 	}
 
-	if (!strcmp(core_instance->agent->interface, name)) {
+	if (!strcmp(core_instance->agent->device_name, name)) {
 		return CMP_MATCH | CMP_STOP;
 	}
 	return 0;
@@ -383,7 +383,7 @@
 		return 0;
 	}
 
-	if (core_instance->current_state >= CC_CALLER_REQUESTED && !strcmp(core_instance->agent->interface, name)) {
+	if (core_instance->current_state >= CC_CALLER_REQUESTED && !strcmp(core_instance->agent->device_name, name)) {
 		cb_data->count++;
 	}
 	return 0;
@@ -1916,7 +1916,7 @@
 	}
 
 	agent->core_id = core_id;
-	strcpy(agent->interface, caller_name);
+	strcpy(agent->device_name, caller_name);
 
 	cc_params = ast_channel_get_cc_config_params(caller_chan);
 	if (!cc_params) {
@@ -1939,7 +1939,7 @@
 		cc_unref(agent, "Agent init callback failed.");
 		return NULL;
 	}
-	ast_log_dynamic_level(cc_logger_level, "Created an agent with core_id %d and caller %s\n", agent->core_id, agent->interface);
+	ast_log_dynamic_level(cc_logger_level, "Created an agent with core_id %d and caller %s\n", agent->core_id, agent->device_name);
 	return agent;
 }
 
@@ -2086,13 +2086,13 @@
 
 static int cc_generic_agent_status_request(struct ast_cc_agent *agent)
 {
-	ast_cc_agent_status_response(agent->core_id, ast_device_state(agent->interface));
+	ast_cc_agent_status_response(agent->core_id, ast_device_state(agent->device_name));
 	return 0;
 }
 
 static int cc_generic_agent_stop_ringing(struct ast_cc_agent *agent)
 {
-	struct ast_channel *recall_chan = ast_channel_get_by_name_prefix(agent->interface, strlen(agent->interface));
+	struct ast_channel *recall_chan = ast_channel_get_by_name_prefix(agent->device_name, strlen(agent->device_name));
 
 	if (!recall_chan) {
 		return 0;
@@ -2124,7 +2124,7 @@
 			cc_ref(agent, "ref agent for device state unsubscription"))) {
 		cc_unref(agent, "Unref agent unsubscribing from devstate failed");
 	}
-	ast_str_set(&str, 0, "%s is no longer busy\n", agent->interface);
+	ast_str_set(&str, 0, "%s is no longer busy\n", agent->device_name);
 	ast_cc_agent_caller_available(agent->core_id, ast_str_buffer(str));
 }
 
@@ -2134,11 +2134,11 @@
 	struct ast_str *str = ast_str_alloca(128);
 
 	ast_assert(generic_pvt->sub == NULL);
-	ast_str_set(&str, 0, "Starting to monitor %s device state since it is busy\n", agent->interface);
+	ast_str_set(&str, 0, "Starting to monitor %s device state since it is busy\n", agent->device_name);
 
 	if (!(generic_pvt->sub = ast_event_subscribe(
 			AST_EVENT_DEVICE_STATE, generic_agent_devstate_cb, ast_str_buffer(str), agent,
-			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, agent->interface,
+			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, agent->device_name,
 			AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT, AST_DEVICE_NOT_INUSE,
 			AST_EVENT_IE_END))) {
 		return -1;
@@ -2150,7 +2150,7 @@
 {
 	struct ast_cc_agent *agent = data;
 	struct cc_generic_agent_pvt *generic_pvt = agent->private_data;
-	const char *interface = S_OR(ast_get_cc_agent_dialstring(agent->cc_params), ast_strdupa(agent->interface));
+	const char *interface = S_OR(ast_get_cc_agent_dialstring(agent->cc_params), ast_strdupa(agent->device_name));
 	const char *tech;
 	char *target;
 	int reason;
@@ -2165,12 +2165,12 @@
 	if (!(chan = ast_request_and_dial(tech, AST_FORMAT_SLINEAR, NULL, target, recall_timer, &reason, generic_pvt->cid_num, generic_pvt->cid_name))) {
 		/* Hmm, no channel. Sucks for you, bud.
 		 */
-		ast_log_dynamic_level(cc_logger_level, "Failed to call back %s for reason %d\n", agent->interface, reason);
+		ast_log_dynamic_level(cc_logger_level, "Failed to call back %s for reason %d\n", agent->device_name, reason);
 		ast_cc_failed(agent->core_id, "Failed to call back interface\n");
 		return NULL;
 	}
 	if (!ast_strlen_zero(callback_macro)) {
-		ast_log_dynamic_level(cc_logger_level, "There's a callback macro configured for agent %s\n", agent->interface);
+		ast_log_dynamic_level(cc_logger_level, "There's a callback macro configured for agent %s\n", agent->device_name);
 		if (ast_app_run_macro(NULL, chan, callback_macro, NULL)) {
 			ast_cc_failed(agent->core_id, "Callback macro failed. Maybe a hangup?");
 			ast_hangup(chan);
@@ -2196,7 +2196,7 @@
 static int cc_generic_agent_recall(struct ast_cc_agent *agent)
 {
 	pthread_t clotho;
-	enum ast_device_state current_state = ast_device_state(agent->interface);
+	enum ast_device_state current_state = ast_device_state(agent->device_name);
 
 	if (current_state != AST_DEVICE_NOT_INUSE && current_state != AST_DEVICE_UNKNOWN) {
 		/* We can't try to contact the device right now because he's not available
@@ -2374,7 +2374,7 @@
 		"CoreID: %d\r\n"
 		"Caller: %s\r\n"
 		"Expires: %u\r\n",
-		core_instance->core_id, core_instance->agent->interface, core_instance->agent->cc_params->cc_offer_timer);
+		core_instance->core_id, core_instance->agent->device_name, core_instance->agent->cc_params->cc_offer_timer);
 	ast_log_dynamic_level(cc_logger_level, "Started the offer timer for the agent!\n");
 	return 0;
 }
@@ -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->device_name);
+					core_instance->core_id, core_instance->agent->device_name, monitor_iter->interface->device_name);
 			}
 		} else if (!has_children(monitor_iter)) {
 			AST_DLLIST_REMOVE_CURRENT(next);
@@ -2432,7 +2432,7 @@
 	manager_event(EVENT_FLAG_CC, "CCRequested",
 		"CoreID: %d\r\n"
 		"Caller: %s\r\n",
-		core_instance->core_id, core_instance->agent->interface);
+		core_instance->core_id, core_instance->agent->device_name);
 	return 0;
 }
 
@@ -2474,7 +2474,7 @@
 		manager_event(EVENT_FLAG_CC, "CCCallerStopMonitoring",
 			"CoreID: %d\r\n"
 			"Caller: %s\r\n",
-			core_instance->core_id, core_instance->agent->interface);
+			core_instance->core_id, core_instance->agent->device_name);
 		unsuspend(core_instance);
 	}
 	/* Not possible for previous_state to be anything else due to the is_state_change_valid check at the beginning */
@@ -2520,7 +2520,7 @@
 	manager_event(EVENT_FLAG_CC, "CCCallerStartMonitoring",
 		"CoreID: %d\r\n"
 		"Caller: %s\r\n",
-		core_instance->core_id, core_instance->agent->interface);
+		core_instance->core_id, core_instance->agent->device_name);
 	return 0;
 }
 
@@ -2555,7 +2555,7 @@
 	manager_event(EVENT_FLAG_CC, "CCCallerRecalling",
 		"CoreID: %d\r\n"
 		"Caller: %s\r\n",
-		core_instance->core_id, core_instance->agent->interface);
+		core_instance->core_id, core_instance->agent->device_name);
 	return 0;
 }
 
@@ -2566,7 +2566,7 @@
 	manager_event(EVENT_FLAG_CC, "CCRecallComplete",
 		"CoreID: %d\r\n"
 		"Caller: %s\r\n",
-		core_instance->core_id, core_instance->agent->interface);
+		core_instance->core_id, core_instance->agent->device_name);
 	ao2_t_unlink(cc_core_instances, core_instance, "Unlink core instance since CC recall has completed");
 	return 0;
 }
@@ -2579,7 +2579,7 @@
 		"CoreID: %d\r\n"
 		"Caller: %s\r\n"
 		"Reason: %s\r\n",
-		core_instance->core_id, core_instance->agent->interface, args->debug);
+		core_instance->core_id, core_instance->agent->device_name, args->debug);
 	ao2_t_unlink(cc_core_instances, core_instance, "Unlink core instance since CC failed");
 	return 0;
 }
@@ -3548,7 +3548,7 @@
 	int *cli_fd = arg;
 	struct cc_core_instance *core_instance = obj;
 
-	ast_cli(*cli_fd, "%d\t\t%s\t\t%s\n", core_instance->core_id, core_instance->agent->interface,
+	ast_cli(*cli_fd, "%d\t\t%s\t\t%s\n", core_instance->core_id, core_instance->agent->device_name,
 			cc_state_to_string(core_instance->current_state));
 	AST_DLLIST_LOCK(core_instance->monitors);
 	cc_cli_print_monitor_stats(AST_DLLIST_FIRST(core_instance->monitors), *cli_fd, 0);




More information about the asterisk-commits mailing list