[OpenSIPS-Users] fail2ban and opensips

Jeff Davies jeff at connection-telecom.com
Thu Sep 30 10:25:00 CEST 2010


Hi All,

I'm trying to follow http://www.opensips.org/Resources/DocsTutFail2ban 
for fail2ban integration.

All seems to make sense apart from the /etc/opensips/opensips.cfg 
changes seem to cause trouble.

Here is the change causing trouble:

######################
#old version:
#if ( ! www_authorize( "", "phones" ) ) {
#       www_challenge( "", "0" );
#       exit;
#}

######################
#new version:
$var(auth_code) = www_authorize("", "phones");
if ( $var(auth_code) == -1 || $var(auth_code) == -2 ) {
#       xlog("L_NOTICE","Auth error for $fU@$fd from $si cause 
$var(auth_code)");
#       xlog("hello world") ;
}
if ( ! $var(auth_code) ) {
         www_challenge("", "0");
         exit;
}
######################

If I include either xlog call then opensips fails to start from init.d

Any tips here?

Regards,
Jeff



More information about the Users mailing list