[Asterisk-code-review] channel_internal_api: Add LASTCONTEXT and LASTEXTEN (asterisk[master])

N A asteriskteam at digium.com
Thu Jan 6 16:59:13 CST 2022


Attention is currently required from: Sean Bright, Richard Mudgett.
N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/17784 )

Change subject: channel_internal_api: Add LASTCONTEXT and LASTEXTEN
......................................................................


Patch Set 2:

(1 comment)

Patchset:

PS2: 
> > What applications currently do this?
> 
> Things built by Asterisk users. Things that read/write channel variables (dialplan, AMI, AGI, etc). 

Users aren't supposed to write to all caps variables. So they would use ${lastexten} not ${LASTEXTEN}. If not, that's their fault.

> > As it's all caps, users shouldn't be using this variable (with this case).
> 
> I don’t follow. Is this your opinion or is this documented somewhere?

See Asterisk: The Definitive Guide, 5th edition, pg. 97, for example:

"Note that variable names are case-sensitive. A variable named SOME DIGITS is different from a variable named SomeDigits. You should also be aware that any variables set by Asterisk will be uppercase. Some variables, such as CHANNEL and EXTEN, are reserved by Aster‐ isk. You should not attempt to set these variables"

When I first started with Asterisk, I erroneously used all-caps variable names at times myself. Somebody who'd been using Asterisk since it came out quickly corrected me on that:
"Variable names.  Any Variable name which does not include at least ONE lower-case letter is reserved for use by the Asterisk developers.  You should never use variable names that are all upper case, because you might run into something that gets added in the future or is undocumented."

So using an all-caps variable name is something we have every right to do. It is explicitly documented and intended to be that way. I don't think accounting for people doing things the wrong way changes that.



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ib455fe300cc8e9a127686896ee2d0bd11e900307
Gerrit-Change-Number: 17784
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: Richard Mudgett <rmudgett at digium.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Thu, 06 Jan 2022 22:59:13 +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/20220106/0ea39ece/attachment.html>


More information about the asterisk-code-review mailing list