[asterisk-users] How to get values of local channels context

Yuan LIU yliu11 at hotmail.com
Tue Feb 27 00:09:30 MST 2007


>From: kjcsb <kjcsb at yahoo.com>
>Date: Mon, 26 Feb 2007 22:32:29 -0800 (PST)
>
> >> CLI shows:
> >>     -- Executing NoOp("Local/2592 at 1100006-2000-e802,2", "Context 
>macro-test") in new stack
> >>
> >> I want to get 1100006-2000 somehow.
> >>
> >> Any suggestions would be appreciated.
> >
> >So use ${MACRO_CONTEXT} .
>
>Thanks
>
>But doesn't this give the calling context which, if itself is another 
>macro, will still not give me what I want? If macro-test is called by 
>macro-first then ${MACRO_CONTEXT} = macro-first. Surely there's a way to 
>get the context directly from the Local channel itself?
>
>Cameron

If nested macro calls are necessary, define an inheritable local variable, 
e.g., __real-context.  Two _'s enables infinite inheritance.  Hope this 
helps.

Yuan Liu




More information about the asterisk-users mailing list