aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_features.c
diff options
context:
space:
mode:
authorbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-21 15:25:31 +0000
committerbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-21 15:25:31 +0000
commit335e27bbdebd6d729df9e1f3cb4da00063a62c3c (patch)
tree59b5ddc5e514b16bfce094476b813ce3a0656206 /res/res_features.c
parent941e1558d32d4838afbad437615b3504676357dc (diff)
Merged revisions 29196 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r29196 | bweschke | 2006-05-21 10:16:59 -0500 (Sun, 21 May 2006) | 3 lines When an application that is executed via applicationmap and exits non-zero, make sure that we pass through the correct return value from the application to make sure a segfault doesn't occur by a bridge trying to continue when it should not. Also, when executing applications via applicationmap, make sure that the application is executed against the channel whose DTMF caused it to be fired off in the first place. (part 1/2 of #7090 - this is the only fix that will be applied to both 1.2 and /trunk) acunningham and blitzrage on testing... ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@29197 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_features.c')
-rw-r--r--res/res_features.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/res/res_features.c b/res/res_features.c
index c523f8811..f71f6a913 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -860,8 +860,12 @@ static int feature_exec_app(struct ast_channel *chan, struct ast_channel *peer,
if (app) {
struct ast_channel *work = ast_test_flag(feature,AST_FEATURE_FLAG_CALLEE) ? peer : chan;
res = pbx_exec(work, app, feature->app_args);
- if (res < 0)
- return res;
+ if (res == AST_PBX_KEEPALIVE)
+ return FEATURE_RETURN_PBX_KEEPALIVE;
+ else if (res == AST_PBX_NO_HANGUP_PEER)
+ return FEATURE_RETURN_NO_HANGUP_PEER;
+ else if (res)
+ return FEATURE_RETURN_SUCCESSBREAK;
} else {
ast_log(LOG_WARNING, "Could not find application (%s)\n", feature->app);
return -2;
@@ -935,7 +939,10 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p
if (!strcmp(feature->exten, code)) {
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);
+ if (sense == FEATURE_SENSE_CHAN)
+ res = feature->operation(chan, peer, config, code, sense);
+ else
+ res = feature->operation(peer, chan, config, code, sense);
break;
} else if (!strncmp(feature->exten, code, strlen(code))) {
res = FEATURE_RETURN_STOREDIGITS;