[OpenSIPS-Devel] [opensips] lb_is_destination only accepts pseudo variables as values (#808)

telephone-man notifications at github.com
Thu Feb 25 10:45:29 CET 2016


http://www.opensips.org/html/docs/modules/2.1.x/load_balancer.html#id293920 says, "A value 0 for the port means "any" - will match any port"

However, it would seem you can only put a pvar there?

test 1: Fail
```
if (lb_is_destination("$si", 0) ) {
                ...
        }
		
CRITICAL:core:yyerror: parse error in config file /usr/local/etc/opensips/opensips.cfg, line 130, column 28-29: numbers used as parameters - they should be quoted
		
```

test 2: Fail
```
if (lb_is_destination("$si", "0") ) {
                ...
        }

ERROR:core:fixup_pvar: parsing of pseudo variable 0 failed!
```

test 3: Fail
```
if (lb_is_destination("$si", '0') ) {
                ...
        }

ERROR:core:fixup_pvar: parsing of pseudo variable 0 failed!
```

test 4: Fail
```
if (lb_is_destination("$si") ) {
                ...
        }

CRITICAL:core:yyerror: parse error in config file /usr/local/etc/opensips/opensips.cfg, line 131, column 26-27: unknown command <lb_is_destination>, missing loadmodule?
```


Workaround below produces no error, and correctly matches with any port
```

$avp(lb_port) = "0";

if (lb_is_destination("$si", "$avp(lb_port)") ) {
                ...
        }

```


---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/808
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160225/491b512e/attachment.htm>


More information about the Devel mailing list