[asterisk-users] Bitwise operations in dialplan ?

Antony Stone
Mon, 09 Dec 2019 12:40:18 -0000

On Monday 09 December 2019 at 13:35:28, Olivier wrote:

> Hello,
>
> I'm thinking about using a single (long) integer value as a compact way
to
> store user privileges.
>
> Do bitwise operations as in [1], exist in Asterisk's dialplan ?

https://wiki.asterisk.org/wiki/display/AST/Operators

https://www.voip-info.org/asterisk-expressions/

> Any workaround ?

You can't do shifts with >> and << but you can still multiply
and divide by
powers of 2.

> [1] https://wiki.python.org/moin/BitwiseOperators


Antony.

--
"Measuring average network latency is about as useful as measuring the mean
temperature of patients in a hospital."

 - Stéphane Bortzmeyer

                                                   Please reply to the list;
                                                         please *don't* CC
me.