diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-03-18 14:01:02 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-03-25 18:27:20 -0500 |
commit | a4189763ab562ee2e8e79fda60b213ee90aab6f1 (patch) | |
tree | efb672e9f605011f11ad227e7fa6f7b2eff3121c /res/parking/parking_manager.c | |
parent | 01150597f60cb0e4b906b2bf2b94188bb3b6ca14 (diff) |
res_parking: Misc fixes.
res/parking/parking_applications.c:
* Add malloc fail checks in setup_park_common_datastore().
* Fix playing parking failed announcement to only happen on non-blind
transfers in park_app_exec(). It could never go out before because a test
was provedly always false.
res/parking/parking_bridge.c:
* Fix NULL tolerance in generate_parked_user() because
bridge_parking_push() can theoretically pass a NULL parker channel if the
parker channel went away for some reason.
* Clarify some weird code dealing with blind_transfer in
bridge_parking_push().
res/parking/parking_bridge_features.c:
* Made park_local_transfer() set BLINDTRANSFER on the Local;1 channel
which will be bulk copied to the Local;2 channel on the subsequent
ast_call(). The additional advantage is if the parker channel has the
BLINDTRANSFER and ATTENDEDTRANSFER variables set they are now guaranteed
to be overridden.
res/parking/parking_manager.c:
* Fix AMI Park action input range checking of the Timeout header in
manager_park().
* Reduced locking scope to where needed in manager_park().
res/res_parking.c:
* Fix some off nominal missing unlocks by eliminating the returns.
Change-Id: Ib64945bc285acb05a306dc12e6f16854898915ca
Diffstat (limited to 'res/parking/parking_manager.c')
-rw-r--r-- | res/parking/parking_manager.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/res/parking/parking_manager.c b/res/parking/parking_manager.c index 435200b1e..ed28164fe 100644 --- a/res/parking/parking_manager.c +++ b/res/parking/parking_manager.c @@ -537,12 +537,12 @@ static int manager_park(struct mansession *s, const struct message *m) } if (!ast_strlen_zero(timeout)) { - if (sscanf(timeout, "%30d", &timeout_override) != 1 || timeout < 0) { + if (sscanf(timeout, "%30d", &timeout_override) != 1 || timeout_override < 0) { astman_send_error(s, m, "Invalid Timeout value."); return 0; } - if (timeout_override > 0) { + if (timeout_override) { /* If greater than zero, convert to seconds for internal use. Must be >= 1 second. */ timeout_override = MAX(1, timeout_override / 1000); } @@ -554,11 +554,11 @@ static int manager_park(struct mansession *s, const struct message *m) return 0; } - ast_channel_lock(chan); if (!ast_strlen_zero(timeout_channel)) { + ast_channel_lock(chan); ast_bridge_set_transfer_variables(chan, timeout_channel, 0); + ast_channel_unlock(chan); } - ast_channel_unlock(chan); parker_chan = ast_channel_bridge_peer(chan); if (!parker_chan || strcmp(ast_channel_name(parker_chan), timeout_channel)) { |