[asterisk-commits] tilghman: trunk r234129 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 10 10:24:47 CST 2009


Author: tilghman
Date: Thu Dec 10 10:24:26 2009
New Revision: 234129

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

........
  r234095 | tilghman | 2009-12-10 10:08:20 -0600 (Thu, 10 Dec 2009) | 9 lines
  
  When we receive no response at all to our INVITE, allow the channel to be destroyed.
  (closes issue #15627, closes issue #15716, closes issue #16270, closes issue #15356, issue #16382)
   Reported by: falves11, corruptor, dant
   Patches: 
         20091209__issue15627__1.6.0.diff.txt uploaded by tilghman (license 14)
         20091209__issue15627__1.4.diff.txt uploaded by tilghman (license 14)
   Tested by: falves11
  Review: https://reviewboard.asterisk.org/r/446/
........

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

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

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=234129&r1=234128&r2=234129
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Dec 10 10:24:26 2009
@@ -5677,6 +5677,9 @@
 			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 			ast_channel_unlock(p->owner);
 		}
+
+		/* Give the channel a chance to act before we proceed with destruction */
+		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 	}
 	sip_pvt_unlock(p);
 	dialog_unref(p, "unreffing arg passed into auto_congest callback (p->initid)");
@@ -6371,19 +6374,20 @@
 		if (needcancel) {	/* Outgoing call, not up */
 			if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
 				/* stop retransmitting an INVITE that has not received a response */
-				struct sip_pkt *cur;
-				for (cur = p->packets; cur; cur = cur->next) {
-					__sip_semi_ack(p, cur->seqno, cur->is_resp, cur->method ? cur->method : find_sip_method(cur->data->str));
-				}
-
 				/* if we can't send right now, mark it pending */
 				if (p->invitestate == INV_CALLING) {
 					/* We can't send anything in CALLING state */
 					ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
-					/* Do we need a timer here if we don't hear from them at all? */
+					__sip_pretend_ack(p);
+					/* Do we need a timer here if we don't hear from them at all? Yes we do or else we will get hung dialogs and those are no fun. */
 					sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 					append_history(p, "DELAY", "Not sending cancel, waiting for timeout");
 				} else {
+					struct sip_pkt *cur;
+
+					for (cur = p->packets; cur; cur = cur->next) {
+						__sip_semi_ack(p, cur->seqno, cur->is_resp, cur->method ? cur->method : find_sip_method(cur->data->str));
+					}
 					p->invitestate = INV_CANCELLED;
 					/* Send a new request: CANCEL */
 					transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE);




More information about the asterisk-commits mailing list