diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-10 15:49:16 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-10 15:49:16 +0000 |
commit | a99460f913a98a6f31a0c8e85ea23e97c5a426cc (patch) | |
tree | 07d7a6e6d71056ed756102d0b2d469a6318313af /apps/app_dial.c | |
parent | d011662b1705740a6f2bccdce3e47d626283240a (diff) |
Even more changes concerning r187426. Revised where locks are placed yet once again. ast_call() should not be called with a channel locked. could cause deadlock issues with local channels.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187673 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index a91e5128b..21ba4b805 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -790,9 +790,10 @@ static void do_forward(struct chanlist *o, ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE); + ast_channel_unlock(in); + ast_channel_unlock(c); + if (ast_call(c, tmpchan, 0)) { - ast_channel_unlock(in); - ast_channel_unlock(c); ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan); ast_clear_flag64(o, DIAL_STILLGOING); ast_hangup(original); @@ -800,6 +801,10 @@ static void do_forward(struct chanlist *o, c = o->chan = NULL; num->nochan++; } else { + ast_channel_lock(c); + while (ast_channel_trylock(in)) { + CHANNEL_DEADLOCK_AVOIDANCE(c); + } senddialevent(in, c, stuff); if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) { char cidname[AST_MAX_EXTENSION] = ""; |