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

Richard Mudgett asteriskteam at digium.com
Mon Mar 14 13:57:32 CDT 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/2384

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/84/2384/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e467b80..3d45b38 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22841,18 +22841,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/2384
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list