diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-15 04:47:52 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-15 04:47:52 +0000 |
commit | 34bc6cdd59c77eaabd06d231f799667a387c4e14 (patch) | |
tree | 1f9f251a869542b24b42cc3302d9751bf4bc280c /main/rtp.c | |
parent | 39724221b9e67fb7af6b70ec98d48c56e1073cba (diff) |
Merged revisions 47645 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r47645 | file | 2006-11-14 23:45:24 -0500 (Tue, 14 Nov 2006) | 2 lines
If NAT detection is turned on or already detected then say NAT is active when setting the remote RTP peer when doing early bridging. (issue #8365 reported by marcelbarbulescu)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47646 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/rtp.c b/main/rtp.c index 415327358..dfc4df5f4 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -1456,7 +1456,7 @@ int ast_rtp_early_bridge(struct ast_channel *c0, struct ast_channel *c1) struct ast_rtp_protocol *destpr = NULL, *srcpr = NULL; enum ast_rtp_get_result audio_dest_res = AST_RTP_GET_FAILED, video_dest_res = AST_RTP_GET_FAILED; enum ast_rtp_get_result audio_src_res = AST_RTP_GET_FAILED, video_src_res = AST_RTP_GET_FAILED; - int srccodec; + int srccodec, nat_active = 0; /* Lock channels */ ast_channel_lock(c0); @@ -1512,8 +1512,10 @@ int ast_rtp_early_bridge(struct ast_channel *c0, struct ast_channel *c1) /* Consider empty media as non-existant */ if (audio_src_res == AST_RTP_TRY_NATIVE && !srcp->them.sin_addr.s_addr) srcp = NULL; + if (srcp && (srcp->nat || ast_test_flag(srcp, FLAG_NAT_ACTIVE))) + nat_active = 1; /* Bridge media early */ - if (destpr->set_rtp_peer(c0, srcp, vsrcp, srccodec, srcp ? ast_test_flag(srcp, FLAG_NAT_ACTIVE) : 0)) + if (destpr->set_rtp_peer(c0, srcp, vsrcp, srccodec, nat_active)) ast_log(LOG_WARNING, "Channel '%s' failed to setup early bridge to '%s'\n", c0->name, c1 ? c1->name : "<unspecified>"); ast_channel_unlock(c0); if (c1) |