diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-15 04:45:24 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-15 04:45:24 +0000 |
commit | 169b3aacbae5f87ad8a6089e77f6c3e8104b6497 (patch) | |
tree | 71aaa9007d74a15898c0151a173b2c7d8f293abb /main | |
parent | ce446ec9d6b38caa1ef98ba10e28de4884862778 (diff) |
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/branches/1.4@47645 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/rtp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/rtp.c b/main/rtp.c index a9648274d..5db05be95 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -1390,7 +1390,7 @@ int ast_rtp_early_bridge(struct ast_channel *dest, struct ast_channel *src) 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(dest); @@ -1446,8 +1446,11 @@ int ast_rtp_early_bridge(struct ast_channel *dest, struct ast_channel *src) /* Consider empty media as non-existant */ if (audio_src_res == AST_RTP_TRY_NATIVE && !srcp->them.sin_addr.s_addr) srcp = NULL; + /* If the client has NAT stuff turned on then just safe NAT is active */ + if (srcp && (srcp->nat || ast_test_flag(srcp, FLAG_NAT_ACTIVE))) + nat_active = 1; /* Bridge media early */ - if (destpr->set_rtp_peer(dest, srcp, vsrcp, srccodec, srcp ? ast_test_flag(srcp, FLAG_NAT_ACTIVE) : 0)) + if (destpr->set_rtp_peer(dest, srcp, vsrcp, srccodec, nat_active)) ast_log(LOG_WARNING, "Channel '%s' failed to setup early bridge to '%s'\n", dest->name, src ? src->name : "<unspecified>"); ast_channel_unlock(dest); if (src) |