<div dir="ltr">Hi Liviu,<div><br></div><div>OK, I understand now. Thank you.</div><div><br></div><div>I was hoping not to touch the routing script at this moment.</div><div><br></div><div>So to be clear, I cannot use the dispatcher endpoint method to stop responding to SIP Options pings? If I can do that, then that is the equivalent - since our platform would see opensips as unhealthy and not send calls to it.</div><div><br></div><div>Thank you.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 21 Jan 2020 at 11:43, Liviu Chircu <<a href="mailto:liviu@opensips.org">liviu@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>On 21.01.2020 13:06, solarmon wrote:<br>
</div>
<blockquote type="cite">
<div>Thanks for the tip about the $shv global variables. The link
you gave is for 3.1.x, I found the equivalent for 2.4.x which is
the version I'm currently using. Is the 'drain' feature also
included in this 2.4.x implementation?<br>
</div>
</blockquote>
<tt>The shared variables ($shv) support has stayed the same
throughout the years. And the "drain"<br>
feature is something that each script writer can build for
themselves, there is no ready-made solution.</tt>
<blockquote type="cite">
<div><br>
</div>
<div>Do you have any specific examples of how to do this 'drain'
mode?</div>
</blockquote>
<tt>A possible way to do it (adjust as per your platform):<br>
<br>
...<br>
loadmodule "cfgutils.so"<br>
modparam("cfgutils", "shvset", "drain_mode=i:0")<br>
...<br>
<br>
route {<br>
if (!has_totag() && $shv(drain_mode)) {<br>
append_hf("Retry-After: 60 (Server Restarting)\r\n");<br>
send_reply(503, "Maintenance");<br>
exit;<br>
}<br>
}</tt>
<blockquote type="cite">
<div><br>
</div>
<div>When I try the 'opensipsctl fifo shv_get debug' on my
opensips server I get the following error:</div>
<div><br>
</div>
<div>500 command 'shv_get' not available<br>
</div>
<div><br>
</div>
<div>I assume I need to have the '<span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">cfgutils</span><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">' </span>module
enabled and loaded for it to work?</div>
</blockquote>
<p><tt>Exactly. See my above example of defining $shv variables.</tt></p>
<tt>Best regards,</tt>
<pre cols="72">--
Liviu Chircu
<a href="http://www.twitter.com/liviuchircu" target="_blank">www.twitter.com/liviuchircu</a> | <a href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a>
OpenSIPS Summit, Amsterdam, May 2020
<a href="http://www.opensips.org/events" target="_blank">www.opensips.org/events</a>
OpenSIPS Bootcamp, Miami, March 2020
<a href="http://www.opensips.org/training" target="_blank">www.opensips.org/training</a></pre>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>