diff options
author | Richard Mudgett <rmudgett@digium.com> | 2010-09-21 20:33:20 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2010-09-21 20:33:20 +0000 |
commit | 851141c131ac9ab08e1420cd29f7f2f098b09e7c (patch) | |
tree | cc0d354fa833a98bb835d863947cc6c01e57d4ee /apps/app_dial.c | |
parent | ee5af946e2bba00fa6e7428b3f8691431ed75009 (diff) |
Merged revisions 288079-288080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r288079 | rmudgett | 2010-09-21 15:29:51 -0500 (Tue, 21 Sep 2010) | 2 lines
Protect channel access in CONNECTED_LINE and REDIRECTING interception macro launch code.
........
r288080 | rmudgett | 2010-09-21 15:29:59 -0500 (Tue, 21 Sep 2010) | 8 lines
Simplify locking code for REDIRECTING interception macro when forwarding a call.
Simplified the locking code by using a local copy of the redirecting party
information in app_dial.c:do_forward() and app_queue.c:wait_for_answer()
for launching the REDIRECTING interception macro when a call is forwarded.
Reduced the lock time of the 'o->chan' and 'in' channels.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 0f7b4880d..51dacb6db 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -852,6 +852,8 @@ static void do_forward(struct chanlist *o, handle_cause(cause, num); ast_hangup(original); } else { + struct ast_party_redirecting redirecting; + if (single && CAN_EARLY_BRIDGE(peerflags, c, in)) { ast_rtp_instance_early_bridge_make_compatible(c, in); } @@ -895,22 +897,20 @@ static void do_forward(struct chanlist *o, * deadlock. This is why the handling of c's lock may seem a bit unusual * here. */ + ast_party_redirecting_init(&redirecting); + ast_party_redirecting_copy(&redirecting, &c->redirecting); ast_channel_unlock(c); - if (ast_channel_redirecting_macro(c, in, &c->redirecting, 1, 0)) { - while (ast_channel_trylock(c)) { - CHANNEL_DEADLOCK_AVOIDANCE(in); - } - ast_channel_update_redirecting(in, &c->redirecting, NULL); - ast_channel_unlock(c); + if (ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) { + ast_channel_update_redirecting(in, &redirecting, NULL); } + ast_party_redirecting_free(&redirecting); + ast_channel_unlock(in); ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE); if (ast_test_flag64(peerflags, OPT_CANCEL_TIMEOUT)) { *to = -1; } - ast_channel_unlock(in); - if (ast_call(c, stuff, 0)) { ast_log(LOG_NOTICE, "Forwarding failed to dial '%s/%s'\n", tech, stuff); |