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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 8 16:26:00 CDT 2009


Author: mmichelson
Date: Tue Sep  8 16:25:58 2009
New Revision: 217267

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=217267
Log:
Unstub the extension monitor status_request 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=217267&r1=217266&r2=217267
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Sep  8 16:25:58 2009
@@ -1379,8 +1379,19 @@
 
 static enum ast_device_state cc_extension_monitor_status_request(struct ast_cc_monitor *monitor, const int core_id)
 {
-	/* STUB */
-	return AST_DEVICE_NOT_INUSE;
+	/* So, for an extension monitor, a status request involves traversing all child links that have
+	 * the proper core_id. As soon as ONE of them returns AST_DEVICE_NOT_INUSE, this means that as
+	 * far as CC is concerned, the entire extension monitor itself is not in use, so go ahead
+	 * and return that status.
+	 */
+	struct ast_cc_monitor_link *link;
+
+	AST_LIST_TRAVERSE(&monitor->child_links, link, next_child) {
+		if (link->child->callbacks->status_request(link->child, core_id) == AST_DEVICE_NOT_INUSE) {
+			return AST_DEVICE_NOT_INUSE;
+		}
+	}
+	return AST_DEVICE_INUSE;
 }
 
 static int cc_extension_monitor_unsuspend(struct ast_cc_monitor *monitor, const int core_id)




More information about the asterisk-commits mailing list