[Serusers] how do I route to ranges?

Dana Olson rickaster at gmail.com
Fri Aug 26 17:26:48 CEST 2005


And my regexp skills are non-existent. ;)

Thanks for the attempt, but it did not work. I have tried escaping the
parenthesis, I've looked up regexp syntax and tried misc. things but
can't get it to do what I want. I am thinking that an or'd statement
will have to suffice.

Something like this, for the first one:

sip:[0-9]@ | sip:[0-9][0-9]@ | sip:1[0-8][0-9]@ | sip:19[0-2]@

It's messy, and you'd think that you could do something like less than
or greater than, but doesn't appear so.

--
Dana


On 8/25/05, Atle Samuelsen <clona at camaro.no> wrote:
> 
> Hi dana,
> 
> if(uri=~"^[0-(94)]"){
> 
>         do_stuff;
> }else if ( uri=~"[(95)-(120)]"){
>         do_other_stuff;
> };
> 
> I dont know if this would work, but try it out.. my regexp skills are'nt
> very high ;-)
> 
> --Atle
> 
> 
> * Dana Olson <rickaster at gmail.com> [050825 21:50]:
> > I am not sure how to approach this, or even if it's possible.
> >
> > I want to have this kind of thing (pseudocode):
> >
> > if sipuri >0 & sipuri <96 { do stuff }
> > if sipuri >95 & sipuri < 120 { do stuff }
> >
> > And so on. Assuming that the sipuri is a number, and anything outside
> > of the ranges, or letters is ignored (and handled elsewhere).
> >
> > I could build individual routes for each number, but I am hoping there
> > is an easier way to do it.
> >
> > If anyone could help me out, that'd be really awesome.
> > --
> > Dana




More information about the sr-users mailing list