diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-21 15:25:13 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-21 15:25:13 +0000 |
commit | 1034354f3486dadcd88a0b66489fc7a895853ccc (patch) | |
tree | 170708f85e64e5b5d6c01f36d3bba3bda9e8d105 /main/rtp.c | |
parent | 1762a860c6a35d3ef0b0fbc9a6127e14d94eca3a (diff) |
Merged revisions 70727 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r70727 | file | 2007-06-21 11:22:39 -0400 (Thu, 21 Jun 2007) | 2 lines
Do not Packet2Packet bridge if packetization settings do not allow it. (issue #9117 reported by phsultan)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@70729 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c index 66c26e71a..f3e0ccb1a 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -3489,6 +3489,8 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel /* If either side can only do a partial bridge, then don't try for a true native bridge */ if (audio_p0_res == AST_RTP_TRY_PARTIAL || audio_p1_res == AST_RTP_TRY_PARTIAL) { + struct ast_format_list fmt0, fmt1; + /* In order to do Packet2Packet bridging both sides must be in the same rawread/rawwrite */ if (c0->rawreadformat != c1->rawwriteformat || c1->rawreadformat != c0->rawwriteformat) { if (option_debug) @@ -3497,6 +3499,17 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel ast_channel_unlock(c1); return AST_BRIDGE_FAILED_NOWARN; } + /* They must also be using the same packetization */ + fmt0 = ast_codec_pref_getsize(&p0->pref, c0->rawreadformat); + fmt1 = ast_codec_pref_getsize(&p1->pref, c1->rawreadformat); + if (fmt0.cur_ms != fmt1.cur_ms) { + if (option_debug) + ast_log(LOG_DEBUG, "Cannot packet2packet bridge - packetization settings prevent it\n"); + ast_channel_unlock(c0); + ast_channel_unlock(c1); + return AST_BRIDGE_FAILED_NOWARN; + } + if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Packet2Packet bridging %s and %s\n", c0->name, c1->name); res = bridge_p2p_loop(c0, c1, p0, p1, timeoutms, flags, fo, rc, pvt0, pvt1); |