]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 61913 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 25 Apr 2007 22:29:53 +0000 (22:29 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 25 Apr 2007 22:29:53 +0000 (22:29 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61913 | kpfleming | 2007-04-25 17:24:59 -0500 (Wed, 25 Apr 2007) | 2 lines

handle a very bizarre race condition with channels being redirected before a simple switch can be started on them (issue #9286)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61914 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 3ceec72ab6f995f51caa88c5fc8d4462c9d0c2b2..3a8301c5e25e553dc64906f33b98ca9e53ab5103 100644 (file)
@@ -5402,6 +5402,15 @@ static void *ss_thread(void *data)
        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);