[asterisk-commits] mmichelson: branch mmichelson/features_config r389523 - in /team/mmichelson/f...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 22 14:18:36 CDT 2013


Author: mmichelson
Date: Wed May 22 14:18:33 2013
New Revision: 389523

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389523
Log:
Add functions to get channel-specific feature configuration.


Modified:
    team/mmichelson/features_config/include/asterisk/features.h
    team/mmichelson/features_config/main/features.c

Modified: team/mmichelson/features_config/include/asterisk/features.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/include/asterisk/features.h?view=diff&rev=389523&r1=389522&r2=389523
==============================================================================
--- team/mmichelson/features_config/include/asterisk/features.h (original)
+++ team/mmichelson/features_config/include/asterisk/features.h Wed May 22 14:18:33 2013
@@ -266,6 +266,18 @@
  * The returned value has its reference count incremented.
  */
 struct ast_features_general_config *ast_get_features_general_config(void);
+
+/*!
+ * \brief Get the general configuration options for a channel
+ *
+ * \note The channel should be locked before calling this function.
+ * \note The returned value has its reference count incremented.
+ *
+ * \param chan The channel to get configuration options for
+ * \retval NULL Failed to get configuration
+ * \retval non-NULL The general features configuration
+ */
+struct ast_features_general_config *ast_get_chan_features_general_config(struct ast_channel *chan);
 
 /*!
  * \brief Feature configuration relating to transfers
@@ -297,6 +309,18 @@
 struct ast_features_xfer_config *ast_get_features_xfer_config(void);
 
 /*!
+ * \brief Get the transfer configuration options for a channel
+ *
+ * \note The channel should be locked before calling this function.
+ * \note The returned value has its reference count incremented.
+ *
+ * \param chan The channel to get configuration options for
+ * \retval NULL Failed to get configuration
+ * \retval non-NULL The transfer features configuration
+ */
+struct ast_features_xfer_config *ast_get_chan_features_xfer_config(struct ast_channel *chan);
+
+/*!
  * \brief Configuration relating to call pickup
  */
 struct ast_features_pickup_config {
@@ -317,6 +341,18 @@
  */
 struct ast_features_pickup_config *ast_get_features_pickup_config(void);
 
+/*!
+ * \brief Get the pickup configuration options for a channel
+ *
+ * \note The channel should be locked before calling this function.
+ * \note The returned value has its reference count incremented.
+ *
+ * \param chan The channel to get configuration options for
+ * \retval NULL Failed to get configuration
+ * \retval non-NULL The pickup features configuration
+ */
+struct ast_features_pickup_config *ast_get_chan_features_pickup_config(struct ast_channel *chan);
+
 void ast_rdlock_call_features(void);
 void ast_unlock_call_features(void);
 

Modified: team/mmichelson/features_config/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/main/features.c?view=diff&rev=389523&r1=389522&r2=389523
==============================================================================
--- team/mmichelson/features_config/main/features.c (original)
+++ team/mmichelson/features_config/main/features.c Wed May 22 14:18:33 2013
@@ -6732,23 +6732,65 @@
 	return cfg->global->general;
 }
 
-struct ast_features_xfer_config *ast_get_features_xfer_config(void)
-{
-	RAII_VAR(struct features_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
+struct ast_features_general_config *ast_get_chan_features_general_config(struct ast_channel *chan)
+{
+	RAII_VAR(struct features_config *, cfg, get_feature_ds(chan), ao2_cleanup);
 
 	if (!cfg) {
 		return NULL;
 	}
 
+	ast_assert(cfg->global && cfg->global->general);
+
+	ao2_ref(cfg->global->general, +1);
+	return cfg->global->general;
+}
+
+struct ast_features_xfer_config *ast_get_features_xfer_config(void)
+{
+	RAII_VAR(struct features_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
+
+	if (!cfg) {
+		return NULL;
+	}
+
 	ast_assert(cfg->global && cfg->global->xfer);
 
 	ao2_ref(cfg->global->xfer, +1);
 	return cfg->global->xfer;
 }
 
+struct ast_features_xfer_config *ast_get_chan_features_xfer_config(struct ast_channel *chan)
+{
+	RAII_VAR(struct features_config *, cfg, get_feature_ds(chan), ao2_cleanup);
+
+	if (!cfg) {
+		return NULL;
+	}
+
+	ast_assert(cfg->global && cfg->global->xfer);
+
+	ao2_ref(cfg->global->xfer, +1);
+	return cfg->global->xfer;
+}
+
 struct ast_features_pickup_config *ast_get_features_pickup_config(void)
 {
 	RAII_VAR(struct features_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
+
+	if (!cfg) {
+		return NULL;
+	}
+
+	ast_assert(cfg->global && cfg->global->pickup);
+
+	ao2_ref(cfg->global->pickup, +1);
+	return cfg->global->pickup;
+}
+
+struct ast_features_pickup_config *ast_get_chan_features_pickup_config(struct ast_channel *chan)
+{
+	RAII_VAR(struct features_config *, cfg, get_feature_ds(chan), ao2_cleanup);
 
 	if (!cfg) {
 		return NULL;




More information about the asterisk-commits mailing list