Hi, I need do some arithmetic operation in the soh-server, so I tried use the expr module. example: server soh-server { ... update control { &Tmp-Integer-1 := %{expr: 1 + 2 + 3} } But from syntax checker I received error message: "Syntax error: Expected comma after '%{expr:': 1 + 2 + 3}" Is possible use expr in this case? Petr Linke
On May 18, 2018, at 7:20 AM, <petr.linke@seznam.cz> <petr.linke@seznam.cz> wrote:
I need do some arithmetic operation in the soh-server, so I tried use the expr module.
example: server soh-server { ... update control { &Tmp-Integer-1 := %{expr: 1 + 2 + 3} }
But from syntax checker I received error message: "Syntax error: Expected comma after '%{expr:': 1 + 2 + 3}"
Is possible use expr in this case?
Yes. The %{...} syntax is for *string* expansions. So you need to do use strings: &Tmp-Integer-1 := "%{expr: 1 + 2 + 3}"
Hi Alan, thank you, works as expected :). Have a nice weekend, Petr ---------- Original e-mail ---------- From: Alan DeKok <aland@deployingradius.com> To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Date: 18. 5. 2018 13:29:26 Subject: Re: unlang & expr "On May 18, 2018, at 7:20 AM, <petr.linke@seznam.cz> <petr.linke@seznam.cz> wrote:
I need do some arithmetic operation in the soh-server, so I tried use the expr module.
example: server soh-server { ... update control { &Tmp-Integer-1 := %{expr: 1 + 2 + 3} }
But from syntax checker I received error message: "Syntax error: Expected comma after '%{expr:': 1 + 2 + 3}"
Is possible use expr in this case?
Yes. The %{...} syntax is for *string* expansions. So you need to do use strings: &Tmp-Integer-1 := "%{expr: 1 + 2 + 3}" - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users. html"
participants (2)
-
Alan DeKok -
petr.linke@seznam.cz