[asterisk-commits] mmichelson: branch group/CCSS r225447 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 22 15:13:20 CDT 2009


Author: mmichelson
Date: Thu Oct 22 15:13:16 2009
New Revision: 225447

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225447
Log:
Add a few more manager events.


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=225447&r1=225446&r2=225447
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Oct 22 15:13:16 2009
@@ -981,6 +981,11 @@
 	struct ast_cc_monitor *parent_monitor = link->parent;
 	struct ast_cc_monitor *child_monitor = link->child;
 	int core_id = link->core_id;
+
+	manager_event(EVENT_FLAG_CC, "CCAvailableTimerExpired",
+		"CoreID: %d\r\n"
+		"Callee: %s\r\n",
+		link->core_id, child_monitor->interface->name);
 	/* When an available_timer expires, We just need to
 	 * prune the monitor from the tree. Just because one
 	 * available timer expires doesn't mean we should give
@@ -2294,6 +2299,11 @@
 	}
 
 	monitor->saved_link = link;
+	manager_event(EVENT_FLAG_CC, "CCCalleeAvailable",
+		"CoreID: %d\r\n"
+		"Callee: %s\r\n",
+		link->core_id, monitor->interface->name
+	);
 	pass_availability_up(link->parent, link->core_id);
 	cc_unref(monitor, "Kill reference from ast_cc_monitor_announce_availabilty");
 	return 0;
@@ -2334,9 +2344,13 @@
 			ast_cc_failed(core_instance->core_id, "Failed to start the offer timer\n");
 			break;
 		}
+		manager_event(EVENT_FLAG_CC, "CCOfferTimerStart",
+			"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);
 		ast_log(LOG_NOTICE, "Started the offer timer for the agent!\n");
 		core_instance->current_state = args->state;
-		/* XXX MANAGER */
 		break;
 	case CC_CALLER_REQUESTED:
 		/* An English translation of this is that the only valid state change here is either if the current
@@ -2359,7 +2373,10 @@
 		cc_monitor_tree_init(args->core_id);
 		/* It doesn't matter what service we state for the root monitor, so we just use AST_CC_NONE */
 		core_instance->monitor->callbacks->request_cc(core_instance->monitor, core_instance->core_id, NULL);
-		/* XXX MANAGER */
+		manager_event(EVENT_FLAG_CC, "CCRequested",
+			"CoreID: %d\r\n"
+			"Caller: %s\r\n",
+			core_instance->core_id, core_instance->agent->interface);
 		break;
 	case CC_ACTIVE:
 		/* Either
@@ -2370,12 +2387,14 @@
 		if (core_instance->current_state == CC_CALLER_REQUESTED) {
 			core_instance->current_state = args->state;
 			core_instance->agent->callbacks->ack(core_instance->agent);
-			/* XXX MANAGER */
 		} else if (core_instance->current_state == CC_CALLER_BUSY) {
 			core_instance->current_state = args->state;
 			core_instance->agent->callbacks->stop_monitoring(core_instance->agent);
+			manager_event(EVENT_FLAG_CC, "CCCallerStopMonitoring",
+				"CoreID: %d\r\n"
+				"Caller: %s\r\n",
+				core_instance->core_id, core_instance->agent->interface);
 			core_instance->monitor->callbacks->unsuspend(core_instance->monitor, core_instance->core_id);
-			/* XXX MANAGER */
 		} else {
 			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
@@ -2411,7 +2430,10 @@
 		core_instance->current_state = args->state;
 		core_instance->monitor->callbacks->suspend(core_instance->monitor, core_instance->core_id);
 		core_instance->agent->callbacks->start_monitoring(core_instance->agent);
-		/* XXX MANAGER */
+		manager_event(EVENT_FLAG_CC, "CCCallerStartMonitoring",
+			"CoreID: %d\r\n"
+			"Caller: %s\r\n",
+			core_instance->core_id, core_instance->agent->interface);
 		break;
 	case CC_RECALLING:
 		/* Both caller and callee are available, call agent's recall callback
@@ -2424,7 +2446,10 @@
 		core_instance->current_state = args->state;
 		core_instance->monitor->callbacks->cancel_available_timer(core_instance->monitor, core_instance->core_id, NULL);
 		core_instance->agent->callbacks->recall(core_instance->agent);
-		/* XXX MANAGER */
+		manager_event(EVENT_FLAG_CC, "CCCallerRecalling",
+			"CoreID: %d\r\n"
+			"Caller: %s\r\n",
+			core_instance->core_id, core_instance->agent->interface);
 		break;
 	case CC_COMPLETE:
 		/* Recall has made progress, call agent and monitor destructor functions
@@ -2435,13 +2460,20 @@
 			break;
 		}
 		core_instance->current_state = args->state;
-		/* XXX MANAGER */
+		manager_event(EVENT_FLAG_CC, "CCRecallComplete",
+			"CoreID: %d\r\n"
+			"Caller: %s\r\n",
+			core_instance->core_id, core_instance->agent->interface);
 		ao2_t_unlink(cc_core_instances, core_instance, "Unlink core instance since CC recall has completed");
 		break;
 	case CC_FAILED:
 		/* Something along the way failed, call agent and monitor destructor functions
 		 */
-		/* XXX MANAGER */
+		manager_event(EVENT_FLAG_CC, "CCFailure",
+			"CoreID: %d\r\n"
+			"Caller: %s\r\n"
+			"Reason: %s\r\n",
+			core_instance->core_id, core_instance->agent->interface, args->debug);
 		ao2_t_unlink(cc_core_instances, core_instance, "Unlink core instance since CC failed");
 		break;
 	default:




More information about the asterisk-commits mailing list