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

Anonymous Coward asteriskteam at digium.com
Tue Mar 15 16:27:16 CDT 2016


Anonymous Coward #1000019 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:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b7e4c69..d6a4bb3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22649,18 +22649,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/2386
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list