diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-25 22:24:59 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-25 22:24:59 +0000 |
commit | 2fd2d0cef8bd97fd6f82f5e137415818a7b99814 (patch) | |
tree | 46b5d2477f96b30fa56346f22f5cc60f8b4d2278 /channels | |
parent | 5c0d8c8559331452eaab2fe3d2dcef19bcbcb294 (diff) |
handle a very bizarre race condition with channels being redirected before a simple switch can be started on them (issue #9286)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@61913 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_zap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 755e80661..e67a73cc2 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -5389,6 +5389,16 @@ static void *ss_thread(void *data) 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); |