[svn-commits] twilson: branch 1.4 r151763 - in /branches/1.4: ./ configs/ res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 23 11:04:42 CDT 2008


Author: twilson
Date: Thu Oct 23 11:04:42 2008
New Revision: 151763

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151763
Log:
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

Modified:
    branches/1.4/CHANGES
    branches/1.4/configs/features.conf.sample
    branches/1.4/res/res_features.c

Modified: branches/1.4/CHANGES
URL: http://svn.digium.com/view/asterisk/branches/1.4/CHANGES?view=diff&rev=151763&r1=151762&r2=151763
==============================================================================
--- branches/1.4/CHANGES (original)
+++ branches/1.4/CHANGES Thu Oct 23 11:04:42 2008
@@ -230,6 +230,7 @@
                       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

Modified: branches/1.4/configs/features.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.4/configs/features.conf.sample?view=diff&rev=151763&r1=151762&r2=151763
==============================================================================
--- branches/1.4/configs/features.conf.sample (original)
+++ branches/1.4/configs/features.conf.sample Thu Oct 23 11:04:42 2008
@@ -15,6 +15,8 @@
 				; 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

Modified: branches/1.4/res/res_features.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_features.c?view=diff&rev=151763&r1=151762&r2=151763
==============================================================================
--- branches/1.4/res/res_features.c (original)
+++ branches/1.4/res/res_features.c Thu Oct 23 11:04:42 2008
@@ -91,6 +91,8 @@
 static char parkmohclass[MAX_MUSICCLASS];                  /*!< Music class used for parking */
 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 */
@@ -2194,8 +2196,13 @@
 		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 @@
 	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 @@
 			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")) {




More information about the svn-commits mailing list