[SR-Users] Regex in the switch statement

Fred Posner fred at palner.com
Mon Aug 17 19:59:04 CEST 2020


On Mon, 2020-08-17 at 13:48 -0400, Alex Balashov wrote:
> I'm not sure if it's supported, but the usual way of doing this in
> other 
> languages is:
> 
>     switch(expr) {
>        case CASE1:
>        case CASE2:
>           ...
>           break;
> 
>        case CASE3:
>           ...
>     }
> 
> -- Alex


Why, yes... it is supported. =)

Example on line 724 of the default kamailio config:

https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg

--fred





More information about the sr-users mailing list