[OpenSIPS-Users] Set flag at runtime?

David Villasmil david.villasmil.work at gmail.com
Thu Jun 10 00:52:10 EST 2021


Point is on the CLI I get TRUE, but on the script no matter what I do it is
always false

On Thu, 10 Jun 2021 at 01:51, David Villasmil <
david.villasmil.work at gmail.com> wrote:

> Thanks Ben, I tried both :(
>
> On Thu, 10 Jun 2021 at 01:26, Ben Newlin <Ben.Newlin at genesys.com> wrote:
>
>> Per the documentation [1], the CLI command wants the value as an integer,
>> not quoted.
>>
>>
>>
>> Have you tried
>>
>>
>>
>> # opensipsctl fifo set_gflag 1
>>
>>
>>
>> [1] -
>> https://opensips.org/docs/modules/2.4.x/gflags.html#exported_mi_functions
>>
>>
>>
>> Ben Newlin
>>
>>
>>
>> *From: *Users <users-bounces at lists.opensips.org> on behalf of David
>> Villasmil <david.villasmil.work at gmail.com>
>> *Date: *Wednesday, June 9, 2021 at 6:34 PM
>> *To: *users at lists.opensips.org <users at lists.opensips.org>
>> *Subject: *Re: [OpenSIPS-Users] Set flag at runtime?
>>
>> So I'm trying to use gflags.so in 2.4.7
>>
>>
>>
>> I set the module as:
>>
>>
>>
>> loadmodule "gflags.so"
>> modparam("gflags", "initial", 0)
>>
>>
>>
>> then i'm doing:
>>
>>
>>
>> if (is_gflag("1")) {
>>         xlog("L_ERR", "[$ci][$rm]: gflag(1) is set\n");
>> } else {
>>     xlog("L_ERR", "[$ci][$rm]: gflag(1) is not set\n");
>> }
>>
>>
>>
>> Then, via CLI I'm setting the flag like so:
>>
>>
>>
>> # opensipsctl fifo is_gflag "1"
>> FALSE
>>
>>
>>
>> And is set it with:
>>
>>
>>
>> # opensipsctl fifo set_gflag "1"
>>
>>
>>
>> and check it is actually set:
>>
>>
>>
>> # opensipsctl fifo is_gflag "1"
>> TRUE
>>
>>
>>
>> But no matter what i do, the script always sees the flag as not set.
>>
>>
>>
>> Did I misunderstand the purpose of the module? I want to be able to set
>> the flag dynamically from the CLI to enable/disable a feature at runtime...
>> is this not possible?
>>
>>
>>
>> thanks guys.
>>
>>
>> Regards,
>>
>>
>>
>> David Villasmil
>>
>> email: david.villasmil.work at gmail.com
>>
>> phone: +34669448337
>>
>>
>>
>>
>>
>> On Wed, Jun 9, 2021 at 8:55 PM David Villasmil <
>> david.villasmil.work at gmail.com> wrote:
>>
>> gflags!
>>
>>
>> Regards,
>>
>>
>>
>> David Villasmil
>>
>> email: david.villasmil.work at gmail.com
>>
>> phone: +34669448337
>>
>>
>>
>>
>>
>> On Wed, Jun 9, 2021 at 5:05 PM David Villasmil <
>> david.villasmil.work at gmail.com> wrote:
>>
>> Hello guys,
>>
>>
>>
>> On 2.4 is it possible to set a flag at runtime? I want to set a feature
>> toggle based on that.
>>
>>
>> Regards,
>>
>>
>>
>> David Villasmil
>>
>> email: david.villasmil.work at gmail.com
>>
>> phone: +34669448337
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> --
> Regards,
>
> David Villasmil
> email: david.villasmil.work at gmail.com
> phone: +34669448337
>
-- 
Regards,

David Villasmil
email: david.villasmil.work at gmail.com
phone: +34669448337
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210610/48f7644e/attachment-0001.html>


More information about the Users mailing list