[SR-Users] Regex in the switch statement

Alex Balashov abalashov at evaristesys.com
Mon Aug 17 19:48:53 CEST 2020


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

On 8/17/20 1:46 PM, Ilie Soltanici wrote:
> Hello,
> 
> Is there any way to use Regex or 'OR/AND' operators in the switch/case 
> statements?
> I've tried the following syntax but it's not working, are there any 
> other ways to do this?
> 
> switch($dlg_var(ISP)) {
> case"TRUNK1|TRUNK2":
> }
> 
> Thank you.
> 
> 
> 
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list