woops don't log reg twice

This commit is contained in:
Brian West 2010-11-24 10:53:01 -06:00
parent d73cd50e99
commit 17efb68d1d
1 changed files with 6 additions and 7 deletions

View File

@ -1140,9 +1140,11 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
if (auth_res != AUTH_OK && !stale) { if (auth_res != AUTH_OK && !stale) {
if (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) { if (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) {
if (regtype == REG_REGISTER) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SIP auth %s (REGISTER) on sofia profile '%s' " switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SIP auth %s (REGISTER) on sofia profile '%s' "
"for [%s@%s] from ip %s\n", forbidden ? "failure" : "challenge", profile->name, to_user, to_host, network_ip); "for [%s@%s] from ip %s\n", forbidden ? "failure" : "challenge", profile->name, to_user, to_host, network_ip);
} }
}
if (profile->debug) { if (profile->debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s for [%s@%s]\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s for [%s@%s]\n",
@ -1153,10 +1155,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
/* Log line added to support Fail2Ban */ /* Log line added to support Fail2Ban */
if (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) { if (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) {
if (regtype == REG_REGISTER) { if (regtype == REG_INVITE) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "SIP auth failure (REGISTER) on sofia profile '%s' "
"for [%s@%s] from ip %s\n", profile->name, to_user, to_host, network_ip);
} else if (regtype == REG_INVITE) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "SIP auth failure (INVITE) on sofia profile '%s' " switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "SIP auth failure (INVITE) on sofia profile '%s' "
"for [%s@%s] from ip %s\n", profile->name, to_user, to_host, network_ip); "for [%s@%s] from ip %s\n", profile->name, to_user, to_host, network_ip);
} }