[svn-commits] mmichelson: branch group/CCSS r215945 - in /team/group/CCSS: include/asterisk...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 3 10:53:35 CDT 2009


Author: mmichelson
Date: Thu Sep  3 10:53:31 2009
New Revision: 215945

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=215945
Log:
Begin writing generic monitor callbacks. Starting with stubs.


Modified:
    team/group/CCSS/include/asterisk/ccss.h
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=215945&r1=215944&r2=215945
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Thu Sep  3 10:53:31 2009
@@ -449,11 +449,6 @@
  * callbacks are opaque and channel drivers will wish
  * to use that, this string is made globally available
  * for all to use
- *
- * XXX TODO: Remember to set this to
- * generic_monitor_callbacks.type in ast_cc_init. Need
- * to write the generic monitor callbacks struct before
- * I can do that though.
  */
 const char *AST_CC_GENERIC_MONITOR_TYPE;
 

Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=215945&r1=215944&r2=215945
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Sep  3 10:53:31 2009
@@ -1239,6 +1239,59 @@
 	return;
 }
 
+static int cc_generic_monitor_init(struct ast_cc_monitor *monitor, const int core_id);
+static int cc_generic_monitor_request_cc(struct ast_cc_monitor *monitor, const int core_id);
+static int cc_generic_monitor_suspend(struct ast_cc_monitor *monitor, const int core_id);
+static enum ast_device_state cc_generic_monitor_status_request(struct ast_cc_monitor *monitor, const int core_id);
+static int cc_generic_monitor_unsuspend(struct ast_cc_monitor *monitor, const int core_id);
+static void cc_generic_monitor_destructor(void *monitor);
+
+static struct ast_cc_monitor_callbacks generic_monitor_cbs = {
+	.type = "generic",
+	.init = cc_generic_monitor_init,
+	.request_cc = cc_generic_monitor_request_cc,
+	.suspend = cc_generic_monitor_suspend,
+	.status_request = cc_generic_monitor_status_request,
+	.unsuspend = cc_generic_monitor_unsuspend,
+	.destructor = cc_generic_monitor_destructor,
+};
+
+static int cc_generic_monitor_init(struct ast_cc_monitor *monitor, const int core_id)
+{
+	/* STUB */
+	return 0;
+}
+
+static int cc_generic_monitor_request_cc(struct ast_cc_monitor *monitor, const int core_id)
+{
+	/* STUB */
+	return 0;
+}
+
+static int cc_generic_monitor_suspend(struct ast_cc_monitor *monitor, const int core_id)
+{
+	/* STUB */
+	return 0;
+}
+
+static enum ast_device_state cc_generic_monitor_status_request(struct ast_cc_monitor *monitor, const int core_id)
+{
+	/* STUB */
+	return AST_DEVICE_NOT_INUSE;
+}
+
+static int cc_generic_monitor_unsuspend(struct ast_cc_monitor *monitor, const int core_id)
+{
+	/* STUB */
+	return 0;
+}
+
+static void cc_generic_monitor_destructor(void *monitor)
+{
+	/* STUB */
+	return;
+}
+
 int ast_cc_monitor_register(const struct ast_cc_monitor_callbacks *callbacks)
 {
 	struct cc_monitor_backend *backend = ast_calloc(1, sizeof(*backend));
@@ -1294,5 +1347,6 @@
 	res = ast_register_application2(ccreq_app, ccreq_exec, NULL, NULL, NULL);
 	res |= ast_register_application2(cccancel_app, cccancel_exec, NULL, NULL, NULL);
 	res |= ast_cc_monitor_register(&extension_monitor_cbs);
+	AST_CC_GENERIC_MONITOR_TYPE = generic_monitor_cbs.type;
 	return res;
 }




More information about the svn-commits mailing list