[SR-Users] Problem with 'break' in a 'Switch' body

Edson - Lists 4lists at gmail.com
Thu May 28 20:01:42 CEST 2009


Hi, Guys...

I use a 'switch' block to drive decisions after a failed 'lookup' (on 
router-block). In theory all Ok, but....

In the body of this switch, if I use a 'break' inside an 'if' it gives 
me error, saying that it's not allowed.

See below the code.

What am I doing wrong?

Edson.

========================================================
route[1] {
  if (!lookup("location") {
    switch ($retcode) {
      case -1:
      case -3:
          if ('situation A') {
            t_on_failure("1");
            break;
          } else {
            if ('condition b') {
              if ('condition b.1') {
                t_on_failure("2");
                break;
              };
            };
          };
          exit;
      case -2:
          sl_send_reply("500", "Internal lookup error");
          exit;
    }
  }
  if (!t_relay()) {
    sl_reply_error();
  }
  exit;
}




More information about the sr-users mailing list