[asterisk-bugs] [JIRA] (ASTERISK-23133) Possible documentation fix - MASTER_CHANNEL Unexpected Behaviour
Marcus Hunger (JIRA)
noreply at issues.asterisk.org
Tue Jul 21 11:00:32 CDT 2015
[ https://issues.asterisk.org/jira/browse/ASTERISK-23133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=226981#comment-226981 ]
Marcus Hunger commented on ASTERISK-23133:
------------------------------------------
Any updates on this? I need the functionality as documented.
> Possible documentation fix - MASTER_CHANNEL Unexpected Behaviour
> ----------------------------------------------------------------
>
> Key: ASTERISK-23133
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-23133
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Functions/General
> Affects Versions: 1.8.25.0, 11.7.0
> Environment: n/a
> Reporter: Shane Mitchell
> Severity: Minor
>
> MASTER_CHANNEL() should behave, as per documentation: Allows access to the channel which created the current channel, if any. If the channel is already a master channel, then accesses local channel variables.
> MASTER_CHANNEL() actually accesses the local variables of the initial/first channel and not the parent channel. Hence, either the behaviour of MASTER_CHANNEL is incorrect or the documentation is incorrect.
> This behaviour is experienced every way you can spawn a channel, including but not limited to local channels, the U option in Dial, etc.
> {noformat}
> [channel1]
> exten => s,1,Set(CHANLEVEL=1)
> same => n,NoOp(${CHANLEVEL}) ; OUTPUT IS: 1
> same => n,NoOp(${MASTER_CHANNEL(CHANLEVEL)}) ; OUTPUT IS: 1 (OK)
> same => n,Dial(Local/s at channel2)
> [channel2]
> exten => s,1,Set(CHANLEVEL=2)
> same => n,NoOp(${CHANLEVEL}) ; OUTPUT IS: 2
> same => n,NoOp(${MASTER_CHANNEL(CHANLEVEL)}) ; OUTPUT IS: 1 (OK)
> same => n,Dial(Local/s at channel3)
> [channel3]
> exten => s,1,Set(CHANLEVEL=3)
> same => n,NoOp(${CHANLEVEL}) ; OUTPUT IS: 3
> same => n,NoOp(${MASTER_CHANNEL(CHANLEVEL)}) ; OUTPUT IS: 1 (UNEXPECTED)
> {noformat}
> I would posit from the naming of the MASTER_CHANNEL function that its behaviour is correct and the documentation is incorrect.
> However, it is important to be able to access the 'channel which created the current channel' as well - and this functionality is missing.
> Deviating from the Asterisk issue guidelines slightly, in addition to correcting the documentation, it would be of huge value to have a function similarly named to PARENT_CHANNEL() which behaves as per the documentation pasted above (accessing the channel which created the current channel / the parent channel).
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list