[asterisk-commits] twilson: branch 1.8 r287056 - /branches/1.8/res/res_srtp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 15 17:17:26 CDT 2010


Author: twilson
Date: Wed Sep 15 17:17:17 2010
New Revision: 287056

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=287056
Log:
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

Modified:
    branches/1.8/res/res_srtp.c

Modified: branches/1.8/res/res_srtp.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_srtp.c?view=diff&rev=287056&r1=287055&r2=287056
==============================================================================
--- branches/1.8/res/res_srtp.c (original)
+++ branches/1.8/res/res_srtp.c Wed Sep 15 17:17:17 2010
@@ -343,7 +343,8 @@
 	}
 
 	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 @@
 	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;
 	}
 




More information about the asterisk-commits mailing list