]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Avoid collissions between the peerpoke system and the retransmits. Issue #8272.
authorOlle Johansson <oej@edvina.net>
Tue, 14 Nov 2006 11:06:31 +0000 (11:06 +0000)
committerOlle Johansson <oej@edvina.net>
Tue, 14 Nov 2006 11:06:31 +0000 (11:06 +0000)
In some cases, changed timers caused the retransmit system to destroy the dialog before peerpoke_expire
got a chance.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47596 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index a461e7133b7fcad2cab60c89d9f5e3010d877a18..f00f7745c4dde74515684285c7ab052c5007cd3d 100644 (file)
@@ -1246,7 +1246,9 @@ static int retrans_pkt(void *data)
                        ast_mutex_unlock(&pkt->owner->owner->lock);
                } else {
                        /* If no channel owner, destroy now */
-                       ast_set_flag(pkt->owner, SIP_NEEDDESTROY);      
+                       /* Let the peerpoke system expire packets when the timer expires for poke_noanswer */
+                       if (pkt->method != SIP_OPTIONS)
+                               ast_set_flag(pkt->owner, SIP_NEEDDESTROY);      
                }
        }
        /* In any case, go ahead and remove the packet */
@@ -9968,7 +9970,7 @@ static int handle_response_peerpoke(struct sip_pvt *p, int resp, char *rest, str
                        ast_sched_del(sched, peer->pokeexpire);
                if (sipmethod == SIP_INVITE)    /* Does this really happen? */
                        transmit_request(p, SIP_ACK, seqno, 0, 0);
-               ast_set_flag(p, SIP_NEEDDESTROY);       
+               ast_set_flag(p, SIP_NEEDDESTROY);
 
                /* Try again eventually */
                if ((peer->lastms < 0)  || (peer->lastms > peer->maxms))
@@ -11691,7 +11693,7 @@ static int sip_poke_peer(struct sip_peer *peer)
                peer->call = NULL;
                return 0;
        }
-       if (peer->call > 0) {
+       if (peer->call) {
                if (sipdebug)
                        ast_log(LOG_NOTICE, "Still have a QUALIFY dialog active, deleting\n");
                sip_destroy(peer->call);