[asterisk-commits] russell: branch 1.4 r82594 - /branches/1.4/res/res_features.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Sep 17 11:46:59 CDT 2007
Author: russell
Date: Mon Sep 17 11:46:59 2007
New Revision: 82594
URL: http://svn.digium.com/view/asterisk?view=rev&rev=82594
Log:
Handle the case where there are multiple dynamic features with the same digit
mapping, but won't always match the activated on/by access controls. In that
case, the code needs to keep trying features for a match.
(reported by Atis on the asterisk-dev list, patched by me)
Modified:
branches/1.4/res/res_features.c
Modified: branches/1.4/res/res_features.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_features.c?view=diff&rev=82594&r1=82593&r2=82594
==============================================================================
--- branches/1.4/res/res_features.c (original)
+++ branches/1.4/res/res_features.c Mon Sep 17 11:46:59 2007
@@ -479,6 +479,7 @@
#define FEATURE_RETURN_PASSDIGITS 21
#define FEATURE_RETURN_STOREDIGITS 22
#define FEATURE_RETURN_SUCCESS 23
+#define FEATURE_RETURN_KEEPTRYING 24
#define FEATURE_SENSE_CHAN (1 << 0)
#define FEATURE_SENSE_PEER (1 << 1)
@@ -966,7 +967,7 @@
if (sense == FEATURE_SENSE_CHAN) {
if (!ast_test_flag(feature, AST_FEATURE_FLAG_BYCALLER))
- return FEATURE_RETURN_PASSDIGITS;
+ return FEATURE_RETURN_KEEPTRYING;
if (ast_test_flag(feature, AST_FEATURE_FLAG_ONSELF)) {
work = chan;
idle = peer;
@@ -976,7 +977,7 @@
}
} else {
if (!ast_test_flag(feature, AST_FEATURE_FLAG_BYCALLEE))
- return FEATURE_RETURN_PASSDIGITS;
+ return FEATURE_RETURN_KEEPTRYING;
if (ast_test_flag(feature, AST_FEATURE_FLAG_ONSELF)) {
work = peer;
idle = chan;
@@ -1090,8 +1091,11 @@
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok);
res = feature->operation(chan, peer, config, code, sense, feature);
- AST_LIST_UNLOCK(&feature_list);
- break;
+ if (res != FEATURE_RETURN_KEEPTRYING) {
+ AST_LIST_UNLOCK(&feature_list);
+ break;
+ }
+ res = FEATURE_RETURN_PASSDIGITS;
} else if (!strncmp(feature->exten, code, strlen(code)))
res = FEATURE_RETURN_STOREDIGITS;
More information about the asterisk-commits
mailing list