Re: [OpenSIPS-Users] OpenSIPs w/ Fail2Ban - Config ERROR cannot restart OpenSIPS after changes to OpenSIPs.cfg

2021-02-11 Thread Rick McGill - ₪
Dear Liviu,

Ah I see now.  I was following a link from Google to that URL for directions to 
change the code so that OpenSIP could log and use Fail2Ban.
If I dug deeper to find the page on the site that linked to that page I would 
have saw it mentioned 2.4.  I found it now.

Not sure how to proceed as the code from 0 to Auth and all combinations I try 
to change only causes my OpenSIPS to not load because of bad cfg file.
If I find some solution I will take your suggestion and document it for the 
Wifi.

Regards, Rick

Rick McGill – CEO
r...@netrovoip.com | r...@netropolitanworks.com 
Thailand: +66-2105-4262  x1001  |   USA: +1-737-237-2030   |Mobile: 
+66-85557-3000
Support:: +66-97047-2000  |  SKYPE & LINE ID:  NetroVOIP  | 
supp...@netrovoip.com
  ₪  www.NetroVOIP.com  Telecommunications / Video Consulting & Solutions 
Provider
--
   

-Original Message-
From: Liviu Chircu  
Sent: Thursday, February 11, 2021 2:25 PM
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] OpenSIPs w/ Fail2Ban - Config ERROR cannot 
restart OpenSIPS after changes to OpenSIPs.cfg

On 11.02.2021 09:16, Rick McGill - ₪ wrote:
> I have tried to enter it as '0" as per the instructions in URL link 
> above but that is when it then causes OpenSIPS to not be able to 
> restart.

Hi, Rick!

It seems that the Fail2ban tutorial is compatible with OpenSIPS 2.4 at best, 
rather than "any ver", as it said.  I've changed the wiki to reflect this, 
thanks!

In 3.1, the equivalent of www_challenge("", "0") is www_challenge("",
"auth") indeed, as you suggested.

PS: once you get this working, you are free to create a wiki account and 
create/edit the
https://www.opensips.org/Documentation/Tutorials-Fail2Ban-3-1 updated tutorial 
page and link it in the tutorials list, for others to use in the future!  If 
you need help with linking it alongside "ver 2.4", let me know!

Regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPs w/ Fail2Ban - Config ERROR cannot restart OpenSIPS after changes to OpenSIPs.cfg

2021-02-10 Thread Liviu Chircu

On 11.02.2021 09:16, Rick McGill - ₪ wrote:

I have tried to enter it as '0" as per the instructions
in URL link above but that is when it then causes OpenSIPS to not be able to
restart.


Hi, Rick!

It seems that the Fail2ban tutorial is compatible with OpenSIPS 2.4 at 
best, rather than "any ver", as it said.  I've changed the wiki to 
reflect this, thanks!


In 3.1, the equivalent of www_challenge("", "0") is www_challenge("", 
"auth") indeed, as you suggested.


PS: once you get this working, you are free to create a wiki account and 
create/edit the 
https://www.opensips.org/Documentation/Tutorials-Fail2Ban-3-1 updated 
tutorial page and link it in the tutorials list, for others to use in 
the future!  If you need help with linking it alongside "ver 2.4", let 
me know!


Regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] OpenSIPs w/ Fail2Ban - Config ERROR cannot restart OpenSIPS after changes to OpenSIPs.cfg

2021-02-10 Thread Rick McGill - ₪
Dear OpenSIPs Community,

My goal for this topic is to get Fail2Ban working with OpenSIPs log files.
Same like the instructions in URL link below.

I have tried to follow the directions in this link but the code to edit the
logging of OpenSIPs looks at bit different on my new fresh install of
OpenSIPs 3.1 on Debian 10.7.
https://www.opensips.org/Documentation/Tutorials-Fail2Ban

The is what is in the link above:

---
from:

--

 if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
exit;
}




To:

-

$var(auth_code) = www_authorize("", "subscriber");
if ( $var(auth_code) == -1 || $var(auth_code) == -2 ) {
xlog("L_NOTICE","Auth error for $fU@$fd from $si cause
$var(auth_code)");
}
if ( $var(auth_code) < 0 ) {
www_challenge("", "0");
exit;
}



The issue is that my new install of OpenSIP has code a bit different.
Instead of "0" it has "AUTH".
And when I change the Code like the TO: section above OpenSIPS will not
start because it says Error in Config File it cannot load opensips.


This is what the default code looks like in the opensips.cfg for OpenSIPS
3.1 after a new fresh install like I have:   Notice that www_challenger is
"auth" and not "0"   I have tried to enter it as '0" as per the instructions
in URL link above but that is when it then causes OpenSIPS to not be able to
restart.


if (is_method("REGISTER")) {
# authenticate the REGISTER requests
if (!www_authorize("", "subscriber")) {
www_challenge("", "auth");
exit;
}



Rick McGill – CEO
r...@netrovoip.com | r...@netropolitanworks.com 
Thailand: +66-2105-4262  x1001  |   USA: +1-737-237-2030   |Mobile:
+66-85557-3000
Support:: +66-97047-2000  |  SKYPE & LINE ID:  NetroVOIP  |
supp...@netrovoip.com 
  ₪  www.NetroVOIP.com  Telecommunications / Video Consulting & Solutions
Provider

LetSi.NetroVOIP.com

Video Conference Solution that works with Windows, MAC, Android, and iPhone.
Secure alternative to Zoom for NetroVOIP Cloud PBX customers.   




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users