[Asterisk-code-review] ParkAndAnnounce: Add variable inheritance (asterisk[master])
Jonathan Rose
asteriskteam at digium.com
Fri Sep 4 10:29:26 CDT 2015
Jonathan Rose has posted comments on this change.
Change subject: ParkAndAnnounce: Add variable inheritance
......................................................................
Patch Set 3:
(1 comment)
https://gerrit.asterisk.org/#/c/1180/3/res/parking/parking_applications.c
File res/parking/parking_applications.c:
Line 732: newvar = ast_variable_new(varname, ast_var_value(current), "");
> I'm sure I am missing something... why isn't this:
First, this was a bit of copy pasta from the ast_channel_inherit_variables function which has been around for pretty much ever. So it's quite likely that it's correct.
It's fairly simple. We only inherit variables named the following conditions:
_VARNAME -- the variable is inheritable at a single level. The channel that inherits it should not give it to other channels that spawn from it.
This is type 1.
__VARNAME -- the variable is inheritable indefinitely. It can be inherited over any number of generations.
This is type 2.
Type 0 of course are the variables with no underbars in front of them and we simply do not inherit those at all.
So for the _VARNAME pattern, we shift forward one for the variable name to strip the '_' char off so that it will be a non-inheritable variable on the new item.
Meanwhile for the __VARNAME pattern, we copy the variable name as-is without shifting so that the variable remains inheritable.
--
To view, visit https://gerrit.asterisk.org/1180
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie47e618330114ad2ea91e2edcef1cb6f341eed6e
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list