summaryrefslogtreecommitdiff
path: root/main/bridge_basic.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-04-11 12:43:34 +0000
committerKinsey Moore <kmoore@digium.com>2014-04-11 12:43:34 +0000
commitd6e2c50058de41eb80d7abc27786825cb65ddccf (patch)
tree1070269c9ad4edfc57a420b648c75a5408f4372f /main/bridge_basic.c
parentf65dd23bf4fbb1cb909755ac3d36fc6aa9f709bb (diff)
bridging: Ensure locking during snapshot creation
While the vast majority of bridge snapshot creation is locked properly, there are currently some instances that are not. This adds the missing locking to ensure bridge state is not malleable during snapshot creation. (closes issue ASTERISK-22904) Review: https://reviewboard.asterisk.org/r/3415/ Reported by: Matt Jordan ........ Merged revisions 412193 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/bridge_basic.c')
-rw-r--r--main/bridge_basic.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/bridge_basic.c b/main/bridge_basic.c
index 4a68f4904..253aa3516 100644
--- a/main/bridge_basic.c
+++ b/main/bridge_basic.c
@@ -1534,8 +1534,11 @@ static void publish_transfer_success(struct attended_transfer_properties *props)
.bridge = props->target_bridge,
};
+ ast_bridge_lock_both(transferee.bridge, transfer_target.bridge);
ast_bridge_publish_attended_transfer_bridge_merge(0, AST_BRIDGE_TRANSFER_SUCCESS,
&transferee, &transfer_target, props->transferee_bridge);
+ ast_bridge_unlock(transferee.bridge);
+ ast_bridge_unlock(transfer_target.bridge);
}
/*!
@@ -1556,8 +1559,11 @@ static void publish_transfer_threeway(struct attended_transfer_properties *props
.bridge = props->transferee_bridge,
};
+ ast_bridge_lock_both(transferee.bridge, transfer_target.bridge);
ast_bridge_publish_attended_transfer_threeway(0, AST_BRIDGE_TRANSFER_SUCCESS,
&transferee, &transfer_target, &threeway);
+ ast_bridge_unlock(transferee.bridge);
+ ast_bridge_unlock(transfer_target.bridge);
}
/*!
@@ -1574,8 +1580,11 @@ static void publish_transfer_fail(struct attended_transfer_properties *props)
.bridge = props->target_bridge,
};
+ ast_bridge_lock_both(transferee.bridge, transfer_target.bridge);
ast_bridge_publish_attended_transfer_fail(0, AST_BRIDGE_TRANSFER_FAIL,
&transferee, &transfer_target);
+ ast_bridge_unlock(transferee.bridge);
+ ast_bridge_unlock(transfer_target.bridge);
}
/*!