[asterisk-dev] Variable Inheritance, Setting Channel Variables outside of current context

Johansson Olle E olle at voop.com
Thu May 18 08:24:41 MST 2006


18 maj 2006 kl. 16.41 skrev Peter Beckman:

> On Wed, 17 May 2006, Tilghman Lesher wrote:
>
>> On Wednesday 17 May 2006 15:58, Peter Beckman wrote:
>>> On Wed, 17 May 2006, Kevin P. Fleming wrote:
>>>   In this situation, the 'parent context' would be 'foo', and the
>>> 'child context' would be 'macro-bar' or just 'bar' for variable
>>> inheritance discussions?  Channel variables set in foo such as _FOO
>>> and __FOO would be inherited by the macro called by the Dial() in
>>> 'foo' context, right?
>>
>> In that case, what you said was incorrect.  There is no "child" or
>> "parent" context, when it comes to setting variables.
>
>  I understand inheritance better now; there are child and parent  
> CHANNELS,
>  and variables set in Channel A (parent) with a leading one or two
>  underscores will be inherited by Channel B (child) when Channel A  
> creates
>  Channel B.

Please don't use the phrase "parent" or "child" because there's no such
relationship. When one channel creates another channel, we copy some
data to the new channel. After that, it's two channels that may  
become bridged.
Important to remember is that one channel can create a long list of new
channels in a ring-many-phones scenario or a follow-me scenario.

>
>> Variables which you set in Macro (other than the special ARG  
>> variables
>> used for passing parameters) will still be set when Macro returns.
>
>  IFF the macro is called within the same channel.  If the macro is  
> called
>  as part of Dial() using the M(x) option, variables set in the  
> Macro will
>  NOT be available to the channel that called the Dial(); correct?
>
Right.

/O



More information about the asterisk-dev mailing list