[sr-dev] testing more than one flag with a single isflagset() call
Daniel-Constantin Mierla
miconda at gmail.com
Tue Sep 10 10:10:39 CEST 2013
Hello,
something similar can be done now with variables:
if($mf & 7)
or
if( $mf & ( (1<<2) | (1<<3) ) )
Anyhow, if anyone wants a dedicated function, it is ok, but might be better
to add a new function, that can be in corex module to allow pv parameters.
Could be actually two functions:
- allflagsset(x) - match all the flags (e.g, $mf & 7 == 7)
- anyflagset(x) -match any of the flags (e.g, $mf & 7 != 0)
Cheers,
Daniel
On Mon, Sep 9, 2013 at 1:02 PM, Juha Heinanen <jh at tutpro.com> wrote:
> currently isflagset core function accepts only one flag as argument. it
> would be nice if more that one flag could be tested with one function
> call, e.g.,
>
> isflagset(1|2) or isflagset(1&2)
>
> since i'm not familiar with adding syntax related stuff to core, is it
> ok if i create a tracker wish list item on this?
>
> -- juha
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
--
Daniel-Constantin Mierla
http://www.asipto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20130910/f1c3a59e/attachment.html>
More information about the sr-dev
mailing list