]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_parking: Warn if out of bounds parking spot requested.
authorNaveen Albert <asterisk@phreaknet.org>
Mon, 30 May 2022 20:55:33 +0000 (20:55 +0000)
committerKevin Harwell <kharwell@digium.com>
Mon, 6 Jun 2022 21:52:59 +0000 (16:52 -0500)
Emits a warning if the user has requested a parking spot that
is out of bounds for the requested parking lot.

ASTERISK-30086

Change-Id: I1080371e4f63e94724455003753014fbd3f95fbf

res/parking/parking_controller.c

index 365acddb7f640756512669a9d6706c1c277589c4..9b789ceaec9d9d4ff96e36e6669f1795b21da2ef 100644 (file)
@@ -110,6 +110,8 @@ int parking_lot_get_space(struct parking_lot *lot, int target_override)
 
        if (target_override >= lot->cfg->parking_start && target_override <= lot->cfg->parking_stop) {
                original_target = target_override;
+       } else if (target_override > -1) {
+               ast_log(LOG_WARNING, "Preferred parking spot %d is out of bounds (%d-%d)\n", target_override, lot->cfg->parking_start, lot->cfg->parking_stop);
        }
 
        current_target = original_target;