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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 27 18:44:09 CDT 2009


Author: mmichelson
Date: Thu Aug 27 18:44:06 2009
New Revision: 214596

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214596
Log:
One more validation line in the state change function.


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=214596&r1=214595&r2=214596
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Aug 27 18:44:06 2009
@@ -771,9 +771,14 @@
 		}
 		break;
 	case CC_CALLER_REQUESTED:
-		/* Caller requested CC to the caller, so we need to initialize
-		 * monitor
+		/* An English translation of this is that the only valid state change here is either if the current
+		 * state is CC_CALLER_OFFERED or if the current state is CC_AVAILABLE and the type of the agent
+		 * in use is generic.
 		 */
+		if (!(core_instance->current_state == CC_CALLER_OFFERED || 
+				(core_instance->current_state == CC_AVAILABLE && !strcmp(core_instance->agent->callbacks->type, "generic")))) {
+			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n", core_instance->current_state, args->state);
+		}
 		break;
 	case CC_ACTIVE:
 		/* Either




More information about the asterisk-commits mailing list