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

Peter Beckman beckman at purplecow.com
Wed May 17 13:58:14 MST 2006


On Wed, 17 May 2006, Kevin P. Fleming wrote:

> Peter Beckman wrote:
>
>> Is that accurate?  If not, please let me know so I can document it.
>
> I already answered your question on asterisk-users.

  You did; I felt they were two different questions -- -users to ask if it
  could be done and how to do it, and -dev to ask how to document it, and
  potentially determine if it should be a requested feature or not.

> Please stop using the term 'context' for this, it will only cause
> confusion.

  I used context to describe my location in a dialplan.  As I understand it,
  a channel can be active in several contexts.  When discussing variable
  inheritance between channels, shouldn't I mention in what context I'm
  setting and accessing those variables?

     [foo]

     exten... Dial(...||M(bar))

     [macro-bar]

     exten...

  Isn't "foo" considered a 'context'?

  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?

> Macros can return values back to their callers via MACRO_RESULT, but the
> rest of what you said appears to be true and expected behavior.

  It seems that the only way to communicate between channels is via Global
  variables.  In order to prevent overwriting them while multiple calls are
  in progress, a unique name for the Global variable is required.

  Once a Global variable is set, how do you "unset" that Global variable, in
  order to avoid overwriting and variable messyness?

  I'll put the inter-channel communication into Mantis as a feature request.

Beckman
---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
beckman at purplecow.com                             http://www.purplecow.com/
---------------------------------------------------------------------------



More information about the asterisk-dev mailing list