[Asterisk-Users] Variable Inheritance - Set in Child, Read by Parent

Peter Beckman beckman at purplecow.com
Wed May 17 12:54:59 MST 2006


Here's what I'm doing:

     1. I set __FOO=0 in the current context.

     2. I use Dial() and the M(testvar) macro call.

     3. The macro-testvar can see ${FOO} just fine.

     4. the macro-testvar modifies FOO.  I tried:

         Set(__FOO=1)
         Set(_FOO=1)
         Set(FOO=1)

     5. When the Dial()ed call hangs up, and the original context continues,
        FOO is still 0.   I want it to contain 1, or whaver the child
        macro-testvar sets it to.

Question:

     1. Can I modify variables set in the parent context in the child
        context and read them again in the parent context?

     2. Is there a better way to hand back "status" of a Macro executed by
        the Dial() command?

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



More information about the asterisk-users mailing list