[OpenSIPS-Users] bitwise comparison syntax problem

Jeff Pyle jpyle at fidelityvoice.com
Sat Feb 21 21:28:20 CET 2009


Hello,

It appears I'm having some syntax issues doing a logical AND bitwise
comparison in the Opensips script.  I'm looking to do much the same thing
that flags do, I just need more flags than branch, script and their cousins
allow.

While not my final application, I'm testing with the cflags (branch flags)
value in the location table.  After a successful lookup() I'm trying to test
$bf with the && operator.  My final application won't have a
isbflagset-style function to check with unfortuantely.

I've verified $bf loads properly with the lookup().  If I'm checking for bit
5, for example, what's the proper way to do this?  I've tried variations on
the following:

if ($bf && 16)
if ([$bf && 16])
...and other, less sane approaches


Thanks,
Jeff









More information about the Users mailing list