[svn-commits] mmichelson: branch group/CCSS r212842 - /team/group/CCSS/include/asterisk/ccss.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 18 13:04:45 CDT 2009


Author: mmichelson
Date: Tue Aug 18 13:04:42 2009
New Revision: 212842

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=212842
Log:
Add get/set functions for config items.

Next step is to actually write the definitions of those functions.
In the process, I will also make the structure which holds those opaque.


Modified:
    team/group/CCSS/include/asterisk/ccss.h

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=212842&r1=212841&r2=212842
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Tue Aug 18 13:04:42 2009
@@ -82,17 +82,203 @@
  * \since 1.6.4
  * \brief A structure for holding the configuration parameters 
  * relating to CCSS
+ *
+ * XXX Should be made opaque. Will do when I create main/ccss.c
  */
 struct ast_cc_config_params {
 	enum ccss_policy cc_agent_policy;
 	enum ccss_policy cc_monitor_policy;
-	unsigned int offer_timer;
+	unsigned int cc_offer_timer;
 	unsigned int ccnr_available_timer;
 	unsigned int ccbs_available_timer;
 	unsigned int cc_max_agents;
 	unsigned int cc_max_monitors;
+	/*XXX callback_macro only applies to generic agents. Should this
+	 * be part of the generic agent's private_data field? My initial
+	 * thinking is no, since it makes sense that someone might wish
+	 * to modify this the same way that they would modify any other
+	 * ccss configuration value. If someone sets a callback_macro and
+	 * we use a native ccss agent, then we'll just ignore the param...
+	 */
 	const char *callback_macro;
 };
+
+/*!
+ * \since 1.6.4
+ * \brief The various possibilities for cc_agent_policy values
+ */
+enum ast_cc_agent_policies {
+	/* Never offer CCSS to the caller */
+	AST_CCSS_AGENT_NEVER,
+	/* Offer CCSS using native signaling */
+	AST_CCSS_AGENT_NATIVE,
+	/* Use generic agent for caller */
+	AST_CCSS_AGENT_GENERIC,
+};
+
+/*!
+ * \since 1.6.4
+ * \brief The various possibilities for cc_monitor_policy values
+ */
+enum ast_cc_monitor_policies {
+	/* Never accept CCSS offers from callee */
+	AST_CCSS_MONITOR_NEVER,
+	/* CCSS only available if callee offers it through signaling */
+	AST_CCSS_MONITOR_NATIVE,
+	/* Always use CCSS generic monitor for callee
+	 * Note that if callee offers CCSS natively, we still
+	 * will use a generic CCSS monitor if this is set
+	 */
+	AST_CCSS_MONITOR_GENERIC,
+	/* Accept native CCSS offers, but if no offer is present,
+	 * use a generic CCSS monitor
+	 */
+	AST_CCSS_MONITOR_ALWAYS,
+};
+
+/*!
+ * \since 1.6.4
+ * \brief Get the cc_agent_policy
+ * \param config The configuration to retrieve the policy from
+ * \return The current cc_agent_policy for this configuration
+ */
+enum ast_cc_agent_policies ast_get_cc_agent_policy(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the cc_agent_policy
+ * \param config The configuration to set the cc_agent_policy on
+ * \param value The new cc_agent_policy we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_cc_agent_policy(struct ast_cc_config_params *config, enum ast_cc_agent_policies value);
+
+/*!
+ * \since 1.6.4
+ * \brief Get the cc_monitor_policy
+ * \param config The configuration to retrieve the cc_monitor_policy from
+ * \return The cc_monitor_policy retrieved from the configuration
+ */
+enum ast_cc_monitor_policies ast_get_cc_monitor_policy(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the cc_monitor_policy
+ * \param config The configuration to set the cc_monitor_policy on
+ * \param value The new cc_monitor_policy we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_cc_monitor_policy(struct ast_cc_config_params *config, enum ast_cc_monitor_policies value);
+
+/*!
+ * \since 1.6.4
+ * \brief Get the cc_offer_timer
+ * \param config The configuration to retrieve the cc_offer_timer from
+ * \return The cc_offer_timer from this configuration
+ */
+unsigned int ast_get_cc_offer_timer(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the cc_offer_timer
+ * \param config The configuration to set the cc_offer_timer on
+ * \param value The new cc_offer_timer we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_cc_offer_timer(struct ast_cc_config_params *config, unsigned int value);
+
+/*!
+ * \since 1.6.4
+ * \brief Get the ccnr_available_timer
+ * \param config The configuration to retrieve the ccnr_available_timer from
+ * \return The ccnr_available_timer from this configuration
+ */
+unsigned int ast_get_ccnr_available_timer(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the ccnr_available_timer
+ * \param config The configuration to set the ccnr_available_timer on
+ * \param value The new ccnr_available_timer we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_ccnr_available_timer_(struct ast_cc_config_params *config, unsigned int value);
+
+/*!
+ * \since 1.6.4
+ * \brief Get the ccbs_available_timer
+ * \param config The configuration to retrieve the ccbs_available_timer from
+ * \return The ccbs_available_timer from this configuration
+ */
+unsigned int ast_get_ccbs_available_timer(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the ccbs_available_timer
+ * \param config The configuration to set the ccbs_available_timer on
+ * \param value The new ccbs_available_timer we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_ccbs_available_timer(struct ast_cc_config_params *config, unsigned int value);
+
+/*!
+ * \since 1.6.4
+ * \brief Get the cc_max_agents
+ * \param config The configuration to retrieve the cc_max_agents from
+ * \return The cc_max_agents from this configuration
+ */
+unsigned int ast_get_cc_max_agents(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the cc_max_agents
+ * \param config The configuration to set the cc_max_agents on
+ * \param value The new cc_max_agents we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_cc_max_agents(struct ast_cc_config_params *config, unsigned int value);
+
+/*!
+ * \since 1.6.4
+ * \brief Get the cc_max_monitors
+ * \param config The configuration to retrieve the cc_max_monitors from
+ * \return The cc_max_monitors from this configuration
+ */
+unsigned int ast_get_cc_max_monitors(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the cc_max_monitors
+ * \param config The configuration to set the cc_max_monitors on
+ * \param value The new cc_max_monitors we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_cc_max_monitors(struct ast_cc_config_params *config, unsigned int value);
+
+/*!
+ * \since 1.6.4
+ * \brief Get the name of the callback_macro
+ * \param config The configuration to retrieve the callback_macro from
+ * \return The callback_macro name
+ */
+const char *ast_get_callback_macro(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.6.4
+ * \brief Set the callback_macro name
+ * \param config The configuration to set the callback_macro on
+ * \param value The new callback macro  we want to change to
+ * \retval 0 Success
+ * \retval -1 Failure (likely due to bad input)
+ */
+int ast_set_callback_macro(struct ast_cc_config_params *config, const char * const value);
 
 /*!
  * \brief a link that connects two monitors in the weighted graph of 




More information about the svn-commits mailing list