summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-10-23 11:23:04 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-10-23 12:36:16 -0500
commit6f0431798eb1a1cb3eacf8bb07dd1840f47e682d (patch)
tree99e25a19e19f9dc8103f7b996843a6d353d3cc63
parent8b719a3e48a7dd95a9f5e80a2bcdde822f26bdb4 (diff)
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
-rw-r--r--res/res_pjsip_sdp_rtp.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 20a219e7e..604fd421e 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1335,6 +1335,7 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
RAII_VAR(struct ast_format_cap *, caps, NULL, ao2_cleanup);
enum ast_media_type media_type = session_media->type;
struct ast_sip_session_media *session_media_transport;
+ pj_sockaddr ip;
int direct_media_enabled = !ast_sockaddr_isnull(&session_media->direct_media_addr) &&
ast_format_cap_count(session->direct_media_cap);
@@ -1447,13 +1448,9 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
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;
}
/* Add ICE attributes and candidates */