[asterisk-commits] kmoore: branch kmoore/pjsip_dtls r394502 - /team/kmoore/pjsip_dtls/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 16 15:19:17 CDT 2013


Author: kmoore
Date: Tue Jul 16 15:19:16 2013
New Revision: 394502

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394502
Log:
Make sure SRTP prevents media path optimization

Modified:
    team/kmoore/pjsip_dtls/channels/chan_gulp.c

Modified: team/kmoore/pjsip_dtls/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_dtls/channels/chan_gulp.c?view=diff&rev=394502&r1=394501&r2=394502
==============================================================================
--- team/kmoore/pjsip_dtls/channels/chan_gulp.c (original)
+++ team/kmoore/pjsip_dtls/channels/chan_gulp.c Tue Jul 16 15:19:16 2013
@@ -386,6 +386,10 @@
 	ao2_ref(*instance, +1);
 
 	ast_assert(endpoint != NULL);
+	if (endpoint->media_encryption != AST_SIP_MEDIA_ENCRYPT_NONE) {
+		return AST_RTP_GLUE_RESULT_FORBID;
+	}
+
 	if (endpoint->direct_media) {
 		return AST_RTP_GLUE_RESULT_REMOTE;
 	}
@@ -397,13 +401,21 @@
 static enum ast_rtp_glue_result gulp_get_vrtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
 {
 	struct gulp_pvt *pvt = ast_channel_tech_pvt(chan);
+	struct ast_sip_endpoint *endpoint;
 
 	if (!pvt || !pvt->session || !pvt->media[SIP_MEDIA_VIDEO]->rtp) {
 		return AST_RTP_GLUE_RESULT_FORBID;
 	}
 
+	endpoint = pvt->session->endpoint;
+
 	*instance = pvt->media[SIP_MEDIA_VIDEO]->rtp;
 	ao2_ref(*instance, +1);
+
+	ast_assert(endpoint != NULL);
+	if (endpoint->media_encryption != AST_SIP_MEDIA_ENCRYPT_NONE) {
+		return AST_RTP_GLUE_RESULT_FORBID;
+	}
 
 	return AST_RTP_GLUE_RESULT_LOCAL;
 }




More information about the asterisk-commits mailing list