[asterisk-commits] tilghman: trunk r89185 - in /trunk: ./ channels/chan_sip.c main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 12 11:44:04 CST 2007


Author: tilghman
Date: Mon Nov 12 11:44:04 2007
New Revision: 89185

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

........
r89184 | tilghman | 2007-11-12 11:29:17 -0600 (Mon, 12 Nov 2007) | 5 lines

Fix two cases of memory corruption caused by background threads.
Reported by: atis
Patch by: tilghman
Fixes issue #10923

........

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

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=89185&r1=89184&r2=89185
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Nov 12 11:44:04 2007
@@ -2423,8 +2423,16 @@
 		transmit_state_notify(p, AST_EXTENSION_DEACTIVATED, 1, TRUE);	/* Send last notification */
 		p->subscribed = NONE;
 		append_history(p, "Subscribestatus", "timeout");
-		ast_debug(3, "Re-scheduled destruction of SIP subsription %s\n", p->callid ? p->callid : "<unknown>");
+		ast_debug(3, "Re-scheduled destruction of SIP subscription %s\n", p->callid ? p->callid : "<unknown>");
 		return 10000;	/* Reschedule this destruction so that we know that it's gone */
+	}
+
+	/* If there are packets still waiting for delivery, delay the destruction */
+	if (p->packets) {
+		if (option_debug > 2)
+			ast_log(LOG_DEBUG, "Re-scheduled destruction of SIP call %s\n", p->callid ? p->callid : "<unknown>");
+		append_history(p, "ReliableXmit", "timeout");
+		return 10000;
 	}
 
 	if (p->subscribed == MWI_NOTIFICATION)

Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=89185&r1=89184&r2=89185
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Mon Nov 12 11:44:04 2007
@@ -1417,6 +1417,8 @@
 		ast_audiohook_detach_list(chan->audiohooks);
 		chan->audiohooks = NULL;
 	}
+
+	ast_autoservice_stop(chan);
 
 	if (chan->masq) {
 		if (ast_do_masquerade(chan))




More information about the asterisk-commits mailing list