From 6eed7ae50368c4f1ac0528e2e66148886eb2a902 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Mon, 24 Mar 2008 19:17:41 +0000 Subject: [PATCH] This is a revert for revision 108288. The reason is that that revision was not for an actual bug fix per se, and so it really should not have been in 1.4 in the first place. Plus, people who compile with DO_CRASH are more likely to encounter a crash due to this change. While I think the usage of DO_CRASH in ast_sched_del is a bit absurd, this sort of change is beyond the scope of 1.4 and should be done instead in a developer branch based on trunk so that all scheduler functions are fixed at once. I also am reverting the change to trunk and 1.6 since they also suffer from the DO_CRASH potential. (closes issue #12272) Reported by: qq12345 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110618 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b907c5fb60..37056cec18 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3038,7 +3038,7 @@ static int sip_call(struct ast_channel *ast, char *dest, int timeout) p->invitestate = INV_CALLING; /* Initialize auto-congest time */ - ast_sched_del(sched, p->initid); + AST_SCHED_DEL(sched, p->initid); p->initid = ast_sched_add(sched, p->maxtime ? (p->maxtime * 4) : SIP_TRANS_TIMEOUT, auto_congest, p); } } @@ -3111,7 +3111,7 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner) if (p->stateid > -1) ast_extension_state_del(p->stateid, NULL); - ast_sched_del(sched, p->initid); + AST_SCHED_DEL(sched, p->initid); AST_SCHED_DEL(sched, p->waitid); AST_SCHED_DEL(sched, p->autokillid); @@ -12070,7 +12070,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru /* Acknowledge sequence number - This only happens on INVITE from SIP-call */ /* Don't auto congest anymore since we've gotten something useful back */ - ast_sched_del(sched, p->initid); + AST_SCHED_DEL(sched, p->initid); /* RFC3261 says we must treat every 1xx response (but not 100) that we don't recognize as if it was 183. @@ -14656,9 +14656,6 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req) stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */ - if (p->owner) - ast_queue_hangup(p->owner); - else sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); if (p->initreq.len > 0) { transmit_response_reliable(p, "487 Request Terminated", &p->initreq);