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

jharragi at mw.k12.ny.us jharragi at mw.k12.ny.us
Sun Feb 23 00:26:38 MST 2003


> > exten => 
_7xxxxx,1,Dial,SIP/BYEXTENSION at 192.168.${EXTEN:1:2}.${EXTEN:3:3}
> > exten => _7xxxxx,2,Playback,NotOnLine
> You already can do this in two ways:

Great. It amazes me, you miss a few posts and more features slip right in. 
I wonder if I'll ever catch up?

The second method will do exactly what I want.

John

> 1) in [globals] you may place ip_740022=192.168.40.022
> and then
> 
> exten => _7XXXXX,1,Dial,SIP/BYEXTENSION@${ip_${EXTEN}}
> 
> or
> 
> exten => _7XXXXX,1,Substring,part1=${EXTEN}|1|2
> exten => _7XXXXX,2,Substring,part2=${EXTEN}|3|3
> exten => _7XXXXX,3,Dial,SIP/BYEXTENSION at 192.168.${part1}.${part2}
> 
> we might consider implementing Substing directly in ${EXTEN|a|b} ...
> 
> 
> regards
> Martin
> 
> >
> > to match 192.168.40.022 you would dial 740022
> >
> > ..this might work already. Do the ${EXTEN} variables support bash-like
> > substringing? (I have got to get an * box set up at home - but for now 
I
> > wanted to send this while I was thinking about it)
> >
> >  While we were talking about establishing syntax, I would recommend
> > abandoning ${EXTEN-1} for ${EXTEN:1} to maintain compatibility with 
bash
> > syntax (so as not to be confused with things like $(($EXTEN-1)) &
> > $((${EXTEN:2:2}-24)) which would be good to match ranges of zap
> > channels... this might be a long term future thing). Of course this
> > suggestion is null if Mark's favorite shell uses the other syntax.
> >
> > > > [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})
> > >
> > ..anyway, we could wind up doing things like this...
> >  [default]
> >  exten => 62[25-48],1,Macro(lesstyping,${EXTEN}, Zap/$((${EXTEN:2:2}-
24))
> > ..and trailing digits of longer extens could be passed to remote
> > systems...
> > 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.




More information about the asterisk-users mailing list