summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2008-05-16 21:34:45 +0000
committerJoshua Colp <jcolp@digium.com>2008-05-16 21:34:45 +0000
commit30aedbade74e5387bd5656fd65014d6768a62847 (patch)
treedfeb420e09c0579f661c0f48b8a6c905b9eef5f1 /channels
parentdf6cd7a8798ab600d8da8c9e80781bbc7afaafaf (diff)
Try to fix attended transfers.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6610563dd..bad96503e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11161,12 +11161,18 @@ static struct sip_pvt *get_sip_pvt_byid_locked(const char *callid, const char *t
sip_pvt_ptr->theirtag, sip_pvt_ptr->tag);
return 0;
}
- sip_pvt_unlock(sip_pvt_ptr);
if (totag)
ast_debug(4, "Matched %s call - their tag is %s Our tag is %s\n",
ast_test_flag(&sip_pvt_ptr->flags[0], SIP_OUTGOING) ? "OUTGOING": "INCOMING",
sip_pvt_ptr->theirtag, sip_pvt_ptr->tag);
+
+ /* deadlock avoidance... */
+ while (sip_pvt_ptr->owner && ast_channel_trylock(sip_pvt_ptr->owner)) {
+ sip_pvt_unlock(sip_pvt_ptr);
+ usleep(1);
+ sip_pvt_lock(sip_pvt_ptr);
+ }
}
return sip_pvt_ptr;