[asterisk-bugs] [JIRA] (ASTERISK-23133) Documentation fix - MASTER_CHANNEL Unexpected Behaviour

Friendly Automation (JIRA) noreply at issues.asterisk.org
Fri Dec 29 13:40:39 CST 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=241211#comment-241211 ] 

Friendly Automation commented on ASTERISK-23133:
------------------------------------------------

Change 7751 merged by Jenkins2:
func_channel.c: Update MASTER_CHANNEL documentation

[https://gerrit.asterisk.org/7751|https://gerrit.asterisk.org/7751]

> 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, 13.18.4
>         Environment: n/a
>            Reporter: Shane Mitchell
>            Assignee: Richard Mudgett
>            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