In article <[EMAIL PROTECTED]>,
Edwin Groothuis <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> Somewhere on my asterisk system, a calls come in in a certain
> context, for example, from-sip or from-pstn.
>
> Then the calls gets routed through the dialplan, and a macro gets
> called, and another one and then the call needs to be redirected
> to another number in the same initial context. And you can use
> Dial(Local/number/initialcontext) for that.
>
> Oops, this initial context is lost somewhere on the line.
>
> Unless I'm very mistaken, there is no way to find out what the
> original context was, is there?
The current context is always available in the channel variable ${CONTEXT},
so the easiest thing would be to save this variable in another at the
correct point, and use the saved copy later:
[from-sip]
exten => _X.,1,Set(INITIALCONTEXT=${CONTEXT})
exten => ... and so on
[from-pstn]
exten => _X.,1,Set(INITIALCONTEXT=${CONTEXT})
exten => ... and so on
[somewhere-else]
.... Dial(Local/[EMAIL PROTECTED])
Or something like that.
And couldn't you use Goto(${INITIALCONTEXT},${NUMBER},1) instead of
Dial(Local/[EMAIL PROTECTED]) ?
Cheers
Tony
--
Tony Mountifield
Work: [EMAIL PROTECTED] - http://www.softins.co.uk
Play: [EMAIL PROTECTED] - http://tony.mountifield.org
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users