From cbe7f656749f5cf7e4d8321ef74a99c9281a2284 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 18 Apr 2014 16:27:31 +0000 Subject: 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/ ........ Merged revisions 412579 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412580 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_dial.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'apps/app_dial.c') diff --git a/apps/app_dial.c b/apps/app_dial.c index 3b7434608..61b2c26a0 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1001,16 +1001,9 @@ static void do_forward(struct chanlist *o, struct cause_args *num, c = o->chan = NULL; num->nochan++; } else { - ast_channel_lock_both(c, in); ast_channel_publish_dial(in, c, stuff, NULL); - ast_channel_unlock(in); - ast_channel_unlock(c); - - ast_channel_lock_both(original, in); ast_channel_publish_dial_forward(in, original, c, NULL, "CANCEL", - ast_channel_call_forward(c)); - ast_channel_unlock(in); - ast_channel_unlock(original); + ast_channel_call_forward(original)); /* Hangup the original channel now, in case we needed it */ ast_hangup(original); -- cgit v1.2.3