diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-23 16:04:42 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-23 16:04:42 +0000 |
commit | 940a97ac80a6d30f968248552de6c988b2957333 (patch) | |
tree | dfeaecd1586a49938c808a81ca99ad66e5a773a7 /res | |
parent | 8ac3423ba0f6cdf3114c5562edc53cd074854eb3 (diff) |
Backport fix from 1.6.0 that allows you to set parkedcalltransfers=no|caller|callee|both, but default to both which would be the equivalent of the existing behaviour.
The problem was that if someone parked a call, the callee and caller would both get assigned the builtin transfer feature, which would not only be potentially giving someone the ability to transfer themselves when they shouldn't have it, but would also dissallow reinviting the media off of the call.
(closes issue #12854)
Reported by: davidw
Patches:
parkingfix4.diff.txt uploaded by otherwiseguy
Tested by: davidw, otherwiseguy
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@151763 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/res/res_features.c b/res/res_features.c index 57a309ad8..e1c426ff3 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -92,6 +92,8 @@ static char parkmohclass[MAX_MUSICCLASS]; /*!< Music class used static int parking_start; /*!< First available extension for parking */ static int parking_stop; /*!< Last available extension for parking */ +static int parkedcalltransfers; /*!< Who can REDIRECT after picking up a parked a call */ + static char courtesytone[256]; /*!< Courtesy tone */ static int parkedplay = 0; /*!< Who to play the courtesy tone to */ static char xfersound[256]; /*!< Call transfer sound */ @@ -2194,8 +2196,13 @@ static int park_exec(struct ast_channel *chan, void *data) pbx_builtin_setvar_helper(chan, "PARKEDCHANNEL", peer->name); ast_cdr_setdestchan(chan->cdr, peer->name); memset(&config, 0, sizeof(struct ast_bridge_config)); - ast_set_flag(&(config.features_callee), AST_FEATURE_REDIRECT); - ast_set_flag(&(config.features_caller), AST_FEATURE_REDIRECT); + + if ((parkedcalltransfers == AST_FEATURE_FLAG_BYCALLEE) || (parkedcalltransfers == AST_FEATURE_FLAG_BYBOTH)) { + ast_set_flag(&(config.features_callee), AST_FEATURE_REDIRECT); + } + if ((parkedcalltransfers == AST_FEATURE_FLAG_BYCALLER) || (parkedcalltransfers == AST_FEATURE_FLAG_BYBOTH)) { + ast_set_flag(&(config.features_caller), AST_FEATURE_REDIRECT); + } res = ast_bridge_call(chan, peer, &config); pbx_builtin_setvar_helper(chan, "PARKEDCHANNEL", peer->name); @@ -2486,6 +2493,7 @@ static int load_config(void) parkfindnext = 0; adsipark = 0; parkaddhints = 0; + parkedcalltransfers = AST_FEATURE_FLAG_BYBOTH; transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT; featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT; @@ -2518,6 +2526,15 @@ static int load_config(void) parkfindnext = (!strcasecmp(var->value, "next")); } else if (!strcasecmp(var->name, "parkinghints")) { parkaddhints = ast_true(var->value); + } else if (!strcasecmp(var->name, "parkedcalltransfers")) { + if (!strcasecmp(var->value, "no")) + parkedcalltransfers = 0; + else if (!strcasecmp(var->value, "caller")) + parkedcalltransfers = AST_FEATURE_FLAG_BYCALLER; + else if (!strcasecmp(var->value, "callee")) + parkedcalltransfers = AST_FEATURE_FLAG_BYCALLEE; + else if (!strcasecmp(var->value, "both")) + parkedcalltransfers = AST_FEATURE_FLAG_BYBOTH; } else if (!strcasecmp(var->name, "adsipark")) { adsipark = ast_true(var->value); } else if (!strcasecmp(var->name, "transferdigittimeout")) { |