summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-03-17 11:19:22 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-03-17 11:19:23 -0500
commit7d63b4499e36b616851d4ebf9b5394540a77e4ac (patch)
tree8a272bc19975f4043364f90337c0e40d81f0e873 /channels
parent810f92c9dcfa2ca2b883d3f82699abe6bf219a53 (diff)
parent8be01398d93a7b3df0601e80e839b45a80245254 (diff)
Merge "chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full()."
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5c6f23fed..97cd6abb0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -23278,18 +23278,14 @@ static int sip_reinvite_retry(const void *data)
struct sip_pvt *p = (struct sip_pvt *) data;
struct ast_channel *owner;
- sip_pvt_lock(p); /* called from schedule thread which requires a lock */
- while ((owner = p->owner) && ast_channel_trylock(owner)) {
- sip_pvt_unlock(p);
- usleep(1);
- sip_pvt_lock(p);
- }
+ owner = sip_pvt_lock_full(p);
ast_set_flag(&p->flags[0], SIP_NEEDREINVITE);
p->waitid = -1;
check_pendings(p);
sip_pvt_unlock(p);
if (owner) {
ast_channel_unlock(owner);
+ ast_channel_unref(owner);
}
dialog_unref(p, "Schedule waitid complete");
return 0;