]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Backport fix from 1.6.0 that allows you to set parkedcalltransfers=no|caller|callee...
authorTerry Wilson <twilson@digium.com>
Thu, 23 Oct 2008 16:04:42 +0000 (16:04 +0000)
committerTerry Wilson <twilson@digium.com>
Thu, 23 Oct 2008 16:04:42 +0000 (16:04 +0000)
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

CHANGES
configs/features.conf.sample
res/res_features.c

diff --git a/CHANGES b/CHANGES
index 816ad076a63e5ac7d4c2905f509f987e60720250..8b094ff135d001d304675d8ef61e789dc9d54223 100644 (file)
--- a/CHANGES
+++ b/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
index 969074c8e5484ad66c39abe18bc8c2a3c5aef883..92f7572094f966c244f982ecd9871d3bc08082d4 100644 (file)
@@ -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
index 57a309ad889800a6ca3ce4d488cd995a6fe0e2f4..e1c426ff33cc7efc5c71e1827e0bc064a8112585 100644 (file)
@@ -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")) {