[Asterisk-code-review] res pjsip sdp rtp: Fix setting of address type for rtp ipv6 (asterisk[13])

Jenkins2 asteriskteam at digium.com
Wed Oct 25 06:26:27 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6871 )

Change subject: res_pjsip_sdp_rtp:  Fix setting of address type for rtp_ipv6
......................................................................

res_pjsip_sdp_rtp:  Fix setting of address type for rtp_ipv6

create_outgoing_sdp_stream was setting "addr_type = STR_IP6" only
when an ipv6 media_address was specified on the endpoint.  If
rtp_ipv6 was set and ast_sip_get_host_ip_string returned an ipv6
address, we were leaving the addr_type set at the default of
STR_IP4.  This caused the address type to be set incorrectly on the
"o" and "c" SDP attributes even though the address was set
correctly.  Some clients don't like the mismatch.

 * Removed the test for endpoint/media_address and now check all
   addresses for ipv6.

ASTERISK-27198
Reported by: Martin Cisárik

Change-Id: I5214fc31b728117842243807e7927a319cf77592
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 4 insertions(+), 7 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 16ffaca..0fcd509 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1167,6 +1167,7 @@
 	RAII_VAR(struct ast_format_cap *, caps, NULL, ao2_cleanup);
 	enum ast_media_type media_type = stream_to_media_type(session_media->stream_type);
 	int use_override_prefs = ast_format_cap_count(session->req_caps);
+	pj_sockaddr ip;
 
 	int direct_media_enabled = !ast_sockaddr_isnull(&session_media->direct_media_addr) &&
 		ast_format_cap_count(session->direct_media_cap);
@@ -1223,13 +1224,9 @@
 	media->conn->addr_type = STR_IP4;
 	pj_strdup2(pool, &media->conn->addr, hostip);
 
-	if (!ast_strlen_zero(session->endpoint->media.address)) {
-		pj_sockaddr ip;
-
-		if ((pj_sockaddr_parse(pj_AF_UNSPEC(), 0, &media->conn->addr, &ip) == PJ_SUCCESS) &&
-			(ip.addr.sa_family == pj_AF_INET6())) {
-			media->conn->addr_type = STR_IP6;
-		}
+	if ((pj_sockaddr_parse(pj_AF_UNSPEC(), 0, &media->conn->addr, &ip) == PJ_SUCCESS) &&
+		(ip.addr.sa_family == pj_AF_INET6())) {
+		media->conn->addr_type = STR_IP6;
 	}
 
 	ast_rtp_instance_get_local_address(session_media->rtp, &addr);

-- 
To view, visit https://gerrit.asterisk.org/6871
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I5214fc31b728117842243807e7927a319cf77592
Gerrit-Change-Number: 6871
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171025/8d9b969d/attachment.html>


More information about the asterisk-code-review mailing list