[OpenSIPS-Users] Orderly shutdown

Saint Michael venefax at gmail.com
Thu Oct 27 12:39:17 UTC 2022


for testing I added
route{
if (is_gflag("1")) {
                t_relay("udp:10.0.0.1:5060");
        } else {
                t_relay("udp:10.0.0.2:5060");
        }
but I see these errors

Oct 27 12:34:33 proxy opensips[140294]: Aliases:
Oct 27 12:34:33 proxy opensips[140296]: Oct 27 12:34:33 [140296]
ERROR:core:fix_cmd: Param [1] expected to be an integer or variable
Oct 27 12:34:33 proxy opensips[140296]: Oct 27 12:34:33 [140296]
ERROR:core:fix_actions: Failed to fix command <is_gflag>
Oct 27 12:34:33 proxy opensips[140296]: Oct 27 12:34:33 [140296]
ERROR:core:fix_actions: fixing failed (code=-6) at
/etc/opensips/opensips.cfg:126
Oct 27 12:34:33 proxy opensips[140296]: Oct 27 12:34:33 [140296]
CRITICAL:core:fix_expr: fix_actions error
Oct 27 12:34:33 proxy opensips[140296]: Oct 27 12:34:33 [140296]
ERROR:core:main: failed to fix configuration with err code -6
Oct 27 12:34:33 proxy systemd[1]: opensips.service: Control process
exited, code=exited, status=255/EXCEPTION
Oct 27 12:34:33 proxy systemd[1]: opensips.service: Failed with result
'exit-code'.

at the beginning of the code I added
loadmodule "gflags.so"
modparam("gflags", "initial", 0)

it does load with those two lines, but as soon as I try to use the
module, it blows up.



On Thu, Oct 27, 2022 at 2:55 AM Bogdan-Andrei Iancu <bogdan at opensips.org> wrote:
>
> To be more specific here, use the suggested gflags to test for initial INVITE and reject any new call if the gflag is set - and you can toggle the flag via MI cmds.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Bootcamp 5-16 Dec 2022, online
>   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/
>
> On 10/27/22 8:05 AM, mayamatakeshi wrote:
>
> It can be done with:
>   https://opensips.org/docs/modules/3.1.x/gflags.html
>
>
> On Thu, Oct 27, 2022 at 1:18 PM Saint Michael <venefax at gmail.com> wrote:
>>
>> Dear Friends
>> I successfully wrote a script that terminates all open calls in an
>> orderly fashion.
>> The question is, before I execute my script, is there any similar
>> command (like opensips-cli -x mi dlg_end_dlg "${callid}") that would
>> stop taking new calls?  Like "reject any call attempts with 503 or
>> 404", because, in a high-pressure environment, 2000 new calls may
>> arrive before I close all calls and shut down Opensips.
>> I use version:
>> opensips -V
>> version: opensips 3.1.12 (x86_64/linux)
>> flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
>> Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_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: 15ef14a89
>> main.c compiled on 03:16:12 Oct 25 2022 with gcc 9
>>
>> On Wed, Oct 26, 2022 at 10:49 AM Bogdan-Andrei Iancu
>> <bogdan at opensips.org> wrote:
>> >
>> > Hi,
>> >
>> > Sending a sig TERM to the opensips processes will trigger a controlled
>> > shutdown of opensips (meaning with flushing data to DB, if needed,
>> > cleanup, etc). Nevertheless, the opensips shutdown does not ends the
>> > call, as the calls may be continued after restarting opensips.
>> >
>> > Still, if you want to terminate all ongoing calls before shutting down,
>> > better use dialog module and check these MI cmds:
>> > https://opensips.org/html/docs/modules/3.2.x/dialog.html#mi_dlg_end_dlg
>> > https://opensips.org/html/docs/modules/3.2.x/dialog.html#mi_profile_end_dlgs
>> >
>> > Regards,
>> >
>> > Bogdan-Andrei Iancu
>> >
>> > OpenSIPS Founder and Developer
>> >    https://www.opensips-solutions.com
>> > OpenSIPS Bootcamp 5-16 Dec 2022, online
>> >    https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/
>> >
>> > On 10/25/22 2:15 PM, Saint Michael wrote:
>> > > Dear friends
>> > > is there a command I can send to Opensips 3.1, so all calls are shut
>> > > down and BYEs are sent to both the caller and the callee? Then of
>> > > course, opensips closes down.
>> > >
>> > > _______________________________________________
>> > > Users mailing list
>> > > Users at lists.opensips.org
>> > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>



More information about the Users mailing list