Skip to content

Commit

Permalink
fix for RFC5245 15.1 <rel-addr> and <rel-port> MUST be present for se…
Browse files Browse the repository at this point in the history
…rver reflexive, peer, and relay candidates
  • Loading branch information
Eric Tamme authored and razvancrainea committed Jan 12, 2015
1 parent afdcad5 commit f7a491d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/mediaproxy/mediaproxy.c
Expand Up @@ -1715,11 +1715,13 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id, ice_candidate_data *ice_da
unsigned int priority = (ice_data == NULL)?get_ice_candidate_priority(priority_str):ice_data->priority;
port = strtoint(&tokens[j]);
candidate.s = buf;
candidate.len = sprintf(candidate.s, "a=candidate:R%x 1 UDP %u %.*s %i typ relay%.*s",
candidate.len = sprintf(candidate.s, "a=candidate:R%x 1 UDP %u %.*s %i typ relay raddr %.*s rport %i%.*s",
hexip.s_addr,
priority,
tokens[0].len, tokens[0].s,
port,
tokens[0].len, tokens[0].s,
port,
session.separator.len, session.separator.s);

if (!insert_element(msg, stream.first_ice_candidate, candidate.s)) {
Expand All @@ -1729,11 +1731,13 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id, ice_candidate_data *ice_da

if (stream.has_rtcp_ice) {
candidate.s = buf;
candidate.len = sprintf(candidate.s, "a=candidate:R%x 2 UDP %u %.*s %i typ relay%.*s",
candidate.len = sprintf(candidate.s, "a=candidate:R%x 2 UDP %u %.*s %i typ relay raddr %.*s rport %i%.*s",
hexip.s_addr,
priority-1,
tokens[0].len, tokens[0].s,
port+1,
tokens[0].len, tokens[0].s,
port+1,
session.separator.len, session.separator.s);

if (!insert_element(msg, stream.first_ice_candidate, candidate.s)) {
Expand Down

0 comments on commit f7a491d

Please sign in to comment.