[asterisk-commits] mmichelson: branch group/CCSS r230933 - in /team/group/CCSS: channels/ funcs/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 23 10:27:01 CST 2009


Author: mmichelson
Date: Mon Nov 23 10:26:58 2009
New Revision: 230933

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=230933
Log:
* Removed REF_DEBUG define from ccss.c
* Added ASTERISK_FILE_VERSION macro to ccss.c and func_callcompletion.c
* Removed unnecessary uses of ast_string_field_free_memory from chan_sip.c
* Added \internal to internal functions and structures in ccss.c
* load_module in func_callcompletion returns an explicit AST_MODULE_LOAD_SUCCESS or AST_MODULE_LOAD_DECLINED

All the above changes were made in response to Russell's review of the code.


Modified:
    team/group/CCSS/channels/chan_sip.c
    team/group/CCSS/funcs/func_callcompletion.c
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=230933&r1=230932&r2=230933
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Mon Nov 23 10:26:58 2009
@@ -7887,7 +7887,6 @@
 	}
 
 	if (!(p->cc_params = ast_cc_config_params_init())) {
-		ast_string_field_free_memory(p);
 		ao2_t_ref(p, -1, "Yuck, couldn't allocate cc_params struct. Get rid o' p");
 		return NULL;
 	}
@@ -25498,7 +25497,6 @@
 		}
 
 		if (!(peer->cc_params = ast_cc_config_params_init())) {
-			ast_string_field_free_memory(peer);
 			ao2_t_ref(peer, -1, "failed to allocate cc_params for peer");
 			return NULL;
 		}

Modified: team/group/CCSS/funcs/func_callcompletion.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/funcs/func_callcompletion.c?view=diff&rev=230933&r1=230932&r2=230933
==============================================================================
--- team/group/CCSS/funcs/func_callcompletion.c (original)
+++ team/group/CCSS/funcs/func_callcompletion.c Mon Nov 23 10:26:58 2009
@@ -22,6 +22,9 @@
  */
 
 #include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
 #include "asterisk/module.h"
 #include "asterisk/channel.h"
 #include "asterisk/ccss.h"
@@ -103,7 +106,7 @@
 
 static int load_module(void)
 {
-	return ast_custom_function_register(&cc_function);
+	return ast_custom_function_register(&cc_function) == 0 ? AST_MODULE_LOAD_SUCCESS : AST_MODULE_LOAD_DECLINE;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call Control Configuration Function");

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=230933&r1=230932&r2=230933
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Mon Nov 23 10:26:58 2009
@@ -22,7 +22,9 @@
  */
 
 #include "asterisk.h"
-#define REF_DEBUG 1
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
 #include "asterisk/astobj2.h"
 #include "asterisk/strings.h"
 #include "asterisk/ccss.h"
@@ -115,6 +117,7 @@
 	CC_FAILED,
 };
 /*!
+ * \internal
  * \brief Request that the core change states
  * \param state The state to which we wish to change
  * \param core_id The unique identifier for this instance of the CCSS core state machine
@@ -125,6 +128,7 @@
 static int cc_request_state_change(enum cc_state, int core_id, const char * debug);
 
 /*!
+ * \internal
  * \brief create a new instance of the CC core and an agent for the calling channel
  *
  * This function will check to make sure that the incoming channel
@@ -146,6 +150,7 @@
 		struct ast_cc_interface_tree *called_tree, const int core_id);
 
 /*
+ * \internal
  * \brief Pass monitor failure up the tree
  *
  * When a monitor has a failure, and it is determined that its parent has no
@@ -246,6 +251,7 @@
 /* ao2_callbacks for cc_core_instances */
 
 /*!
+ * \internal
  * \brief find a core instance based on its agent
  *
  * The match flags tell whether we wish to find core instances
@@ -285,6 +291,7 @@
 };
 
 /*!
+ * \internal
  * \brief Count the number of agents a specific interface is using
  *
  * We're only concerned with the number of agents that have requested
@@ -330,6 +337,7 @@
 
 /*!
  * \since 1.6.4
+ * \internal
  * \brief A structure for holding the configuration parameters
  * relating to CCSS
  */
@@ -517,10 +525,6 @@
 	return 0;
 }
 
-/* Heh, I suppose that we could just check if the first two characters
- * of an option name are 'cc' and this could be a lot more efficient.
- * That seems HIGHLY error prone, though, so I'll just do this the long way
- */
 int ast_cc_is_config_param(const char * const name)
 {
 	return (!strcasecmp(name, "cc_agent_policy") ||
@@ -1165,6 +1169,7 @@
 }
 
 /*!
+ * \internal
  * \brief An item in a CC interface tree.
  *
  * These are the individual items in an interface tree.
@@ -1242,6 +1247,7 @@
 static int dialed_cc_interface_counter;
 
 /*!
+ * \internal
  * \brief data stored in CC datastore
  *
  * The datastore creates a list of interfaces that were
@@ -1303,6 +1309,7 @@
 };
 
 /*!
+ * \internal
  * \brief Destructor function for cc_interfaces datastore
  *
  * This function will free the actual datastore and drop
@@ -1322,6 +1329,7 @@
 }
 
 /*!
+ * \internal
  * \brief Duplicate callback for cc_interfaces datastore
  *
  * Integers are copied by value, but the interface tree
@@ -1349,6 +1357,7 @@
 }
 
 /*!
+ * \internal
  * \brief information regarding the dialed_cc_interfaces datastore
  *
  * The dialed_cc_interfaces datastore is responsible for keeping track
@@ -1380,6 +1389,7 @@
 }
 
 /*!
+ * \internal
  * \brief Allocate and initialize an "extension" interface for CC purposes
  *
  * When app_dial starts, this function is called in order to set up the
@@ -1420,6 +1430,7 @@
 }
 
 /*!
+ * \internal
  * \brief allocate dialed_cc_interfaces datastore and initialize fields
  *
  * This function is called when Situation 1 occurs in ast_cc_call_init.
@@ -1496,6 +1507,7 @@
 };
 
 /*!
+ * \internal
  * \brief Allocate and intitialize a device cc_tree_item
  *
  * For all intents and purposes, this is the same as
@@ -1552,6 +1564,7 @@
 }
 
 /*!
+ * \internal
  * \brief Function for handling AST_CONTROL_CC frames
  *
  * Unless we are ignoring CC for some reason, we will always
@@ -2254,6 +2267,7 @@
 }
 
 /*!
+ * \internal
  * \brief pass a state change up the monitor tree
  *
  * When a device monitor has had a state change, it will try
@@ -2316,6 +2330,7 @@
 }
 
 /*!
+ * \internal
  * \brief process a reported device state change from a monitor
  *
  * Since this executes in the core taskprocessor thread,
@@ -2811,18 +2826,7 @@
 	ast_free(var_value);
 	return 0;
 }
-/*!
- * \brief Routine to set the ignore flag on all CC datastores
- *
- * When we determine that further calls to Dial in a particular thread should
- * not pay attention to any new CC offers, we set this flag as an indicator.
- *
- * The same also applies for recall purposes. If a call is forwarded or a second
- * Dial is invoked, then the target cannot be a purposeful target of a CC recall.
- *
- * \param chan The calling channel with teh dial_cc_interfaaces datastore on it
- * \return void
- */
+
 void ast_ignore_cc(struct ast_channel *chan)
 {
 	struct ast_datastore *cc_datastore;




More information about the asterisk-commits mailing list