[asterisk-commits] mmichelson: branch group/CCSS r214284 - /team/group/CCSS/main/ccss.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Aug 26 17:20:20 CDT 2009
Author: mmichelson
Date: Wed Aug 26 17:20:17 2009
New Revision: 214284
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214284
Log:
Add some use for the taskprocessor.
The callback will be fleshed out as I get around to it.
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=214284&r1=214283&r2=214284
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Aug 26 17:20:17 2009
@@ -27,6 +27,7 @@
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
+#include "asterisk/taskprocessor.h"
/*!
* \since 1.6.4
@@ -616,6 +617,33 @@
return;
}
+struct cc_state_change_args {
+ enum ast_cc_state state;
+ const unsigned int core_id;
+ char debug[1];
+};
+
+static int cc_do_state_change(void *datap)
+{
+ /* STUB */
+ struct cc_state_change_args *args = datap;
+ ast_free(args);
+ return 0;
+}
+
+int ast_cc_request_state_change(enum ast_cc_state state, const unsigned int core_id,
+ const char *debug)
+{
+ struct cc_state_change_args *args = ast_calloc(1, sizeof(*args) +
+ ast_strlen_zero(debug) ? 0 : strlen(debug));
+
+ if (!args) {
+ return -1;
+ }
+
+ return ast_taskprocessor_push(cc_core_taskprocessor, cc_do_state_change, args);
+}
+
int ast_cc_init(void)
{
if (!(pending_cc_offers = ao2_container_alloc(CC_PENDING_OFFER_BUCKETS,
More information about the asterisk-commits
mailing list