[Asterisk-code-review] chan sip.c: Made sip reinvite retry() call sip pvt lock full(). (asterisk[master])

Joshua Colp asteriskteam at digium.com
Thu Mar 17 11:19:23 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full().
......................................................................


chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full().

Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12
---
M channels/chan_sip.c
1 file changed, 2 insertions(+), 6 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2d5843d..13fe7ce 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22889,18 +22889,14 @@
 	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, "unref the dialog ptr from sip_reinvite_retry, because it held a dialog ptr");
 	return 0;

-- 
To view, visit https://gerrit.asterisk.org/2385
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list