[Asterisk-code-review] pbx_variables: Add variable registration and validation (asterisk[master])

N A asteriskteam at digium.com
Sat Jul 23 17:46:34 CDT 2022


Attention is currently required from: Sean Bright, Joshua Colp, George Joseph, Kevin Harwell.
N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/17792 )

Change subject: pbx_variables: Add variable registration and validation
......................................................................


Patch Set 6:

(1 comment)

Patchset:

PS6: 
> but we can't reasonably prevent users from continuing to set variables they want to just because it might conflict

I agree - we will not prevent users from setting variables that conflict with something if it's not one of the hardcoded ones in pbx_variables.c

It was indicated in earlier rounds of feedback we should not do this, so the revised patches do not do this for any reason. Nobody thought this was a good idea so that was dropped a while back.

In fact, even for the built-in, I think it will technically set the channel variable, but it's essentially unusable at that point - a warning is still emitted to warn the user about this, since that can't possibly be intended behavior.

So we don't prevent anything, we just advise users they may want to use a different variable name if there is an actual confirmed conflict. The goal here is to be helpful, not needlessly restrict users from doing what they want.

Basically, we'll let the user do what they want, but if we think they made a mistake, then emit a warning to be helpful, and even then, this will rarely if ever happen since it requires an actual conflict with a built-in or module read only var.



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Iad3b8d9833c7d9debe04aca59260d7316c3ad28c
Gerrit-Change-Number: 17792
Gerrit-PatchSet: 6
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <default.enum at gmail.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Attention: Kevin Harwell <default.enum at gmail.com>
Gerrit-Comment-Date: Sat, 23 Jul 2022 22:46:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sean Bright <sean at seanbright.com>
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220723/27cdaf78/attachment.html>


More information about the asterisk-code-review mailing list