summaryrefslogtreecommitdiff
path: root/main/rtp_engine.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2011-09-16 21:20:02 +0000
committerJonathan Rose <jrose@digium.com>2011-09-16 21:20:02 +0000
commitbeae2df26eaba06d91b99e1365596081bcd30ca0 (patch)
treebf204c0d85e4acf695498ea3110bd43908f9304c /main/rtp_engine.c
parent9112b5c75d1a608ff780b12dde74f9d04c7460ad (diff)
Merged revisions 336307 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r336307 | jrose | 2011-09-16 16:09:20 -0500 (Fri, 16 Sep 2011) | 20 lines Merged revisions 336294 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r336294 | jrose | 2011-09-16 14:53:40 -0500 (Fri, 16 Sep 2011) | 13 lines Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes. In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would break when starting a call with directmedia. This patch queues a new type of control frame so that our RTP bridge loop can properly detect when these situations occur and check to see if peers need to be updated in order to send their media to the proper location. (Closes issue ASTERISK-18340) Reported by: Thomas Arimont (Closes issue ASTERISK-17725) Reported by: kwk Tested by: twilson, jrose ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r--main/rtp_engine.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 9605d6277..730fdcdb2 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -1158,7 +1158,8 @@ static enum ast_bridge_result remote_bridge_loop(struct ast_channel *c0,
(fr->subclass.integer == AST_CONTROL_UNHOLD) ||
(fr->subclass.integer == AST_CONTROL_VIDUPDATE) ||
(fr->subclass.integer == AST_CONTROL_SRCUPDATE) ||
- (fr->subclass.integer == AST_CONTROL_T38_PARAMETERS)) {
+ (fr->subclass.integer == AST_CONTROL_T38_PARAMETERS) ||
+ (fr->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER)) {
if (fr->subclass.integer == AST_CONTROL_HOLD) {
/* If we someone went on hold we want the other side to reinvite back to us */
if (who == c0) {
@@ -1166,8 +1167,10 @@ static enum ast_bridge_result remote_bridge_loop(struct ast_channel *c0,
} else {
glue0->update_peer(c0, NULL, NULL, NULL, 0, 0);
}
- } else if (fr->subclass.integer == AST_CONTROL_UNHOLD) {
- /* If they went off hold they should go back to being direct */
+ } else if (fr->subclass.integer == AST_CONTROL_UNHOLD ||
+ fr->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER) {
+ /* If they went off hold they should go back to being direct, or if we have
+ * been told to force a peer update, go ahead and do it. */
if (who == c0) {
glue1->update_peer(c1, instance0, vinstance0, tinstance0, cap0, 0);
} else {
@@ -1193,7 +1196,10 @@ static enum ast_bridge_result remote_bridge_loop(struct ast_channel *c0,
glue0->get_codec(c1, cap1);
ast_format_cap_append(oldcap1, cap1);
}
- ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
+ /* Since UPDATE_BRIDGE_PEER is only used by the bridging code, don't forward it */
+ if (fr->subclass.integer != AST_CONTROL_UPDATE_RTP_PEER) {
+ ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
+ }
ast_frfree(fr);
} else if (fr->subclass.integer == AST_CONTROL_CONNECTED_LINE) {
if (ast_channel_connected_line_macro(who, other, fr, other == c0, 1)) {