Commit 58943610 authored by Youness Alaoui's avatar Youness Alaoui Committed by Olivier Crête

Fix SDP generation for TCP candidates

parent 45b1822f
......@@ -4699,23 +4699,26 @@ _generate_candidate_sdp (NiceAgent *agent,
NiceCandidate *candidate, GString *sdp)
{
gchar ip4[INET6_ADDRSTRLEN];
guint16 port;
nice_address_to_string (&candidate->addr, ip4);
port = nice_address_get_port (&candidate->addr);
g_string_append_printf (sdp, "a=candidate:%.*s %d %s %d %s %d",
NICE_CANDIDATE_MAX_FOUNDATION, candidate->foundation,
candidate->component_id,
_transport_to_sdp (candidate->transport),
candidate->priority, ip4, nice_address_get_port (&candidate->addr));
candidate->priority, ip4, port == 0 ? 9 : port);
g_string_append_printf (sdp, " typ %s", _cand_type_to_sdp (candidate->type));
if (nice_address_is_valid (&candidate->base_addr) &&
!nice_address_equal (&candidate->addr, &candidate->base_addr)) {
port = nice_address_get_port (&candidate->addr);
nice_address_to_string (&candidate->base_addr, ip4);
g_string_append_printf (sdp, " raddr %s rport %d", ip4,
nice_address_get_port (&candidate->base_addr));
if (candidate->transport != NICE_CANDIDATE_TRANSPORT_UDP) {
g_string_append_printf (sdp, " tcptype %s",
_transport_to_sdp_tcptype (candidate->transport));
}
port == 0 ? 9 : port);
}
if (candidate->transport != NICE_CANDIDATE_TRANSPORT_UDP) {
g_string_append_printf (sdp, " tcptype %s",
_transport_to_sdp_tcptype (candidate->transport));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment