diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-11-01 12:40:40 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-11-01 12:40:40 +0000 |
commit | 98dea21bc14a16831710beaadb3b859b7b7a0637 (patch) | |
tree | 0892301be5bc5d940b5beb197984aebd01a17274 /channels | |
parent | 4053f36a71fcb0d8354a9023c9514d51c0011892 (diff) |
chan_sip: Fix RTCP port for SRFLX ICE candidates
This corrects one-way audio between Asterisk and Chrome/jssip as a
result of Asterisk inserting the incorrect RTCP port into RTCP SRFLX
ICE candidates. This also exposes an ICE component enumeration to
extract further details from candidates.
(closes issue ASTERISK-21383)
Reported by: Shaun Clark
Review: https://reviewboard.asterisk.org/r/2967/
........
Merged revisions 402345 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 402348 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 52e7cdd83..9364a1158 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12775,7 +12775,13 @@ static void add_ice_to_sdp(struct ast_rtp_instance *instance, struct ast_str **a while ((candidate = ao2_iterator_next(&i))) { ast_str_append(a_buf, 0, "a=candidate:%s %d %s %d ", candidate->foundation, candidate->id, candidate->transport, candidate->priority); ast_str_append(a_buf, 0, "%s ", ast_sockaddr_stringify_host(&candidate->address)); - ast_str_append(a_buf, 0, "%s typ ", ast_sockaddr_stringify_port(&candidate->address)); + + if (candidate->type == AST_RTP_ICE_CANDIDATE_TYPE_SRFLX + && candidate->id == AST_RTP_ICE_COMPONENT_RTCP) { + ast_str_append(a_buf, 0, "%d typ ", ast_sockaddr_port(&candidate->address) + 1); + } else { + ast_str_append(a_buf, 0, "%s typ ", ast_sockaddr_stringify_port(&candidate->address)); + } if (candidate->type == AST_RTP_ICE_CANDIDATE_TYPE_HOST) { ast_str_append(a_buf, 0, "host"); |