[OpenSIPS-Users] Problem with gflags

Saint Michael venefax at gmail.com
Thu Oct 27 14:55:12 UTC 2022


I just need to know how to check for the gflag inside the code
this:
 if (is_gflag("1")) {..}
does not work, even if the flag is (1), as I wrote this test from the
command line works

opensips-cli -x mi is_gflag 1
true

As you can see, unless you can test for the gflag value inside the
code, it cannot be used. The module gflag is of a great importance
when managing Opensips, because it allows for an orderly shutdown
without losing CDR, that is: money.

Many thanks.





Thank you!

On Thu, Oct 27, 2022 at 10:48 AM Liviu Chircu <liviu at opensips.org> wrote:
>
> On 27.10.2022 17:20, Saint Michael wrote:
> > I only get the second xlog()
> >
> > The documentation may be wrong, it asks us to use
> > if (is_gflag("1")) {..}
> > But opensips fails to start.
> >
> > How do I test for gflag=1 inside my
> > route
>
> Hi SM,
>
> The set of functions in "gflags" module is a bit strange, however they
> are correct.  The script functions work with *bits* (e.g. bit 0, 1, 2,
> ...), while the MI functions work with *bitmasks* (e.g. 1, 2, 4, ...).
> Be careful not to mix the two, and you should get the correct results.
>
> I believe the docs are somewhat accurate about the above - if not, let
> me know and we can make improvements together.
>
> Best regards,
>
> --
> Liviu Chircu
> www.twitter.com/liviuchircu | www.opensips-solutions.com
>



More information about the Users mailing list