summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2007-05-04 18:47:19 +0000
committerSteve Murphy <murf@digium.com>2007-05-04 18:47:19 +0000
commit7ec9a2fb57d6c5aff0210da2108895d8d1058c58 (patch)
tree7e2cdf5f62940adf22aa28f5c6c84ab1ba4cdcc4 /res
parent02337303ef22d5b79967286b4a4b004401e3efff (diff)
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
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_features.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/res/res_features.c b/res/res_features.c
index a0df92447..8a411c096 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -1056,7 +1056,7 @@ static void ast_unregister_features(void)
}
/*! \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;
@@ -1070,6 +1070,18 @@ struct ast_call_feature *ast_find_call_feature(char *name)
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 */
static int feature_exec_app(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense)
{
@@ -1197,7 +1209,7 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p
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 @@ static void set_config_flags(struct ast_channel *chan, struct ast_channel *peer,
/* 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 @@ static int load_config(void)
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;
}