summaryrefslogtreecommitdiff
path: root/main/rtp.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-03-07 17:55:11 +0000
committerJoshua Colp <jcolp@digium.com>2007-03-07 17:55:11 +0000
commite7da006562e77df839c6b5f26c7b69ec99539df4 (patch)
tree2522947bd1bac6adbda0e54134f73c44b30421a7 /main/rtp.c
parent061df742597e9c92db9cf31675bdcbada59d33ec (diff)
Merged revisions 58240 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r58240 | file | 2007-03-07 12:52:58 -0500 (Wed, 07 Mar 2007) | 2 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@58241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/rtp.c b/main/rtp.c
index acd139418..1ff0a453d 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1537,7 +1537,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, text_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, text_src_res = AST_RTP_GET_FAILED;
- int srccodec, nat_active = 0;
+ int srccodec, destcodec, nat_active = 0;
/* Lock channels */
ast_channel_lock(c0);
@@ -1592,6 +1592,17 @@ int ast_rtp_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
srccodec = srcpr->get_codec(c1);
else
srccodec = 0;
+ if (audio_dest_res == AST_RTP_TRY_NATIVE && destpr->get_codec)
+ destcodec = destpr->get_codec(c0);
+ else
+ destcodec = 0;
+ /* Ensure we have at least one matching codec */
+ if (!(srccodec & destcodec)) {
+ ast_channel_unlock(c0);
+ if (c1)
+ ast_channel_unlock(c1);
+ return 0;
+ }
/* Consider empty media as non-existant */
if (audio_src_res == AST_RTP_TRY_NATIVE && !srcp->them.sin_addr.s_addr)
srcp = NULL;