Another approach you may consider is to drop inbound OPTIONS packets by means of iptables (if you'd prefer not to touch the OpenSIPS configuration). Just run from CLI the command like this: iptables -I INPUT -p udp -m udp --dport 5060 -m string --string "OPTIONS sip:" --algo bm --to 65535 -j DROP
And then delete this rule when not needed anymore: iptables -D INPUT -p udp -m udp --dport 5060 -m string --string "OPTIONS sip:" --algo bm --to 65535 -j DROP Of course, the parameters will be pertinent to your specific implementation - protocol, port and optionally source IP(s). On Tue, Jan 21, 2020 at 8:09 AM <users-requ...@lists.opensips.org> wrote: > Send Users mailing list submissions to > users@lists.opensips.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > or, via email, send a message with subject or body 'help' to > users-requ...@lists.opensips.org > > You can reach the person managing the list at > users-ow...@lists.opensips.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Users digest..." > > > Today's Topics: > > 1. Re: opensips - graceful maintenance mode? (solarmon) > 2. Re: opensips - graceful maintenance mode? (Liviu Chircu) > 3. Re: opensips - graceful maintenance mode? (solarmon) > 4. Re: opensips - graceful maintenance mode? (Liviu Chircu) > 5. Re: opensips - graceful maintenance mode? (solarmon) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 21 Jan 2020 12:21:56 +0000 > From: solarmon <solar...@one-n.co.uk> > To: OpenSIPS users mailling list <users@lists.opensips.org> > Subject: Re: [OpenSIPS-Users] opensips - graceful maintenance mode? > Message-ID: > <CAOXfywMsyQ27Y78O= > go-anxyggspzxtg9bjmsutaf1-c3jc...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Liviu, > > Apologies, I should be more clear. > > The dispatcher endpoints that I have configured are used for routing the > SIP calls to. They are also the endpoints that we are receiving SIP calls > from. > > I understand that opensips are sending SIP Options pings to these > endpoints. And these endpoints are sending SIP Options pings to opensips > and getting a response. > > I would like to understand if I set these endpoints to 'inactive' whether > that means opensips will stop responding to SIP Options pings from that > particular endpoint. > > However, now I have checked our opensips.cfg script (that was created for > us) it looks like it has been hardcoded in: > > route[handle_pings] > { > # keepalive notifies replied ok > if ( is_method("NOTIFY|OPTIONS") && !has_totag() && $rU==NULL) { > send_reply("200", "OK"); > exit; > } > } > > > > > On Tue, 21 Jan 2020 at 11:58, Liviu Chircu <li...@opensips.org> wrote: > > > On 21.01.2020 13:47, solarmon wrote: > > > > > > 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. > > > > What do you mean by "dispatcher endpoint method"? Also, the dispatcher > > module > > ORIGINATES pings to its destinations, it does not RESPOND to them. > > Maybe I'm > > not on par with your terminology here :) > > > > -- > > Liviu Chircu > > www.twitter.com/liviuchircu | www.opensips-solutions.com > > > > OpenSIPS Summit, Amsterdam, May 2020 > > www.opensips.org/events > > OpenSIPS Bootcamp, Miami, March 2020 > > www.opensips.org/training > > > > > > _______________________________________________ > > Users mailing list > > Users@lists.opensips.org > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.opensips.org/pipermail/users/attachments/20200121/7e426355/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Tue, 21 Jan 2020 14:28:20 +0200 > From: Liviu Chircu <li...@opensips.org> > To: OpenSIPS users mailling list <users@lists.opensips.org> > Subject: Re: [OpenSIPS-Users] opensips - graceful maintenance mode? > Message-ID: <6377cb24-0509-1435-bffa-888c5f282...@opensips.org> > Content-Type: text/plain; charset=utf-8; format=flowed > > On 21.01.2020 14:21, solarmon wrote: > > However, now I have checked our opensips.cfg script (that was created > > for us) it looks like it has been hardcoded in: > > > > route[handle_pings] > > { > > # keepalive notifies replied ok > > if ( is_method("NOTIFY|OPTIONS") && !has_totag() && $rU==NULL) { > > send_reply("200", "OK"); > > exit; > > } > > } > > > Exactly! That's where the ping responses are generated. You should > hook the "drain mode" > login somewhere before that block. > > Best regards, > > -- > Liviu Chircu > www.twitter.com/liviuchircu | www.opensips-solutions.com > > OpenSIPS Summit, Amsterdam, May 2020 > www.opensips.org/events > OpenSIPS Bootcamp, Miami, March 2020 > www.opensips.org/training > > > > > ------------------------------ > > Message: 3 > Date: Tue, 21 Jan 2020 13:01:18 +0000 > From: solarmon <solar...@one-n.co.uk> > To: OpenSIPS users mailling list <users@lists.opensips.org> > Subject: Re: [OpenSIPS-Users] opensips - graceful maintenance mode? > Message-ID: > < > caoxfywpchgkmgaox-m8huzzmz_mnrv1e5mwyyuv8ojvfoyb...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Liviu, > > Can the drain_mode code just be put at the very start of the route {} > block? > > Thank you > > On Tue, 21 Jan 2020 at 12:29, Liviu Chircu <li...@opensips.org> wrote: > > > On 21.01.2020 14:21, solarmon wrote: > > > However, now I have checked our opensips.cfg script (that was created > > > for us) it looks like it has been hardcoded in: > > > > > > route[handle_pings] > > > { > > > # keepalive notifies replied ok > > > if ( is_method("NOTIFY|OPTIONS") && !has_totag() && $rU==NULL) > { > > > send_reply("200", "OK"); > > > exit; > > > } > > > } > > > > > Exactly! That's where the ping responses are generated. You should > > hook the "drain mode" > > login somewhere before that block. > > > > Best regards, > > > > -- > > Liviu Chircu > > www.twitter.com/liviuchircu | www.opensips-solutions.com > > > > OpenSIPS Summit, Amsterdam, May 2020 > > www.opensips.org/events > > OpenSIPS Bootcamp, Miami, March 2020 > > www.opensips.org/training > > > > > > _______________________________________________ > > Users mailing list > > Users@lists.opensips.org > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.opensips.org/pipermail/users/attachments/20200121/399b96f6/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 21 Jan 2020 15:04:23 +0200 > From: Liviu Chircu <li...@opensips.org> > To: OpenSIPS users mailling list <users@lists.opensips.org> > Subject: Re: [OpenSIPS-Users] opensips - graceful maintenance mode? > Message-ID: <930a8df3-25d6-0c2b-f817-ec8dc37bb...@opensips.org> > Content-Type: text/plain; charset=utf-8; format=flowed > > On 21.01.2020 15:01, solarmon wrote: > > Can the drain_mode code just be put at the very start of the route {} > > block? > > If you don't mind letting SIP scanners know when you're doing > maintenance, sure. > > -- > Liviu Chircu > www.twitter.com/liviuchircu | www.opensips-solutions.com > > OpenSIPS Summit, Amsterdam, May 2020 > www.opensips.org/events > OpenSIPS Bootcamp, Miami, March 2020 > www.opensips.org/training > > > > > ------------------------------ > > Message: 5 > Date: Tue, 21 Jan 2020 13:08:19 +0000 > From: solarmon <solar...@one-n.co.uk> > To: OpenSIPS users mailling list <users@lists.opensips.org> > Subject: Re: [OpenSIPS-Users] opensips - graceful maintenance mode? > Message-ID: > <CAOXfywM6bmVt4u+s1= > ta-3_o9vmtilrhwh7_ombyn8uw+p7...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Very good point! I'll try to figure out a more suitable place for it. > > Thanks so much for your help! > > On Tue, 21 Jan 2020 at 13:06, Liviu Chircu <li...@opensips.org> wrote: > > > On 21.01.2020 15:01, solarmon wrote: > > > Can the drain_mode code just be put at the very start of the route {} > > > block? > > > > If you don't mind letting SIP scanners know when you're doing > > maintenance, sure. > > > > -- > > Liviu Chircu > > www.twitter.com/liviuchircu | www.opensips-solutions.com > > > > OpenSIPS Summit, Amsterdam, May 2020 > > www.opensips.org/events > > OpenSIPS Bootcamp, Miami, March 2020 > > www.opensips.org/training > > > > > > _______________________________________________ > > Users mailing list > > Users@lists.opensips.org > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.opensips.org/pipermail/users/attachments/20200121/b2919641/attachment.html > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > ------------------------------ > > End of Users Digest, Vol 138, Issue 48 > ************************************** >
_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users