[Asterisk-cvs] asterisk/channels chan_sip.c,1.509,1.510
markster at lists.digium.com
markster at lists.digium.com
Tue Sep 28 08:52:40 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv7425/channels
Modified Files:
chan_sip.c
Log Message:
On register timeout, pretend to ack any messages so that if they were 100 Trying and nothing else (e.g. certain iconnecthere failures), we still clean up. (bug #2524)
Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.509
retrieving revision 1.510
diff -u -d -r1.509 -r1.510
--- chan_sip.c 26 Sep 2004 20:42:03 -0000 1.509
+++ chan_sip.c 28 Sep 2004 12:55:08 -0000 1.510
@@ -827,6 +827,15 @@
return res;
}
+/* Pretend to ack all packets */
+static int __sip_pretend_ack(struct sip_pvt *p)
+{
+ while(p->packets) {
+ __sip_ack(p, p->packets->seqno, (p->packets->flags & FLAG_RESPONSE), p->packets->data);
+ }
+ return 0;
+}
+
/*--- __sip_semi_ack: Acks receipt of packet, keep it around (used for provisional responses) ---*/
static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, const char *msg)
{
@@ -4040,6 +4049,8 @@
p->registry = NULL;
r->call = NULL;
p->needdestroy = 1;
+ /* Pretend to ACK anything just in case */
+ __sip_pretend_ack(p);
}
r->regstate=REG_STATE_UNREGISTERED;
manager_event(EVENT_FLAG_SYSTEM, "Registry", "Channel: SIP\r\nDomain: %s\r\nStatus: %s\r\n", r->hostname, regstate2str(r->regstate));
More information about the svn-commits
mailing list