[asterisk-commits] oej: trunk r99979 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 23 15:09:56 CST 2008


Author: oej
Date: Wed Jan 23 15:09:56 2008
New Revision: 99979

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99979
Log:
Merged revisions 99977 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99977 | oej | 2008-01-23 21:58:20 +0100 (Ons, 23 Jan 2008) | 9 lines

Make sure we don't cancel destruction on calls in CANCEL state, even if we
get 183 while waiting for answer on our CANCEL.

(issue #11736)
Reported by: MVF
Patches: 
      bug11736.txt uploaded by oej (license 306)
Tested by: MVF

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Change Statistics:
 0 files changed

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=99979&r1=99978&r2=99979
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jan 23 15:09:56 2008
@@ -4609,6 +4609,7 @@
 			if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
 				/* stop retransmitting an INVITE that has not received a response */
 				__sip_pretend_ack(p);
+				p->invitestate = INV_CANCELLED;
 
 				/* if we can't send right now, mark it pending */
 				if (p->invitestate == INV_CALLING) {
@@ -4624,7 +4625,6 @@
 					   INVITE, but do set an autodestruct just in case we never get it. */
 					needdestroy = 0;
 					sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
-					p->invitestate = INV_CANCELLED;
 				}
 				if ( p->initid != -1 ) {
 					/* channel still up - reverse dec of inUse counter
@@ -14274,14 +14274,14 @@
 	switch (resp) {
 	case 100:	/* Trying */
 	case 101:	/* Dialog establishment */
-		if (!req->ignore)
+		if (!req->ignore && p->invitestate != INV_CANCELLED)
 			sip_cancel_destroy(p);
 		check_pendings(p);
 		break;
 
 	case 180:	/* 180 Ringing */
 	case 182:       /* 182 Queued */
-		if (!req->ignore)
+		if (!req->ignore && p->invitestate != INV_CANCELLED)
 			sip_cancel_destroy(p);
 		if (!req->ignore && p->owner) {
 			ast_queue_control(p->owner, AST_CONTROL_RINGING);
@@ -14301,7 +14301,7 @@
 		break;
 
 	case 183:	/* Session progress */
-		if (!req->ignore)
+		if (!req->ignore && (p->invitestate != INV_CANCELLED))
 			sip_cancel_destroy(p);
 		/* Ignore 183 Session progress without SDP */
 		if (find_sdp(req)) {
@@ -14316,7 +14316,7 @@
 		break;
 
 	case 200:	/* 200 OK on invite - someone's answering our call */
-		if (!req->ignore)
+		if (!req->ignore && (p->invitestate != INV_CANCELLED))
 			sip_cancel_destroy(p);
 		p->authtries = 0;
 		if (find_sdp(req)) {




More information about the asterisk-commits mailing list