mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@151763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -230,6 +230,7 @@ Changes since Asterisk 1.2:
|
||||
o atxfernoanswertimeout variable added
|
||||
o parkcall variable added (one step parking)
|
||||
o improved documentation for dynamic feature declarations!
|
||||
o added parkedcallltransfers option to control builtin transfers with parking
|
||||
9. iax.conf
|
||||
o adsi variable added
|
||||
o mohinterpret variable added
|
||||
|
@@ -15,6 +15,8 @@ context => parkedcalls ; Which context parked calls are in
|
||||
; or the Touch Monitor is activated/deactivated.
|
||||
;parkedplay = caller ; Who to play the courtesy tone to when picking up a parked call
|
||||
; one of: parked, caller, both (default is caller)
|
||||
;parkedcalltransfers = caller ; Enables or disables DTMF based transfers when picking up a parked call.
|
||||
; one of: callee, caller, both, no (default is both)
|
||||
;adsipark = yes ; if you want ADSI parking announcements
|
||||
;findslot => next ; Continue to the 'next' free parking space.
|
||||
; Defaults to 'first' available
|
||||
|
@@ -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")) {
|
||||
|
Reference in New Issue
Block a user