[Asterisk-code-review] res pjsip sdp rtp: Extra fingerprint attribute in SDP (asterisk[13])

Salah Ahmed asteriskteam at digium.com
Fri Sep 21 17:05:32 CDT 2018


Salah Ahmed has uploaded this change for review. ( https://gerrit.asterisk.org/10245


Change subject: res_pjsip_sdp_rtp: Extra fingerprint attribute in SDP
......................................................................

res_pjsip_sdp_rtp: Extra fingerprint attribute in SDP

If an endpoint is configured with following settings,

media_encryption = dtls
media_encryption_optimistic = yes
media_use_received_transport = yes

and if an incoming call don't have DTLS capability, then asterisk
answer this call with the fingerprint attribute in 200 Ok to A-Side
client.

ASTERISK-28067

Change-Id: I559ea4253f43ab9fc99dc1511b170f02edd4df6c
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 11 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/45/10245/1

diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 7c7040e..f2cac01 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -768,9 +768,11 @@
 	char transport_end = stream->desc.transport.ptr[stream->desc.transport.slen - 1];
 	unsigned int optimistic;
 
-	if ((transport_end == 'F' && !endpoint->media.rtp.use_avpf)
-		|| (transport_end != 'F' && endpoint->media.rtp.use_avpf)) {
-		return AST_SIP_MEDIA_TRANSPORT_INVALID;
+	if(!endpoint->media.rtp.use_received_transport) {
+		if ((transport_end == 'F' && !endpoint->media.rtp.use_avpf)
+			|| (transport_end != 'F' && endpoint->media.rtp.use_avpf)) {
+			return AST_SIP_MEDIA_TRANSPORT_INVALID;
+		}
 	}
 
 	incoming_encryption = get_media_encryption_type(stream->desc.transport, stream, &optimistic);
@@ -779,7 +781,7 @@
 		return incoming_encryption;
 	}
 
-	if (endpoint->media.rtp.force_avp ||
+	if ((!endpoint->media.rtp.use_received_transport && endpoint->media.rtp.force_avp) ||
 		endpoint->media.rtp.encryption_optimistic) {
 		return incoming_encryption;
 	}
@@ -1014,14 +1016,14 @@
 	}
 
 	/* Ensure incoming transport is compatible with the endpoint's configuration */
-	if (!session->endpoint->media.rtp.use_received_transport) {
-		encryption = check_endpoint_media_transport(session->endpoint, stream);
+	encryption = check_endpoint_media_transport(session->endpoint, stream);
 
-		if (encryption == AST_SIP_MEDIA_TRANSPORT_INVALID) {
-			return -1;
-		}
+	if (encryption == AST_SIP_MEDIA_TRANSPORT_INVALID) {
+		return -1;
 	}
 
+	session_media->encryption = encryption;
+
 	ast_copy_pj_str(host, stream->conn ? &stream->conn->addr : &sdp->conn->addr, sizeof(host));
 
 	/* Ensure that the address provided is valid */

-- 
To view, visit https://gerrit.asterisk.org/10245
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I559ea4253f43ab9fc99dc1511b170f02edd4df6c
Gerrit-Change-Number: 10245
Gerrit-PatchSet: 1
Gerrit-Owner: Salah Ahmed <txrubel at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180921/ef2fc04d/attachment.html>


More information about the asterisk-code-review mailing list