]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full(). 86/2386/1
authorRichard Mudgett <rmudgett@digium.com>
Sat, 5 Mar 2016 00:25:21 +0000 (18:25 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 14 Mar 2016 19:00:22 +0000 (13:00 -0600)
Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12

channels/chan_sip.c

index b7e4c695b3f5644d1817727fe5c98e6f64a7af4f..d6a4bb3335be3a2a51ec1e4784f226cf2168cbf2 100644 (file)
@@ -22649,18 +22649,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, "unref the dialog ptr from sip_reinvite_retry, because it held a dialog ptr");
        return 0;