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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@412193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2014-04-11 12:35:52 +00:00
parent eefe5659f6
commit acb2a24954
6 changed files with 59 additions and 9 deletions

View File

@@ -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);
}
/*!