[asterisk-commits] oej: branch 1.2 r47842 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Nov 20 03:17:38 MST 2006


Author: oej
Date: Mon Nov 20 04:17:36 2006
New Revision: 47842

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47842
Log:
Just to be safe, disable all the scheduled items after deleting a scheduler entry (rizzo)

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=47842&r1=47841&r2=47842
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Mon Nov 20 04:17:36 2006
@@ -1401,6 +1401,7 @@
 				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 @@
 				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 @@
 	}
 	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 @@
 	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 @@
 		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 @@
 		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 @@
 		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) {



More information about the asterisk-commits mailing list