aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-20 10:17:36 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-20 10:17:36 +0000
commit542c486d17efde2300480a14c3b0af3d85ce9724 (patch)
tree83a4e6f30b66697a7ff42892af5f282cdef3b356 /channels
parent16535784570c5400c88d9cec6a62bb8a5ce01fde (diff)
Just to be safe, disable all the scheduled items after deleting a scheduler entry (rizzo)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@47842 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 1088e7c8a..e90e96362 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1401,6 +1401,7 @@ static int __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
if (sipdebug && option_debug > 3)
ast_log(LOG_DEBUG, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
ast_sched_del(sched, cur->retransid);
+ cur->retransid = -1;
}
free(cur);
res = 0;
@@ -1456,8 +1457,8 @@ static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
if (option_debug > 3 && sipdebug)
ast_log(LOG_DEBUG, "*** SIP TIMER: Cancelling retransmission #%d - %s (got response)\n", cur->retransid, msg);
ast_sched_del(sched, cur->retransid);
+ cur->retransid = -1;
}
- cur->retransid = -1;
res = 0;
break;
}
@@ -1656,6 +1657,7 @@ static void sip_destroy_peer(struct sip_peer *peer)
}
if (peer->expire > -1)
ast_sched_del(sched, peer->expire);
+
if (peer->pokeexpire > -1)
ast_sched_del(sched, peer->pokeexpire);
register_peer_exten(peer, 0);
@@ -6101,8 +6103,10 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
else
p->username[0] = '\0';
- if (p->expire > -1)
+ if (p->expire > -1) {
ast_sched_del(sched, p->expire);
+ p->expire = -1;
+ }
if ((expiry < 1) || (expiry > max_expiry))
expiry = max_expiry;
if (!ast_test_flag(p, SIP_REALTIME))
@@ -9846,6 +9850,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
if (global_regattempts_max)
p->registry->regattempts = global_regattempts_max+1;
ast_sched_del(sched, r->timeout);
+ r->timeout = -1;
ast_set_flag(p, SIP_NEEDDESTROY);
break;
case 404: /* Not found */
@@ -9855,6 +9860,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
ast_set_flag(p, SIP_NEEDDESTROY);
r->call = NULL;
ast_sched_del(sched, r->timeout);
+ r->timeout = -1;
break;
case 407: /* Proxy auth */
if ((p->authtries == MAX_AUTHTRIES) || do_register_auth(p, req, "Proxy-Authenticate", "Proxy-Authorization")) {
@@ -9869,6 +9875,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
ast_set_flag(p, SIP_NEEDDESTROY);
r->call = NULL;
ast_sched_del(sched, r->timeout);
+ r->timeout = -1;
break;
case 200: /* 200 OK */
if (!r) {