[Asterisk-code-review] res parking: Fix blind transfer dynamic lots creation. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Sat Mar 26 14:25:54 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: res_parking: Fix blind transfer dynamic lots creation.
......................................................................


res_parking: Fix blind transfer dynamic lots creation.

Blind transfers to a recognized parking extension need to use the parker's
channel variable values to create the dynamic parking lot.  This is
because there is always only one parker while the parkee may actually be a
multi-party bridge.  A multi-party bridge can never supply the needed
channel variables to create the dynamic parking lot.  In the multi-party
bridge blind transfer scenario, the parker's CHANNEL(parkinglot) value and
channel variables are inherited by the local channel used to park the
bridge.

* In park_common_setup(), make use the parker instead of the parkee to
supply the dynamic parking lot channel variable values.  In all but one
case, the parkee is the same as the parker.  However, in the recognized
parking extension blind transfer scenario for a two party bridge they are
different channels.  For consistency, we need to use the parker channel.

* In park_local_transfer(), pass the CHANNEL(parkinglot) value to the
local channel when blind transferring a multi-party bridge to a recognized
parking extension.

* When a local channel starts a call, the Local;2 side needs to inherit
the CHANNEL(parkinglot) value from Local;1.

The DTMF one-touch parking case wasn't even trying to create dynamic
parking lots before it aborted the attempt.

* In parking_park_call(), add missing code to create a dynamic parking
lot.

A DTMF bridge hook is documented as returning -1 to remove the hook.
Though the hook caller is really coded to accept non-zero.  See the
ast_bridge_hook_callback typedef.

* In feature_park_call(), don't remove the DTMF one-touch parking hook
because of an error.

ASTERISK-24605 #close
Reported by:  Philip Correia
Patches:
      call_park.patch (license #6672) patch uploaded by Philip Correia

Change-Id: I221d3a8fcc181877a1158d17004474d35d8016c9
---
M UPGRADE.txt
M main/core_unreal.c
M res/parking/parking_applications.c
M res/parking/parking_bridge_features.c
4 files changed, 20 insertions(+), 4 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved; Verified
  George Joseph: Looks good to me, but someone else must approve



diff --git a/UPGRADE.txt b/UPGRADE.txt
index 471350c..4f40b2b 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -21,6 +21,17 @@
 === UPGRADE-12.txt  -- Upgrade info for 11 to 12
 ===========================================================
 
+From 13.8.0 to 13.9.0:
+
+res_parking:
+ - The dynamic parking lot creation channel variables PARKINGDYNAMIC,
+   PARKINGDYNCONTEXT, PARKINGDYNEXTEN, and PARKINGDYNPOS are now looked
+   for in the parker's channel instead of the parked channel.  This is only
+   of significance if the parker uses blind transfer or the DTMF one-step
+   parking feature.  You need to use the double underscore '__' inheritance
+   for these variables.  The indefinite inheritance is also recommended
+   for the PARKINGEXTEN variable.
+
 From 13.7.0 to 13.8.0:
 
 res_pjsip:
diff --git a/main/core_unreal.c b/main/core_unreal.c
index d57e01f..028e371 100644
--- a/main/core_unreal.c
+++ b/main/core_unreal.c
@@ -687,12 +687,12 @@
 	ast_connected_line_copy_from_caller(ast_channel_connected(semi2), ast_channel_caller(semi1));
 
 	ast_channel_language_set(semi2, ast_channel_language(semi1));
+	ast_channel_musicclass_set(semi2, ast_channel_musicclass(semi1));
+	ast_channel_parkinglot_set(semi2, ast_channel_parkinglot(semi1));
 
 	/* Crossover the accountcode and peeraccount to cross the unreal bridge. */
 	ast_channel_accountcode_set(semi2, ast_channel_peeraccount(semi1));
 	ast_channel_peeraccount_set(semi2, ast_channel_accountcode(semi1));
-
-	ast_channel_musicclass_set(semi2, ast_channel_musicclass(semi1));
 
 	ast_channel_cc_params_init(semi2, ast_channel_get_cc_config_params(semi1));
 
diff --git a/res/parking/parking_applications.c b/res/parking/parking_applications.c
index d8cda6f..48c7adc 100644
--- a/res/parking/parking_applications.c
+++ b/res/parking/parking_applications.c
@@ -455,7 +455,7 @@
 
 	lot = parking_lot_find_by_name(lot_name);
 	if (!lot) {
-		lot = parking_create_dynamic_lot(lot_name, parkee);
+		lot = parking_create_dynamic_lot(lot_name, parker);
 	}
 
 	if (!lot) {
diff --git a/res/parking/parking_bridge_features.c b/res/parking/parking_bridge_features.c
index a21be90..e74aed1 100644
--- a/res/parking/parking_bridge_features.c
+++ b/res/parking/parking_bridge_features.c
@@ -236,6 +236,7 @@
 	/* Before we actually dial out let's inherit appropriate information. */
 	ast_channel_lock_both(parker, parkee);
 	ast_channel_req_accountcodes(parkee, parker, AST_CHANNEL_REQUESTOR_REPLACEMENT);
+	ast_channel_parkinglot_set(parkee, ast_channel_parkinglot(parker));
 	ast_connected_line_copy_from_caller(ast_channel_connected(parkee), ast_channel_caller(parker));
 	ast_channel_inherit_variables(parker, parkee);
 	ast_channel_datastore_inherit(parker, parkee);
@@ -489,6 +490,9 @@
 
 	lot = parking_lot_find_by_name(lot_name);
 	if (!lot) {
+		lot = parking_create_dynamic_lot(lot_name, parker->chan);
+	}
+	if (!lot) {
 		ast_log(AST_LOG_WARNING, "Cannot Park %s: lot %s unknown\n",
 			ast_channel_name(parker->chan), lot_name);
 		return -1;
@@ -504,7 +508,8 @@
 {
 	SCOPED_MODULE_USE(parking_get_module_info()->self);
 
-	return parking_park_call(bridge_channel, NULL, 0);
+	parking_park_call(bridge_channel, NULL, 0);
+	return 0;
 }
 
 /*!

-- 
To view, visit https://gerrit.asterisk.org/2469
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I221d3a8fcc181877a1158d17004474d35d8016c9
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list