Don't hang up a call on an SRTP unprotect failure

Also make it more obvious when there is an issue en/decrypting.

(closes issue #17563)
Reported by: Alexcr
Patches: 
      res_srtp.c.patch uploaded by sfritsch (license 1089)
Tested by: twilson


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.6
Terry Wilson 15 years ago
parent 08ed487a61
commit 1d1f5ebc44

@ -343,7 +343,8 @@ static int ast_srtp_unprotect(struct ast_srtp *srtp, void *buf, int *len, int rt
}
if (res != err_status_ok && res != err_status_replay_fail ) {
ast_debug(1, "SRTP unprotect: %s\n", srtp_errstr(res));
ast_log(LOG_WARNING, "SRTP unprotect: %s\n", srtp_errstr(res));
errno = EAGAIN;
return -1;
}
@ -361,7 +362,7 @@ static int ast_srtp_protect(struct ast_srtp *srtp, void **buf, int *len, int rtc
memcpy(srtp->buf, *buf, *len);
if ((res = rtcp ? srtp_protect_rtcp(srtp->session, srtp->buf, len) : srtp_protect(srtp->session, srtp->buf, len)) != err_status_ok && res != err_status_replay_fail) {
ast_debug(1, "SRTP protect: %s\n", srtp_errstr(res));
ast_log(LOG_WARNING, "SRTP protect: %s\n", srtp_errstr(res));
return -1;
}

Loading…
Cancel
Save