[svn-commits] murf: trunk r63076 - /trunk/res/res_features.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri May 4 11:47:20 MST 2007


Author: murf
Date: Fri May  4 13:47:19 2007
New Revision: 63076

URL: http://svn.digium.com/view/asterisk?view=rev&rev=63076
Log:
According to my testing, it's better if the ast_find_call_feature func ran this way instead, as far as the snom record button is concerned

Modified:
    trunk/res/res_features.c

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?view=diff&rev=63076&r1=63075&r2=63076
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Fri May  4 13:47:19 2007
@@ -1056,7 +1056,7 @@
 }
 
 /*! \brief find a call feature by name */
-struct ast_call_feature *ast_find_call_feature(char *name)
+static struct ast_call_feature *find_feature(char *name)
 {
 	struct ast_call_feature *tmp;
 
@@ -1068,6 +1068,18 @@
 	AST_LIST_UNLOCK(&feature_list);
 
 	return tmp;
+}
+
+/*! \brief find a call feature by name */
+struct ast_call_feature *ast_find_call_feature(char *name)
+{
+	int x;
+	for (x = 0; x < FEATURES_COUNT; x++) {
+		if (!strcasecmp(name, builtin_features[x].sname)) {
+			return &builtin_features[x];
+		}
+	}
+	return NULL;
 }
 
 /*! \brief exec an app by feature */
@@ -1197,7 +1209,7 @@
 		char *tok;
 
 		while ((tok = strsep(&tmp, "#")) != NULL) {
-			feature = ast_find_call_feature(tok);
+			feature = find_feature(tok);
 			
 			if (feature) {
 				/* Feature is up for consideration */
@@ -1241,7 +1253,7 @@
 
 			/* while we have a feature */
 			while ((tok = strsep(&tmp, "#"))) {
-				if ((feature = ast_find_call_feature(tok)) && ast_test_flag(feature, AST_FEATURE_FLAG_NEEDSDTMF)) {
+				if ((feature = find_feature(tok)) && ast_test_flag(feature, AST_FEATURE_FLAG_NEEDSDTMF)) {
 					if (ast_test_flag(feature, AST_FEATURE_FLAG_BYCALLER))
 						ast_set_flag(config, AST_BRIDGE_DTMF_CHANNEL_0);
 					if (ast_test_flag(feature, AST_FEATURE_FLAG_BYCALLEE))
@@ -2580,7 +2592,7 @@
 			continue;
 		}
 
-		if ((feature = ast_find_call_feature(var->name))) {
+		if ((feature = find_feature(var->name))) {
 			ast_log(LOG_WARNING, "Dynamic Feature '%s' specified more than once!\n", var->name);
 			continue;
 		}



More information about the svn-commits mailing list