[asterisk-commits] mmichelson: branch group/CCSS r215741 - /team/group/CCSS/main/ccss.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Sep 2 17:38:03 CDT 2009
Author: mmichelson
Date: Wed Sep 2 17:37:59 2009
New Revision: 215741
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=215741
Log:
Fill in some extension monitor callbacks.
They are eerily similar.
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=215741&r1=215740&r2=215741
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Sep 2 17:37:59 2009
@@ -1165,19 +1165,39 @@
static int cc_extension_monitor_init(struct ast_cc_monitor *monitor, const int core_id)
{
- /* STUB */
+ /* Currently, extension monitors don't really need to hold onto anything. However,
+ * it may be necessary to hold onto state information received from child device
+ * monitors. It will be much clearer once I begin design of device monitors.
+ */
return 0;
}
static int cc_extension_monitor_request_cc(struct ast_cc_monitor *monitor, const int core_id)
{
- /* STUB */
+ struct ast_cc_monitor_link *link_iter;
+ AST_LIST_TRAVERSE(&monitor->child_links, link_iter, next) {
+ ast_assert(link_iter->child != NULL);
+ ast_assert(link_iter->child->callbacks != NULL);
+ link_iter->child->callbacks->request_cc(link_iter->child, core_id);
+ /* XXX Should check the return value and potentially prune
+ * out monitors that return unsuccessfully since they were
+ * not able to properly request CC
+ */
+ }
+ /* XXX If ALL child monitors are unsuccessful, we should probably
+ * return -1 to whoever called this
+ */
return 0;
}
static int cc_extension_monitor_suspend(struct ast_cc_monitor *monitor, const int core_id)
{
- /* STUB */
+ struct ast_cc_monitor_link *link_iter;
+ AST_LIST_TRAVERSE(&monitor->child_links, link_iter, next) {
+ ast_assert(link_iter->child != NULL);
+ ast_assert(link_iter->child->callbacks != NULL);
+ link_iter->child->callbacks->suspend(link_iter->child, core_id);
+ }
return 0;
}
@@ -1189,7 +1209,12 @@
static int cc_extension_monitor_unsuspend(struct ast_cc_monitor *monitor, const int core_id)
{
- /* STUB */
+ struct ast_cc_monitor_link *link_iter;
+ AST_LIST_TRAVERSE(&monitor->child_links, link_iter, next) {
+ ast_assert(link_iter->child != NULL);
+ ast_assert(link_iter->child->callbacks != NULL);
+ link_iter->child->callbacks->unsuspend(link_iter->child, core_id);
+ }
return 0;
}
More information about the asterisk-commits
mailing list