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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 28 14:15:31 CDT 2009


Author: mmichelson
Date: Fri Aug 28 14:15:28 2009
New Revision: 214655

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214655
Log:
Switch to sched_thread method of scheduling.

A simple test call to a busy extension properly
switches states to CC_CALLER_OFFERED at the end of
the call, and when the cc_offer_timer expires, the
CC_FAILED state is changed to. Very good signs :)


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=214655&r1=214654&r2=214655
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Aug 28 14:15:28 2009
@@ -95,7 +95,7 @@
 };
 
 struct ast_taskprocessor *cc_core_taskprocessor;
-struct sched_context *cc_sched;
+struct ast_sched_thread *cc_sched_thread;
 
 struct ast_cc_config_params *__ast_cc_config_params_init(const char *file, int line, const char *function)
 {
@@ -668,12 +668,12 @@
 	int sched_id;
 	struct cc_generic_agent_pvt *generic_pvt = agent->private_data;
 
-	ast_assert(cc_sched != NULL);
+	ast_assert(cc_sched_thread != NULL);
 	ast_assert(agent->cc_params != NULL);
 
 	when = ast_get_cc_offer_timer(agent->cc_params) * 1000;
-	ast_log(LOG_NOTICE, "About to schedule timer expiration for %d ms\n", when);
-	if ((sched_id = ast_sched_add(cc_sched, when, offer_timer_expire, agent)) == -1) {
+	ast_log(LOG_NOTICE, "About to sched_threadule timer expiration for %d ms\n", when);
+	if ((sched_id = ast_sched_thread_add(cc_sched_thread, when, offer_timer_expire, agent)) == -1) {
 		return -1;
 	}
 	generic_pvt->offer_timer_id = sched_id;
@@ -884,9 +884,9 @@
 		return -1;
 	}
 	ast_log(LOG_NOTICE, "Successfully started CC task processor\n");
-	if (!(cc_sched = sched_context_create())) {
-		return -1;
-	}
-	ast_log(LOG_NOTICE, "Successfully created CC sched context\n");
-	return 0;
-}
+	if (!(cc_sched_thread = ast_sched_thread_create())) {
+		return -1;
+	}
+	ast_log(LOG_NOTICE, "Successfully created CC sched_thread context\n");
+	return 0;
+}




More information about the asterisk-commits mailing list