if (stat == err_status_replay_fail) msg="replay check failed";
else if (stat == err_status_auth_fail) msg="auth check failed";
else msg="";
- if (errs >= WARN_SRTP_ERRS && !(errs % WARN_SRTP_ERRS)) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING,
- "SRTP %s unprotect failed with code %d (%s) %ld bytes %d errors\n",
- rtp_type(rtp_session), stat, msg, (long)*bytes, errs);
- } else if (errs >= MAX_SRTP_ERRS) {
+ if (errs >= MAX_SRTP_ERRS) {
switch_channel_t *channel = switch_core_session_get_channel(rtp_session->session);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR,
"SRTP %s unprotect failed with code %d (%s) %ld bytes %d errors\n",
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR,
"Ending call due to SRTP error\n");
switch_channel_hangup(channel, SWITCH_CAUSE_SRTP_READ_ERROR);
+ } else if (errs >= WARN_SRTP_ERRS && !(errs % WARN_SRTP_ERRS)) {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING,
+ "SRTP %s unprotect failed with code %d (%s) %ld bytes %d errors\n",
+ rtp_type(rtp_session), stat, msg, (long)*bytes, errs);
}
}
sbytes = 0;