app_dial and app_queue: Make lock the forwarding channel while taking the channel snapshot.

* Fixed ast_channel_publish_dial_forward() not locking the forwarded
channel when taking the channel snapshot.

* Fixed app_dial.c:do_forward() using the wrong channel to get the
original call forwarding string.

* Removed unnecessary locking when calling ast_channel_publish_dial() and
ast_channel_publish_dial_forward() in app_dial and app_queue.  Holding
channel locks when calling ast_channel_publish_dial_forward() with a
forwarded channel could result in pausing the system while the stasis bus
completes processsing a forwarded channel subscription.

Review: https://reviewboard.asterisk.org/r/3451/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@412579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2014-04-18 16:19:17 +00:00
parent 6b9f6459da
commit 341db59212
3 changed files with 7 additions and 17 deletions

View File

@@ -336,7 +336,9 @@ void ast_channel_publish_dial_forward(struct ast_channel *caller, struct ast_cha
ast_multi_channel_blob_add_channel(payload, "peer", peer_snapshot);
if (forwarded) {
ast_channel_lock(forwarded);
forwarded_snapshot = ast_channel_snapshot_create(forwarded);
ast_channel_unlock(forwarded);
if (!forwarded_snapshot) {
return;
}