The first 9 frames are not reported as some devices dont use srtp
from first frame these are suppresed.
the warning is then output only once every 100 frames.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337541
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
srtp_t session;
const struct ast_srtp_cb *cb;
void *data;
+ int warned;
unsigned char buf[8192 + AST_FRIENDLY_OFFSET];
};
ast_free(srtp);
return NULL;
}
+
+ srtp->warned = 1;
return srtp;
}
}
if (res != err_status_ok && res != err_status_replay_fail ) {
- ast_log(LOG_WARNING, "SRTP unprotect: %s\n", srtp_errstr(res));
+ if ((srtp->warned >= 10) && !((srtp->warned - 10) % 100)) {
+ ast_log(LOG_WARNING, "SRTP unprotect: %s %d\n", srtp_errstr(res), srtp->warned);
+ srtp->warned = 11;
+ } else {
+ srtp->warned++;
+ }
errno = EAGAIN;
return -1;
}