[asterisk-bugs] [JIRA] (ASTERISK-23152) Possible documentation fix - MASTER_CHANNEL Unexpected Behaviour
Rusty Newton (JIRA)
noreply at issues.asterisk.org
Thu Jan 16 09:45:04 CST 2014
Rusty Newton created ASTERISK-23152:
---------------------------------------
Summary: Possible documentation fix - MASTER_CHANNEL Unexpected Behaviour
Key: ASTERISK-23152
URL: https://issues.asterisk.org/jira/browse/ASTERISK-23152
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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list