<div dir="ltr">Hi Bogdan thanks for the reply.<div>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()?</div><div><br></div><div>Many thanks</div><div>Mark.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 4 Mar 2020 at 18:59, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<tt>Hi Mark,<br>
<br>
Note that the param of is_gflag() is an index inside the gflag
array, while the MI funcs have as param a bitmaks !<br>
<br>
Regards,<br>
</tt><tt></tt>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="https://www.opensips-solutions.com" target="_blank">https://www.opensips-solutions.com</a>
OpenSIPS Summit, Amsterdam, May 2020
<a href="https://www.opensips.org/events/Summit-2020Amsterdam/" target="_blank">https://www.opensips.org/events/Summit-2020Amsterdam/</a>
</pre>
<div>On 3/4/20 7:09 PM, Mark Farmer wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hi all, I am having a problem getting my if
statement to work.</div>
<div dir="ltr">I'm using a modified trunking script & I
have this just after the in-dialog and IS_TRUNK matching
parts.<br>
<div><br>
</div>
<div>...</div>
<div>
<div>if (is_method("INVITE") && is_gflag("4")) {</div>
<div> xlog("CUSTOM_LOG: Server is in
maintenance mode. Sending 503 Maintenance");</div>
<div> send_reply("503","Maintenance");</div>
<div> exit;</div>
<div>}</div>
<div>...</div>
<div><br>
</div>
<div>I have the gflags module loaded and I can set the
flag using opensipsctl:</div>
<div><br>
</div>
<div>
<div>opensipsctl fifo set_gflag 4</div>
<div>opensipsctl fifo is_gflag 4</div>
<div>TRUE</div>
</div>
<div><br>
</div>
<div>But I never see this kick in, the call works
normally and no 503 is sent.</div>
<div><br>
</div>
<div>Any ideas?</div>
<div><br>
</div>
<div>
<div>opensips -V</div>
<div>version: opensips 2.4.7 (x86_64/linux)</div>
<div>flags: STATS: On, DISABLE_NAGLE, USE_MCAST,
SHM_MMAP, PKG_MALLOC, F_MALLOC,
FAST_LOCK-ADAPTIVE_WAIT</div>
<div>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE
262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE
65535</div>
<div>poll method support: poll, epoll, sigio_rt,
select.</div>
<div>git revision: 9e1fcc915</div>
<div>main.c compiled on 17:20:16 Feb 27 2020 with gcc
7</div>
</div>
<div><br>
</div>
Many thanks and regards</div>
<div>Mark.</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Mark Farmer<br><a href="mailto:farmorg@gmail.com" target="_blank">farmorg@gmail.com</a></div>