[OpenSIPS-Users] if statement failing to match

Mark Farmer farmorg at gmail.com
Thu Mar 5 09:43:17 EST 2020


Hi Bogdan thanks for the reply.
I'm struggling to understand this one. If I do 'opensipsctl fifo set_glag
4' what do I need to check for with is_gflag()?

Many thanks
Mark.


On Wed, 4 Mar 2020 at 18:59, Bogdan-Andrei Iancu <bogdan at opensips.org>
wrote:

> Hi Mark,
>
> Note that the param of is_gflag() is an index inside the gflag array,
> while the MI funcs have as param a bitmaks !
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Summit, Amsterdam, May 2020
>   https://www.opensips.org/events/Summit-2020Amsterdam/
>
> On 3/4/20 7:09 PM, Mark Farmer wrote:
>
> Hi all, I am having a problem getting my if statement to work.
> I'm using a modified trunking script & I have this just after the
> in-dialog and IS_TRUNK matching parts.
>
> ...
> if (is_method("INVITE") && is_gflag("4")) {
>                 xlog("CUSTOM_LOG: Server is in maintenance mode. Sending
> 503 Maintenance");
>                 send_reply("503","Maintenance");
>                 exit;
> }
> ...
>
> I have the gflags module loaded and I can set the flag using opensipsctl:
>
> opensipsctl fifo set_gflag 4
> opensipsctl fifo is_gflag 4
> TRUE
>
> But I never see this kick in, the call works normally and no 503 is sent.
>
> Any ideas?
>
> opensips -V
> version: opensips 2.4.7 (x86_64/linux)
> flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
> F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
> MAX_URI_SIZE 1024, BUF_SIZE 65535
> poll method support: poll, epoll, sigio_rt, select.
> git revision: 9e1fcc915
> main.c compiled on 17:20:16 Feb 27 2020 with gcc 7
>
> Many thanks and regards
> Mark.
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>

-- 
Mark Farmer
farmorg at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200305/28bf84ca/attachment.html>


More information about the Users mailing list