[Asterisk-Users] Re: [Asterisk] Major new * Dialplan Features

Mark Spencer markster at digium.com
Tue Feb 18 13:23:23 MST 2003


>  [macro-stdexten]
>  exten => s,1,Dial(${ARG2},20)
>  exten => s,2,Voicemail(u${ARG1})
>  exten => s,102,Voicemail(b${ARG2})
>
>  [macro-lesstyping]
>  exten => ${ARG1},Macro(stdexten,${ARG1},${ARG2})
>
> [default]
> Macro(lesstyping,6275,Zap/1)
> Macro(lesstyping,6236,Zap/2)

Yes, that *is* valid to nest them (or at least should be, i'm not sure
i've tested it).  I certainly designed the code to support that.  Note
that if your macro-stdexten only had two arguments, while macro-lesstyping
had three, that the third argument of less-typing would still be available
to macro-stdexten, but you shouldn't count on that.  It was just less
computationally intensive to do it that way.

> .. or worse yet - it could be really succinct if [] could expand to an
> entry for each value - so [] would might look something like () in regular
> expressions...
>
> [default]
> Macro(lesstyping,62[01-24],Zap/$1)                    ;would handle a
> whole channel bank

That's an interesting idea.  You can, in fact, do something along these
lines already though, like this:

[default]
exten => 62XX,1,Macro(lesstyping,${EXTEN}, Zap/${EXTEN-2})

Mark




More information about the asterisk-users mailing list