[asterisk-commits] file: branch file/sha256-a-harsh-reality r417075 - in /team/file/sha256-a-har...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 23 09:19:43 CDT 2014


Author: file
Date: Mon Jun 23 09:19:35 2014
New Revision: 417075

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=417075
Log:
Allow AVP to be forced for media streams and consider crypto active if DTLS
parameters are present in the stream.

Modified:
    team/file/sha256-a-harsh-reality/channels/chan_sip.c
    team/file/sha256-a-harsh-reality/channels/sip/include/sip.h
    team/file/sha256-a-harsh-reality/configs/sip.conf.sample

Modified: team/file/sha256-a-harsh-reality/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/file/sha256-a-harsh-reality/channels/chan_sip.c?view=diff&rev=417075&r1=417074&r2=417075
==============================================================================
--- team/file/sha256-a-harsh-reality/channels/chan_sip.c (original)
+++ team/file/sha256-a-harsh-reality/channels/chan_sip.c Mon Jun 23 09:19:35 2014
@@ -10050,12 +10050,21 @@
 
 			if (process_sdp_a_dtls(value, p, p->rtp)) {
 				processed = TRUE;
+				if (p->srtp) {
+					ast_set_flag(p->srtp, SRTP_CRYPTO_OFFER_OK);
+				}
 			}
 			if (process_sdp_a_dtls(value, p, p->vrtp)) {
 				processed = TRUE;
+				if (p->vsrtp) {
+					ast_set_flag(p->vsrtp, SRTP_CRYPTO_OFFER_OK);
+				}
 			}
 			if (process_sdp_a_dtls(value, p, p->trtp)) {
 				processed = TRUE;
+				if (p->tsrtp) {
+					ast_set_flag(p->tsrtp, SRTP_CRYPTO_OFFER_OK);
+				}
 			}
 
 			break;
@@ -10461,7 +10470,11 @@
 					if (process_sdp_a_ice(value, p, p->rtp)) {
 						processed = TRUE;
 					} else if (process_sdp_a_dtls(value, p, p->rtp)) {
+						processed_crypto = TRUE;
 						processed = TRUE;
+						if (p->srtp) {
+							ast_set_flag(p->srtp, SRTP_CRYPTO_OFFER_OK);
+						}
 					} else if (process_sdp_a_sendonly(value, &sendonly)) {
 						processed = TRUE;
 					} else if (!processed_crypto && process_crypto(p, p->rtp, &p->srtp, value)) {
@@ -10476,7 +10489,11 @@
 					if (process_sdp_a_ice(value, p, p->vrtp)) {
 						processed = TRUE;
 					} else if (process_sdp_a_dtls(value, p, p->vrtp)) {
+						processed_crypto = TRUE;
 						processed = TRUE;
+						if (p->vsrtp) {
+							ast_set_flag(p->vsrtp, SRTP_CRYPTO_OFFER_OK);
+						}
 					} else if (!processed_crypto && process_crypto(p, p->vrtp, &p->vsrtp, value)) {
 						processed_crypto = TRUE;
 						processed = TRUE;
@@ -13059,7 +13076,8 @@
 {
 	struct ast_rtp_engine_dtls *dtls;
 
-	if ((dtls = ast_rtp_instance_get_dtls(instance)) && dtls->active(instance)) {
+	if (!ast_test_flag(&p->flags[2], SIP_PAGE3_FORCE_AVP) && (dtls = ast_rtp_instance_get_dtls(instance))
+		&& dtls->active(instance)) {
 		return ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF) ? "UDP/TLS/RTP/SAVPF" : "UDP/TLS/RTP/SAVP";
 	} else {
 		if (ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
@@ -31103,6 +31121,8 @@
 				ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_USE_AVPF);
 			} else if (!strcasecmp(v->name, "icesupport")) {
 				ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT);
+			} else if (!strcasecmp(v->name, "force_avp")) {
+				ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_FORCE_AVP);
 			} else {
 				ast_rtp_dtls_cfg_parse(&peer->dtls_cfg, v->name, v->value);
 			}

Modified: team/file/sha256-a-harsh-reality/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/file/sha256-a-harsh-reality/channels/sip/include/sip.h?view=diff&rev=417075&r1=417074&r2=417075
==============================================================================
--- team/file/sha256-a-harsh-reality/channels/sip/include/sip.h (original)
+++ team/file/sha256-a-harsh-reality/channels/sip/include/sip.h Mon Jun 23 09:19:35 2014
@@ -379,10 +379,11 @@
 #define SIP_PAGE3_DIRECT_MEDIA_OUTGOING  (1 << 4)  /*!< DP: Only send direct media reinvites on outgoing calls */
 #define SIP_PAGE3_USE_AVPF               (1 << 5)  /*!< DGP: Support a minimal AVPF-compatible profile */
 #define SIP_PAGE3_ICE_SUPPORT            (1 << 6)  /*!< DGP: Enable ICE support */
+#define SIP_PAGE3_FORCE_AVP              (1 << 7)  /*!< DGP: Force 'RTP/AVP' for all streams, even DTLS */
 
 #define SIP_PAGE3_FLAGS_TO_COPY \
 	(SIP_PAGE3_SNOM_AOC | SIP_PAGE3_SRTP_TAG_32 | SIP_PAGE3_NAT_AUTO_RPORT | SIP_PAGE3_NAT_AUTO_COMEDIA | \
-	 SIP_PAGE3_DIRECT_MEDIA_OUTGOING | SIP_PAGE3_USE_AVPF | SIP_PAGE3_ICE_SUPPORT)
+	 SIP_PAGE3_DIRECT_MEDIA_OUTGOING | SIP_PAGE3_USE_AVPF | SIP_PAGE3_ICE_SUPPORT | SIP_PAGE3_FORCE_AVP)
 
 #define CHECK_AUTH_BUF_INITLEN   256
 

Modified: team/file/sha256-a-harsh-reality/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/file/sha256-a-harsh-reality/configs/sip.conf.sample?view=diff&rev=417075&r1=417074&r2=417075
==============================================================================
--- team/file/sha256-a-harsh-reality/configs/sip.conf.sample (original)
+++ team/file/sha256-a-harsh-reality/configs/sip.conf.sample Mon Jun 23 09:19:35 2014
@@ -1026,6 +1026,8 @@
 ;avpf=yes                       ; Enable inter-operability with media streams using the AVPF RTP profile.
 				; This will cause all offers and answers to use AVPF (or SAVPF). This
 				; option may be specified at the global or peer scope.
+;force_avp=yes			; Force 'RTP/AVP', 'RTP/AVPF', 'RTP/SAVP', and 'RTP/SAVPF' to be used for
+				; media streams when appropriate, even if a DTLS stream is present.
 ;----------------------------------------- REALTIME SUPPORT ------------------------
 ; For additional information on ARA, the Asterisk Realtime Architecture,
 ; please read https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration




More information about the asterisk-commits mailing list