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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 26 17:48:38 CDT 2009


Author: mmichelson
Date: Wed Aug 26 17:48:35 2009
New Revision: 214308

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214308
Log:
Fill in state change function a bit more.

I realized I forgot about a few agent callbacks, I'll get
to them tomorrow.


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

Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=214308&r1=214307&r2=214308
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Aug 26 17:48:35 2009
@@ -627,6 +627,62 @@
 {
 	/* STUB */
 	struct cc_state_change_args *args = datap;
+	struct cc_core_instance;
+
+	ast_log(LOG_NOTICE, "State change to %d requested. Reason: %s\n", args->state, args->debug);
+
+	/* XXX First we need to Get the correct instance
+	 * of the core based on args->core_id. Since
+	 * I haven't yet set up the container of core
+	 * instances, I'm skipping this for now.
+	 */
+	switch (args->state) {
+	case CC_AVAILABLE:
+		/* This should never happen... */
+		ast_log(LOG_WARNING, "Someone requested to change to CC_AVAILABLE? Ignoring.\n");
+		break;
+	case CC_CALLER_OFFERED:
+		/* We offered CC to the caller. This is when the agent needs
+		 * to start its offer_timer
+		 */
+		break;
+	case CC_CALLER_REQUESTED:
+		/* Caller requested CC to the caller, so we need to initialize
+		 * monitor
+		 */
+		break;
+	case CC_ACTIVE:
+		/* Either
+		 * 1. Callee accepted CC request, call agent's ack callback.
+		 * 2. Caller became available, call agent's stop_monitoring callback and
+		 *    call monitor's unsuspend callback.
+		 */
+		break;
+	case CC_CALLEE_READY:
+		/* Callee has become available, call agent's status request callback
+		 */
+	case CC_CALLER_BUSY:
+		/* Callee was available, but caller was busy, call agent's begin_monitoring callback
+		 * and call monitor's suspend callback.
+		 */
+		break;
+	case CC_RECALLING:
+		/* Both caller and callee are available, call agent's recall callback
+		 */
+		break;
+	case CC_COMPLETE:
+		/* Recall has made progress, call agent and monitor destructor functions
+		 */
+		break;
+	case CC_FAILED:
+		/* Something along the way failed, call agent and monitor destructor functions
+		 */
+		break;
+	default:
+		ast_log(LOG_WARNING, "Asked to change to non-existent state %d. Ignoring\n", args->state);
+		break;
+	}
+
 	ast_free(args);
 	return 0;
 }




More information about the asterisk-commits mailing list