diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-04 17:00:29 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-04 17:00:29 +0000 |
commit | 37c0ec6d1c39ee94a54044d4daac271be487aa22 (patch) | |
tree | 2ee3571ad97669766cc0f3857c7da837fabbe5d0 | |
parent | 7d32d5562cf8b8c91a21ec13caa024ee07d57a74 (diff) |
(closes issue #11979)
Fixes multiple parking problems:
Crash when executing a park on an extension dialed by AGI due to not returning the proper return code.
Crash when using a builtin feature that was a subset of a enabled dynamic feature.
Crash due to always hanging up the peer despite the fact that the peer was supposed to be parked.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141028 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | res/res_agi.c | 2 | ||||
-rw-r--r-- | res/res_features.c | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 20bb9331b..2ab5b8b31 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -2092,7 +2092,7 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int return -1; } - return 0; + return res; } static int agi_exec(struct ast_channel *chan, void *data) diff --git a/res/res_features.c b/res/res_features.c index 75e1ccbd9..24b0a46b2 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -1083,8 +1083,13 @@ static int feature_exec_app(struct ast_channel *chan, struct ast_channel *peer, ast_autoservice_stop(idle); - if (res == AST_PBX_KEEPALIVE) - return FEATURE_RETURN_PBX_KEEPALIVE; + if (res == AST_PBX_KEEPALIVE) { + /* do not hangup peer if feature is to be activated on it */ + if ((ast_test_flag(feature, AST_FEATURE_FLAG_ONPEER) && sense == FEATURE_SENSE_CHAN) || (ast_test_flag(feature, AST_FEATURE_FLAG_ONSELF) && sense == FEATURE_SENSE_PEER)) + return FEATURE_RETURN_NO_HANGUP_PEER; + else + return FEATURE_RETURN_PBX_KEEPALIVE; + } else if (res == AST_PBX_NO_HANGUP_PEER) return FEATURE_RETURN_NO_HANGUP_PEER; else if (res) @@ -1125,10 +1130,11 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p { int x; struct ast_flags features; - int res = FEATURE_RETURN_PASSDIGITS; struct ast_call_feature *feature; const char *dynamic_features; char *tmp, *tok; + int res = FEATURE_RETURN_PASSDIGITS; + int feature_detected = 0; if (sense == FEATURE_SENSE_CHAN) { ast_copy_flags(&features, &(config->features_caller), AST_FLAGS_ALL); @@ -1147,6 +1153,7 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p /* Feature is up for consideration */ if (!strcmp(builtin_features[x].exten, code)) { res = builtin_features[x].operation(chan, peer, config, code, sense, NULL); + feature_detected = 1; break; } else if (!strncmp(builtin_features[x].exten, code, strlen(code))) { if (res == FEATURE_RETURN_PASSDIGITS) @@ -1156,7 +1163,7 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p } ast_rwlock_unlock(&features_lock); - if (ast_strlen_zero(dynamic_features)) + if (ast_strlen_zero(dynamic_features) || feature_detected) return res; tmp = ast_strdupa(dynamic_features); |