For some reason I can set a variable with multiple inheritance in a dial option subroutine using b() or B(), however, if I use U() I cannot (and G() while not a subroutine, behaves like U().
Oddly enough, I can read the variable ${TESTVARIABLE} in all situations, b(), B(), U() and G(), however in U() or G() with a Set(__TESTVARIABLE=value) – it never gets properly set outside of the subroutine.
I’m curious if this is a bug, as it doesn’t behave the same way in all scenarios. Any other input, regarding if it’s meant to be this way, or if it is a bug, how to file a report, would be appreciated.
For reference, I am using Asterisk 11.2-cert2.
Here’s my example:
; -------------- Test with this command:
; asterisk*CLI> channel originate LOCAL/s@myinbound application wait 3
[myinbound]
exten => s, 1,Noop(my inbound context)
same => n,Set(__TESTVARIABLE=consider this unset)
; --------- Next line didn't work (TESTVARIABLE remains unchanged after execution)
same => n,Dial(LOCAL/100@fakecall,,U(subTest))
; --------- Next line DID work. (TEST Variable gets changed in the subroutine)
; same => n,Dial(LOCAL/100@fakecall,,B(subTest^s^1))
exten => h, 1,Noop(Hangup in my inbound context)
same => n,Noop(My test variable: ${TESTVARIABLE})
[fakecall]
exten => 100,1,Noop(Entered the fake call)
same => n, Answer()
same => n, Hangup()
exten => h, 1,Noop(Hangup in fake call context)
same => n,Noop(My test variable: ${TESTVARIABLE})
[subTest]
exten => s,1,Noop(into the sub)
same => n,Noop(${TESTVARIABLE} <-- that's my test variable)
same => n,Set(__TESTVARIABLE=this is properly set)
same => n,return