[Asterisk-Users] can a variable be redefined within extensions.conf

Lance Arbuckle
Sun, 01 Feb 2004 14:51:07 -0000

Can I define a variable in globals like this:

[globals]
timeout=60

and then in another context, redefine that same variable and only have
the new value affect the call that hit that particular extension ?

[example]
exten => _9NXXXXXX,1,DBget(blah/blah)
exten => _9NXXXXXX,102,Goto(3)
exten => _9NXXXXXX,2,SetVar(#timeout=20)
exten => _9NXXXXXX,3,Dial(${PSTN},${EXTEN:1},${timeout})
exten => _9NXXXXXX,104,Do something if busy
exten => _9NXXXXXX,4,Do something else if no answer

So, if a call goes priority 1,102,3... ${timeout} would = 60 but if the
call went priority 1,2,3,.... then ${timeout} would =20.

Or, could I just leave the variable definition out of globals all
together ?  What would ${timeout} evaluate to if it isn't defined ?  I
suspect dial wouldn't be happy since the comma right before timeout
would still be there....

Thanks

--Lance

Go Panthers :)