jharragi at mw.k12.ny.us
2003-Feb-18 13:26 UTC
[Asterisk-Users] Re: [Asterisk] Major new * Dialplan Features
Hey Mark, I think these additions will be of great value to those with large dial plans. A couple of questions. Are nested Macro's valid (I know this is the height of laziness)? for example... [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) .. 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 John ----------------------------------------------------- This message was sent using Monroe-Woodbury's WebMail. http://webmail.mw.k12.ny.us/ This e-mail was scanned and found clean by Monroe-Woodbury CSD Antivirus.
Martin Pycko
2003-Feb-18 13:55 UTC
[Asterisk-Users] Re: [Asterisk] Major new * Dialplan Features
Well I tested it and it does. regards Martin On Tue, 18 Feb 2003 jharragi at mw.k12.ny.us wrote:> > Hey Mark, > > I think these additions will be of great value to those with large dial > plans. > > A couple of questions. Are nested Macro's valid (I know this is the height > of laziness)? > > for example... > > [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) > > .. 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 > > John > > > > ----------------------------------------------------- > This message was sent using Monroe-Woodbury's WebMail. > http://webmail.mw.k12.ny.us/ > > > This e-mail was scanned and found clean by Monroe-Woodbury CSD Antivirus. > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users at lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users >
Steven Critchfield
2003-Feb-18 14:14 UTC
[Asterisk-Users] Re: [Asterisk] Major new * Dialplan Features
On Tue, 2003-02-18 at 13:26, jharragi at mw.k12.ny.us wrote:> [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)Mybe it is me, but if you could do part 2 and 3, then why not reduce further to this. [macro-stdexten] exten => $(ARG1),1,Dial(${ARG2),20) exten => $(ARG1),2,Voicemail(u$(ARG1)) exten => $(ARG1),102,Voicemail(b$(ARG1)) [default] Macro(stdexten,6275,Zap/1) Macro(stdexten,6236,Zap/2) Should be functionally equivelant without adding a new macro. -- Steven Critchfield <critch at basesys.com>
Mark Spencer
2003-Feb-18 14:23 UTC
[Asterisk-Users] Re: [Asterisk] Major new * Dialplan Features
> [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 bankThat'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