Allow the user to specify where to enable the respective features for when a parked...
authorJoshua Colp <jcolp@digium.com>
Fri, 16 Feb 2007 18:08:34 +0000 (18:08 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 16 Feb 2007 18:08:34 +0000 (18:08 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54910 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

index ea40a80..a35453f 100644 (file)
@@ -15,8 +15,10 @@ 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 = yes      ; Enables or disables DTMF based transfers when picking up a parked call
-;parkedcallreparking = yes      ; Enables or disables DTMF based parking when picking up a parked call
+;parkedcalltransfers = caller   ; Enables or disables DTMF based transfers when picking up a parked call.
+                                ; one of: callee, caller, both, no (default is no)
+;parkedcallreparking = caller   ; Enables or disables DTMF based parking when picking up a parked call.
+                                ; one of: callee, caller, both, no (default is no)
 ;adsipark = yes                        ; if you want ADSI parking announcements
 ;findslot => next              ; Continue to the 'next' free parking space. 
                                ; Defaults to 'first' available
index 06647c9..8c0600e 100644 (file)
@@ -1830,14 +1830,14 @@ static int park_exec(struct ast_channel *chan, void *data)
                        ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park);
 
                memset(&config, 0, sizeof(struct ast_bridge_config));
-               if (parkedcalltransfers) {
+               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);
-               }
-               if (parkedcallreparking) {
+               if ((parkedcallreparking == AST_FEATURE_FLAG_BYCALLEE) || (parkedcallreparking == AST_FEATURE_FLAG_BYBOTH))
                        ast_set_flag(&(config.features_callee), AST_FEATURE_PARKCALL);
+               if ((parkedcallreparking == AST_FEATURE_FLAG_BYCALLER) || (parkedcallreparking == AST_FEATURE_FLAG_BYBOTH))
                        ast_set_flag(&(config.features_caller), AST_FEATURE_PARKCALL);
-               }
                res = ast_bridge_call(chan, peer, &config);
 
                pbx_builtin_setvar_helper(chan, "PARKEDCHANNEL", peer->name);
@@ -2162,9 +2162,19 @@ static int load_config(void)
                } else if (!strcasecmp(var->name, "parkinghints")) {
                        parkaddhints = ast_true(var->value);
                } else if (!strcasecmp(var->name, "parkedcalltransfers")) {
-                       parkedcalltransfers = ast_true(var->value);
+                       if (!strcasecmp(var->value, "both"))
+                               parkedcalltransfers = AST_FEATURE_FLAG_BYBOTH;
+                       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->name, "parkedcallreparking")) {
-                       parkedcallreparking = ast_true(var->value);
+                       if (!strcasecmp(var->value, "both"))
+                               parkedcalltransfers = AST_FEATURE_FLAG_BYBOTH;
+                       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->name, "adsipark")) {
                        adsipark = ast_true(var->value);
                } else if (!strcasecmp(var->name, "transferdigittimeout")) {