2011/6/16 Daniel-Constantin Mierla <mico...@gmail.com>: > that function is probably for ser-like AVPs. > > back to your original need, you can use directly if conditions like: > > if($var(x) & 2) { ... } > > will be true if the second bit is set. You have to use the power of two for > the appropriate integer value to match the bit position.The master branch has > bitwise left/right shift operations as well
Ok, so the above example if($var(x) & 2) { ... } will just work because the number 2 has the bit 2 with value 1 (well, in fact the bit 1 as the first one is the bit 0). But if I want to compare the bit 5 I need first to get 2^5 (for the second & operator) which I can get using bitwise left/right shift functions, am I right? (since there is no way in kamailio to calculate 2^N directly). -- Iñaki Baz Castillo <i...@aliax.net> _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users