aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-07 17:52:58 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-07 17:52:58 +0000
commit16bda55d06043343eb931386ef50b82770211106 (patch)
tree0adf6fd006d8f8bee61d24f7d076480bd9166789 /main
parent3ed5af030e30047ac661b6a1f407f6ba8f70e0d3 (diff)
Ensure we have (or should have) at least one matching codec before attempting early bridge SDP seeding. (issue #9221 reported by marcelbarbulescu)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58240 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/rtp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/rtp.c b/main/rtp.c
index e25409e47..fdeca117c 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1445,7 +1445,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, nat_active = 0;
+ int srccodec, destcodec, nat_active = 0;
/* Lock channels */
ast_channel_lock(dest);
@@ -1498,6 +1498,17 @@ int ast_rtp_early_bridge(struct ast_channel *dest, struct ast_channel *src)
srccodec = srcpr->get_codec(src);
else
srccodec = 0;
+ if (audio_dest_res == AST_RTP_TRY_NATIVE && destpr->get_codec)
+ destcodec = destpr->get_codec(dest);
+ else
+ destcodec = 0;
+ /* Ensure we have at least one matching codec */
+ if (!(srccodec & destcodec)) {
+ ast_channel_unlock(dest);
+ if (src)
+ ast_channel_unlock(src);
+ return 0;
+ }
/* Consider empty media as non-existant */
if (audio_src_res == AST_RTP_TRY_NATIVE && !srcp->them.sin_addr.s_addr)
srcp = NULL;