[asterisk-commits] file: trunk r374757 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 9 16:35:55 CDT 2012


Author: file
Date: Tue Oct  9 16:35:53 2012
New Revision: 374757

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=374757
Log:
Improve logging for DTLS-SRTP failure situations.

(closes issue ASTERISK-20487)
Reported by: mjordan
........

Merged revisions 374756 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=374757&r1=374756&r2=374757
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Oct  9 16:35:53 2012
@@ -5574,9 +5574,21 @@
 		return -1;
 	}
 
-	if (!(dtls = ast_rtp_instance_get_dtls(rtp)) ||
-	    dtls->set_configuration(rtp, &dialog->dtls_cfg) ||
-	    !(*srtp = sip_srtp_alloc())) {
+	if (!(dtls = ast_rtp_instance_get_dtls(rtp))) {
+		ast_log(LOG_ERROR, "No DTLS-SRTP support present on engine for RTP instance '%p', was it compiled with support for it?\n",
+			rtp);
+		return -1;
+	}
+
+	if (dtls->set_configuration(rtp, &dialog->dtls_cfg)) {
+		ast_log(LOG_ERROR, "Attempted to set an invalid DTLS-SRTP configuration on RTP instance '%p'\n",
+			rtp);
+		return -1;
+	}
+
+	if (!(*srtp = sip_srtp_alloc())) {
+		ast_log(LOG_ERROR, "Failed to create required SRTP structure on RTP instance '%p'\n",
+			rtp);
 		return -1;
 	}
 




More information about the asterisk-commits mailing list