[OpenSIPS-Users] gflags module script and MI command difference

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Feb 13 04:29:34 EST 2018


Hi Arto,

No, there should be no offset at all. The is_gflag function takes as 
parameter the index of the bit to be checked, while the MI functions 
(like set_gflag) take as parameter a bitmask with all the bits to be 
operated with.

So, if you setting the bitmask 2 -> you set bit index 1 (2<<1) . With 
bitmask 1 you set the bit index 0 (2<<0).

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Summit 2018
   http://www.opensips.org/events/Summit-2018Amsterdam

On 02/09/2018 01:43 PM, Arto Kuiri wrote:
>
> Hi,
>
>
> I noticed that in opensips script gflags and MI commands gflags is off 
> by 1.
>
>
> if i have this kind of check:
>
>
> if(is_gflag("1")) {
>    xlog("** MAINTANCE MODE \n");
> }
>
>
> and I try to set it on with MI command:
>
> opensipsctl fifo set_gflag 1
>
> it wont work, but this works:
>
> opensipsctl fifo set_gflag 2
>
> is this intended? If it is, I think documentation should mention it?
>
> Tested this with 2.4.x
>
> Regards,
> Arto Kuiri
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180213/c7bef2f9/attachment-0001.html>


More information about the Users mailing list