[svn-commits] mmichelson: branch group/CCSS r221691 - /team/group/CCSS/main/ccss.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 1 13:54:18 CDT 2009


Author: mmichelson
Date: Thu Oct  1 13:54:14 2009
New Revision: 221691

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=221691
Log:
* Fix compilation
* Remove unnecessary parameter from function
* Remove redundant doxy from 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=221691&r1=221690&r2=221691
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Oct  1 13:54:14 2009
@@ -644,7 +644,7 @@
 		return NULL;
 	}
 
-	tree_item->id = ast_atomic_fetchadd_int(&dial_cc_interface_counter, +1);
+	tree_item->id = ast_atomic_fetchadd_int(&dialed_cc_interface_counter, +1);
 	tree_item->parent_id = parent_id;
 	cc_interface->monitor_type = "extension";
 	cc_interface->monitor_class = AST_CC_EXTENSION_MONITOR;
@@ -728,18 +728,17 @@
  * to happen anyway.
  *
  * \param name The name of the device being added to the tree
- * \param name_len The length of name, in bytes
  * \param parent_id The parent of this new tree node.
  * \retval NULL Memory allocation failure
  * \retval non-NULL The new ast_cc_interface created.
  */
-static struct ast_cc_tree_item *cc_device_tree_item_init(const char * const name, const size_t name_len,
-		const int parent_id, const struct ast_control_cc_payload *cc_data)
-{
-	struct ast_cc_interface *cc_interface = ao2_alloc(sizeof(*cc_interface) + name_len, ast_cc_interface_destroy);
+static struct ast_cc_tree_item *cc_device_tree_item_init(const char * const name, const int parent_id, const struct ast_control_cc_payload *cc_data)
+{
+	struct ast_cc_interface *cc_interface;
 	struct ast_cc_tree_item *tree_item;
-
-	if (!cc_interface) {
+	size_t name_len = strlen(name);
+
+	if (!(cc_interface = ao2_alloc(sizeof(*cc_interface) + name_len, ast_cc_interface_destroy))) {
 		return NULL;
 	}
 
@@ -754,7 +753,7 @@
 	}
 
 	strcpy(cc_interface->name, name);
-	tree_item->id = ast_atomic_fetchadd_int(&dial_cc_interface_counter, +1);
+	tree_item->id = ast_atomic_fetchadd_int(&dialed_cc_interface_counter, +1);
 	tree_item->parent_id = parent_id;
 	tree_item->service_offered = cc_data->service;
 	cc_interface->monitor_type = cc_data->monitor_type;
@@ -825,7 +824,7 @@
 	AST_LIST_UNLOCK(cc_interfaces->interface_tree);
 
 
-	if (!(tree_item = cc_device_tree_item_init(device_name, strlen(device_name), cc_interfaces->dial_parent_id, cc_data))) {
+	if (!(tree_item = cc_device_tree_item_init(device_name, cc_interfaces->dial_parent_id, cc_data))) {
 		ast_log(LOG_WARNING, "Unable to create CC device interface for '%s'. CC services will be unavailable on this interface.\n", device_name);
 		return;
 	}
@@ -869,25 +868,11 @@
 	return 0;
 }
 
-/*!
- * \brief Create the root extension interface for this Dial attempt
- *
- * This function is called at the beginning of a dial attempt to get the
- * ball rolling as far as CC is concerned. See the in-line comments about the
- * three situations that can occur for more details.
- *
- * \param chan The channel on which the dialed_cc_interfaces datastore is on or needs
- * to be created on
- * \param[out] ignore_cc If the datastore is already on the channel and the done flag
- * is set, then we will set this so that new CC offers will be ignored
- * \retval 0 Success
- * \retval -1 Failure
- */
 int ast_cc_create_root_tree_item(struct ast_channel *chan, int *ignore_cc)
 {
 	/* There are three situations to deal with here:
 	 *
-	 * 1. The channel does not have a cc_interface datastore on
+	 * 1. The channel does not have a dialed_cc_interfaces datastore on
 	 * it. This means that this is the first time that Dial has
 	 * been called. We need to create/initialize the datastore.
 	 *
@@ -2489,6 +2474,6 @@
 	ast_log(LOG_NOTICE, "Successfully created the root CC monitor\n");
 	/* FOR THE LOVE OF GOD DO NOT SET root_monitor TO NULL HERE */
 	cc_unref(root_monitor, "Unref root monitor from allocation");
-	dial_cc_interface_counter = 1;
+	dialed_cc_interface_counter = 1;
 	return res;
 }




More information about the svn-commits mailing list