Properly reset schedule items (rizzo)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
fbcf1ef5db
commit
230376c7c0
1 changed files with 9 additions and 2 deletions
|
@ -2095,6 +2095,7 @@ static void __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
|
||||||
if (sipdebug && option_debug > 3)
|
if (sipdebug && option_debug > 3)
|
||||||
ast_log(LOG_DEBUG, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
|
ast_log(LOG_DEBUG, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
|
||||||
ast_sched_del(sched, cur->retransid);
|
ast_sched_del(sched, cur->retransid);
|
||||||
|
cur->retransid = -1;
|
||||||
}
|
}
|
||||||
UNLINK(cur, p->packets, prev);
|
UNLINK(cur, p->packets, prev);
|
||||||
free(cur);
|
free(cur);
|
||||||
|
@ -2139,8 +2140,8 @@ static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
|
||||||
if (option_debug > 3 && sipdebug)
|
if (option_debug > 3 && sipdebug)
|
||||||
ast_log(LOG_DEBUG, "*** SIP TIMER: Cancelling retransmission #%d - %s (got response)\n", cur->retransid, sip_methods[sipmethod].text);
|
ast_log(LOG_DEBUG, "*** SIP TIMER: Cancelling retransmission #%d - %s (got response)\n", cur->retransid, sip_methods[sipmethod].text);
|
||||||
ast_sched_del(sched, cur->retransid);
|
ast_sched_del(sched, cur->retransid);
|
||||||
|
cur->retransid = -1;
|
||||||
}
|
}
|
||||||
cur->retransid = -1;
|
|
||||||
res = 0;
|
res = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2458,6 +2459,7 @@ static void sip_destroy_peer(struct sip_peer *peer)
|
||||||
}
|
}
|
||||||
if (peer->expire > -1)
|
if (peer->expire > -1)
|
||||||
ast_sched_del(sched, peer->expire);
|
ast_sched_del(sched, peer->expire);
|
||||||
|
|
||||||
if (peer->pokeexpire > -1)
|
if (peer->pokeexpire > -1)
|
||||||
ast_sched_del(sched, peer->pokeexpire);
|
ast_sched_del(sched, peer->pokeexpire);
|
||||||
register_peer_exten(peer, FALSE);
|
register_peer_exten(peer, FALSE);
|
||||||
|
@ -7818,8 +7820,10 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
|
||||||
else
|
else
|
||||||
peer->username[0] = '\0';
|
peer->username[0] = '\0';
|
||||||
|
|
||||||
if (peer->expire > -1)
|
if (peer->expire > -1) {
|
||||||
ast_sched_del(sched, peer->expire);
|
ast_sched_del(sched, peer->expire);
|
||||||
|
peer->expire = -1;
|
||||||
|
}
|
||||||
if (expiry > max_expiry)
|
if (expiry > max_expiry)
|
||||||
expiry = max_expiry;
|
expiry = max_expiry;
|
||||||
if (expiry < min_expiry)
|
if (expiry < min_expiry)
|
||||||
|
@ -12003,6 +12007,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
|
||||||
if (global_regattempts_max)
|
if (global_regattempts_max)
|
||||||
p->registry->regattempts = global_regattempts_max+1;
|
p->registry->regattempts = global_regattempts_max+1;
|
||||||
ast_sched_del(sched, r->timeout);
|
ast_sched_del(sched, r->timeout);
|
||||||
|
r->timeout = -1;
|
||||||
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
|
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
|
||||||
break;
|
break;
|
||||||
case 404: /* Not found */
|
case 404: /* Not found */
|
||||||
|
@ -12012,6 +12017,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
|
||||||
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
|
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
|
||||||
r->call = NULL;
|
r->call = NULL;
|
||||||
ast_sched_del(sched, r->timeout);
|
ast_sched_del(sched, r->timeout);
|
||||||
|
r->timeout = -1;
|
||||||
break;
|
break;
|
||||||
case 407: /* Proxy auth */
|
case 407: /* Proxy auth */
|
||||||
if (p->authtries == MAX_AUTHTRIES || do_register_auth(p, req, resp)) {
|
if (p->authtries == MAX_AUTHTRIES || do_register_auth(p, req, resp)) {
|
||||||
|
@ -12045,6 +12051,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
|
||||||
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
|
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
|
||||||
r->call = NULL;
|
r->call = NULL;
|
||||||
ast_sched_del(sched, r->timeout);
|
ast_sched_del(sched, r->timeout);
|
||||||
|
r->timeout = -1;
|
||||||
break;
|
break;
|
||||||
case 200: /* 200 OK */
|
case 200: /* 200 OK */
|
||||||
if (!r) {
|
if (!r) {
|
||||||
|
|
Loading…
Reference in a new issue