[Asterisk-code-review] res_parking: Warn if out of bounds parking spot requested. (asterisk[19])

Friendly Automation asteriskteam at digium.com
Mon Jun 6 16:44:07 CDT 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/18590 )

Change subject: res_parking: Warn if out of bounds parking spot requested.
......................................................................

res_parking: Warn if out of bounds parking spot requested.

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
---
M res/parking/parking_controller.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/res/parking/parking_controller.c b/res/parking/parking_controller.c
index 365acdd..9b789ce 100644
--- a/res/parking/parking_controller.c
+++ b/res/parking/parking_controller.c
@@ -110,6 +110,8 @@
 
 	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;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18590
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: I1080371e4f63e94724455003753014fbd3f95fbf
Gerrit-Change-Number: 18590
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220606/6d8b2e37/attachment.html>


More information about the asterisk-code-review mailing list