[svn-commits] mmichelson: branch group/CCSS r247036 - /team/group/CCSS/main/ccss.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 16 17:05:25 CST 2010


Author: mmichelson
Date: Tue Feb 16 17:05:22 2010
New Revision: 247036

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=247036
Log:
Make use of the new printfedness in main/ccss.c


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

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=247036&r1=247035&r2=247036
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Feb 16 17:05:22 2010
@@ -1103,7 +1103,8 @@
 		cc_unref(generic_list, "Failed to schedule available timer. (generic_list)");
 		return -1;
 	}
-	ast_cc_monitor_request_acked(monitor->core_id, "Generic monitor subscribed to device state.\n");
+	ast_cc_monitor_request_acked(monitor->core_id, "Generic monitor for %s subscribed to device state.",
+			monitor->interface->device_name);
 	cc_unref(generic_list, "Finished with monitor instance reference in request cc callback");
 	return 0;
 }
@@ -2043,7 +2044,7 @@
 	ast_log_dynamic_level(cc_logger_level, "Queuing change request because offer timer has expired.\n");
 	agent_pvt->offer_timer_id = -1;
 	cc_unref((struct ast_cc_agent *)agent, "Remove scheduler's reference to the agent");
-	ast_cc_failed(agent->core_id, "Generic agent offer timer expired");
+	ast_cc_failed(agent->core_id, "Generic agent %s offer timer expired", agent->device_name);
 	return 0;
 }
 
@@ -2165,13 +2166,13 @@
 		/* Hmm, no channel. Sucks for you, bud.
 		 */
 		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");
+		ast_cc_failed(agent->core_id, "Failed to call back device %s/%s", tech, target);
 		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->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_cc_failed(agent->core_id, "Callback macro to %s failed. Maybe a hangup?", agent->device_name);
 			ast_hangup(chan);
 			return NULL;
 		}
@@ -2187,7 +2188,7 @@
 	ast_copy_string(chan->exten, generic_pvt->exten, sizeof(chan->exten));
 	ast_copy_string(chan->context, generic_pvt->context, sizeof(chan->context));
 	chan->priority = 1;
-	ast_cc_agent_recalling(agent->core_id, "Generic agent is recalling");
+	ast_cc_agent_recalling(agent->core_id, "Generic agent %s is recalling", agent->device_name);
 	ast_pbx_start(chan);
 	return NULL;
 }
@@ -2201,7 +2202,7 @@
 		/* We can't try to contact the device right now because he's not available
 		 * Let the core know he's busy.
 		 */
-		ast_cc_agent_caller_busy(agent->core_id, "Generic agent caller is busy");
+		ast_cc_agent_caller_busy(agent->core_id, "Generic agent caller %s is busy", agent->device_name);
 		return 0;
 	}
 	ast_pthread_create_detached_background(&clotho, NULL, generic_recall, agent);
@@ -2366,7 +2367,8 @@
 static int cc_caller_offered(struct cc_core_instance *core_instance, struct cc_state_change_args *args, enum cc_state previous_state)
 {
 	if (core_instance->agent->callbacks->start_offer_timer(core_instance->agent)) {
-		ast_cc_failed(core_instance->core_id, "Failed to start the offer timer\n");
+		ast_cc_failed(core_instance->core_id, "Failed to start the offer timer for %s\n",
+				core_instance->agent->device_name);
 		return -1;
 	}
 	manager_event(EVENT_FLAG_CC, "CCOfferTimerStart",
@@ -3228,7 +3230,8 @@
 	 * We get to this state using the slightly unintuitive method of calling
 	 * ast_cc_monitor_request_acked because it gets us to the proper state.
 	 */
-	ast_cc_monitor_request_acked(core_instance->core_id, "Agent asked to stop ringing. Be prepared to be recalled again.");
+	ast_cc_monitor_request_acked(core_instance->core_id, "Agent %s asked to stop ringing. Be prepared to be recalled again.",
+			core_instance->agent->device_name);
 	cc_unref(core_instance, "Stop ringing finished. Unref core_instance");
 	return res;
 }
@@ -3470,15 +3473,15 @@
 static int ccreq_exec(struct ast_channel *chan, const char *data)
 {
 	struct cc_core_instance *core_instance;
-	char interface[AST_CHANNEL_NAME];
+	char device_name[AST_CHANNEL_NAME];
 	unsigned long match_flags;
 	int res;
 
-	ast_channel_get_device_name(chan, interface, sizeof(interface));
+	ast_channel_get_device_name(chan, device_name, sizeof(device_name));
 
 	match_flags = MATCH_NO_REQUEST;
-	if (!(core_instance = ao2_t_callback_data(cc_core_instances, 0, match_agent, interface, &match_flags, "Find core instance for CallCompletionRequest"))) {
-		ast_log_dynamic_level(cc_logger_level, "Couldn't find a core instance for caller %s\n", interface);
+	if (!(core_instance = ao2_t_callback_data(cc_core_instances, 0, match_agent, device_name, &match_flags, "Find core instance for CallCompletionRequest"))) {
+		ast_log_dynamic_level(cc_logger_level, "Couldn't find a core instance for caller %s\n", device_name);
 		return -1;
 	}
 
@@ -3497,7 +3500,7 @@
 		return -1;
 	}
 
-	res = ast_cc_agent_accept_request(core_instance->core_id, "CallCompletionRequest called");
+	res = ast_cc_agent_accept_request(core_instance->core_id, "CallCompletionRequest called by caller %s for core_id %d", device_name, core_instance->core_id);
 	cc_unref(core_instance, "Done with CallCompletionRequest");
 	return res;
 }
@@ -3507,15 +3510,15 @@
 static int cccancel_exec(struct ast_channel *chan, const char *data)
 {
 	struct cc_core_instance *core_instance;
-	char interface[AST_CHANNEL_NAME];
+	char device_name[AST_CHANNEL_NAME];
 	unsigned long match_flags;
 	int res;
 
-	ast_channel_get_device_name(chan, interface, sizeof(interface));
+	ast_channel_get_device_name(chan, device_name, sizeof(device_name));
 
 	match_flags = MATCH_REQUEST;
-	if (!(core_instance = ao2_t_callback_data(cc_core_instances, 0, match_agent, interface, &match_flags, "Find core instance for CallCompletionCancel"))) {
-		ast_log(LOG_WARNING, "Cannot find CC transaction to cancel for caller %s\n", interface);
+	if (!(core_instance = ao2_t_callback_data(cc_core_instances, 0, match_agent, device_name, &match_flags, "Find core instance for CallCompletionCancel"))) {
+		ast_log(LOG_WARNING, "Cannot find CC transaction to cancel for caller %s\n", device_name);
 		return -1;
 	}
 
@@ -3524,7 +3527,8 @@
 		cc_unref(core_instance, "Unref core instance found during CallCompletionCancel");
 		return -1;
 	}
-	res = ast_cc_failed(core_instance->core_id, "Call completion request Cancelled");
+	res = ast_cc_failed(core_instance->core_id, "Call completion request Cancelled for core ID %d by caller %s",
+			core_instance->core_id, device_name);
 	cc_unref(core_instance, "Unref core instance found during CallCompletionCancel");
 	return res;
 }




More information about the svn-commits mailing list