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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 9 15:50:06 CDT 2009


Author: mmichelson
Date: Fri Oct  9 15:50:03 2009
New Revision: 223328

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=223328
Log:
More reorganization. remove a redundant function.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=223328&r1=223327&r2=223328
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Oct  9 15:50:03 2009
@@ -57,9 +57,10 @@
  ***/
 
 /* File scope variables */
+
 static struct ast_sched_thread *cc_sched_thread;
 static const int CC_CORE_INSTANCES_BUCKETS = 17;
-
+static int core_id_counter;
 static struct ast_cc_monitor *root_monitor;
 static struct ast_taskprocessor *cc_core_taskprocessor;
 
@@ -1490,8 +1491,6 @@
 	return tree_item;
 }
 
-static int core_id_counter;
-
 /*!
  * \brief allocate dialed_cc_interfaces datastore and initialize fields
  *
@@ -1921,25 +1920,6 @@
 	return core_instance->core_id;
 }
 
-static int get_core_id_from_channel(struct ast_channel *chan)
-{
-	struct ast_datastore *datastore;
-	struct dialed_cc_interfaces *cc_dialed_interfaces;
-	int core_id;
-
-	ast_channel_lock(chan);
-	if (!(datastore = ast_channel_datastore_find(chan, &dialed_cc_interfaces_info, NULL))) {
-		/* This should be impossible... */
-		ast_channel_unlock(chan);
-		return -1;
-	}
-
-	cc_dialed_interfaces = datastore->data;
-	core_id = cc_dialed_interfaces->core_id;
-	ast_channel_unlock(chan);
-	return core_id;
-}
-
 int ast_cc_offer(struct ast_channel *caller_chan)
 {
 	char *caller = ast_strdupa(caller_chan->name);
@@ -1951,7 +1931,7 @@
 		*dash = '\0';
 	}
 
-	if ((core_id = get_core_id_from_channel(caller_chan)) < 0) {
+	if ((core_id = ast_cc_get_current_core_id(caller_chan)) < 0) {
 		ast_log(LOG_WARNING, "This should not be possible. No core instance found, so can't offer CC to caller\n");
 		return res;
 	}




More information about the asterisk-commits mailing list