[asterisk-commits] kpfleming: branch 1.2 r61913 - /branches/1.2/channels/chan_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 25 15:25:00 MST 2007


Author: kpfleming
Date: Wed Apr 25 17:24:59 2007
New Revision: 61913

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61913
Log:
handle a very bizarre race condition with channels being redirected before a simple switch can be started on them (issue #9286)

Modified:
    branches/1.2/channels/chan_zap.c

Modified: branches/1.2/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_zap.c?view=diff&rev=61913&r1=61912&r2=61913
==============================================================================
--- branches/1.2/channels/chan_zap.c (original)
+++ branches/1.2/channels/chan_zap.c Wed Apr 25 17:24:59 2007
@@ -5389,6 +5389,16 @@
 	int len = 0;
 	int res;
 	int index;
+
+	/* in the bizarre case where the channel has become a zombie before we
+	   even get started here, abort safely
+	*/
+	if (!p) {
+		ast_log(LOG_WARNING, "Channel became a zombie before simple switch could be started (%s)\n", chan->name);
+		ast_hangup(chan);
+		return NULL;
+	}
+
 	if (option_verbose > 2) 
 		ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s'\n", chan->name);
 	index = zt_get_index(chan, p, 1);



More information about the asterisk-commits mailing list