[Asterisk-Users] Re: Setting variable for a context for all extensions?

Tony Mountifield tony at softins.clara.co.uk
Mon May 9 08:33:50 MST 2005


In article <51109.167.202.196.71.1115648459.squirrel at prive.wormgoor.com>,
Mark Wormgoor <mark at wormgoor.com> wrote:
> >
> > Not certain about this but couldn't this work:
> > exten => _.,1,SetVar()
> > exten => _.,2,Goto(${EXTEN},1)
> >
> > exten => 1234,1,Dial()
> 
> That's what I wanted... Should have thought of that myself.
> Thanks!

It won't work unless the SetVar and Goto are in a different context
from the Dial.

If all three lines above are in the same context, (1234,1) will either
always match the first line or the last line. You are expecting it to
match the first line when the call comes in, and the last line when
doing the Goto.

Another point is that "_." should really be "_X.", and duplicated
for "_X" if you want to handle 1-digit extensions too.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list