[SR-Dev] script parsing: string switch support
Daniel-Constantin Mierla
miconda at gmail.com
Fri Feb 20 10:15:49 CET 2009
Hello Andrei,
On 02/20/2009 12:50 AM, Andrei Pelinescu-Onciul wrote:
> [...]
>
> script parsing: string switch support
>
that's great, thanks. From the next example, to understand the the case
can take expression that evaluates to static strings or integers?
Now, with while and switch in there I can work to get most of my configs
working with sip-router.
Cheers,
Daniel
> - switch() modified to work on string if the first case contains a
> string as the label
> - switch() support for regular expressions. Regular expression
> are prefixed by `/`. E.g.:
> switch("a"){
> case / ""+"["+"a"+"bc" +"]" :
> log(1, "case a:a\n");
> break;
> case "b":
> log(1, "case a:b\n");
> break;
> }
>
>
--
Daniel-Constantin Mierla
http://www.asipto.com
More information about the sr-dev
mailing list