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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 18 18:29:59 CST 2010


Author: mmichelson
Date: Thu Feb 18 18:29:56 2010
New Revision: 247891

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=247891
Log:
Limit the device state changes which can trigger a recall.

Testing showed that a device which changed from "ringing" to
"not in use" would result in the caller being called back. The
problem is that this does not indicate actual activity by a
human on the monitored side of the call. Now, only state changes
to "not in use" or "unknown" from "unavailable," "busy," or "in use"
will trigger a recall.


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=247891&r1=247890&r2=247891
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Feb 18 18:29:56 2010
@@ -976,6 +976,7 @@
 {
 	struct generic_tp_cb_data *gtcd = data;
 	enum ast_device_state new_state = gtcd->new_state;
+	enum ast_device_state previous_state = gtcd->new_state;
 	const char *monitor_name = gtcd->device_name;
 	struct generic_monitor_instance_list *generic_list;
 	struct generic_monitor_instance *generic_instance;
@@ -998,9 +999,12 @@
 		return 0;
 	}
 
+	previous_state = generic_list->current_state;
 	generic_list->current_state = new_state;
 
-	if (new_state == AST_DEVICE_NOT_INUSE || new_state == AST_DEVICE_UNKNOWN) {
+	if ((new_state == AST_DEVICE_NOT_INUSE || new_state == AST_DEVICE_UNKNOWN) &&
+			(previous_state == AST_DEVICE_INUSE || previous_state == AST_DEVICE_UNAVAILABLE ||
+			 previous_state == AST_DEVICE_BUSY)) {
 		AST_LIST_TRAVERSE(&generic_list->list, generic_instance, next) {
 			if (!generic_instance->is_suspended) {
 				ast_cc_monitor_callee_available(generic_instance->core_id, "Generic monitored party has become available");




More information about the svn-commits mailing list