summaryrefslogtreecommitdiff
path: root/main/bridge.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-02-19 19:06:14 -0600
committerRichard Mudgett <rmudgett@digium.com>2016-02-29 12:50:43 -0600
commit86f7336c91bb3fcd0704143ed93d41275080b2e4 (patch)
tree1c17d9f843d6a92e20f86b08d421e03c6461cd3c /main/bridge.c
parent128c96456ce0fc794867317c6a47fb41795c33d5 (diff)
bridge_channel: Don't settle owed events on an optimization.
Local channel optimization could cause DTMF digits to be duplicated. Pending DTMF end events would be posted to a bridge when the local channel optimizes out and is replaced by the channel further down the chain. When the real digit ends, the channel would get another DTMF end posted to the bridge. A -- LocalA;1/n -- LocalA;2/n -- LocalB;1 -- LocalB;2 -- B 1) LocalA has the /n flag to prevent optimization. 2) B is sending DTMF to A through the local channel chain. 3) When LocalB optimizes out it can move B to the position of LocalB;1 4) Without this patch, when B swaps with LocalB;1 then LocalB;1 would settle an owed DTMF end to the bridge toward LocalA;2. 5) When B finally ends its DTMF it sends the DTMF end down the chain. 6) Without this patch, A would hear the DTMF digit end when LocalB optimizes out and when B ends the original digit. ASTERISK-25582 Change-Id: I1bbd28b8b399c0fb54985a5747f330a4cd2aa251
Diffstat (limited to 'main/bridge.c')
-rw-r--r--main/bridge.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/main/bridge.c b/main/bridge.c
index 7451a163c..77865757e 100644
--- a/main/bridge.c
+++ b/main/bridge.c
@@ -2185,7 +2185,7 @@ int bridge_do_move(struct ast_bridge *dst_bridge, struct ast_bridge_channel *bri
bridge_channel_moving(bridge_channel, orig_bridge, dst_bridge);
- if (bridge_channel_internal_push(bridge_channel)) {
+ if (bridge_channel_internal_push_full(bridge_channel, optimized)) {
/* Try to put the channel back into the original bridge. */
ast_bridge_features_remove(bridge_channel->features,
AST_BRIDGE_HOOK_REMOVE_ON_PULL);
@@ -2198,7 +2198,6 @@ int bridge_do_move(struct ast_bridge *dst_bridge, struct ast_bridge_channel *bri
AST_BRIDGE_HOOK_REMOVE_ON_PULL);
ast_bridge_channel_leave_bridge(bridge_channel,
BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, bridge_channel->bridge->cause);
- bridge_channel_settle_owed_events(orig_bridge, bridge_channel);
}
} else {
ast_bridge_channel_leave_bridge(bridge_channel,
@@ -2206,7 +2205,7 @@ int bridge_do_move(struct ast_bridge *dst_bridge, struct ast_bridge_channel *bri
bridge_channel_settle_owed_events(orig_bridge, bridge_channel);
}
res = -1;
- } else {
+ } else if (!optimized) {
bridge_channel_settle_owed_events(orig_bridge, bridge_channel);
}