]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add missing ast_hangup() calls on some analog exception paths.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 12 Jul 2012 20:20:02 +0000 (20:20 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 12 Jul 2012 20:20:02 +0000 (20:20 +0000)
Make starting analog_ss_thread() or __analog_ss_thread() failure paths
hangup the channel.
........

Merged revisions 370017 from http://svn.asterisk.org/svn/asterisk/branches/1.8

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

channels/chan_dahdi.c
channels/sig_analog.c

index 9a464248f01412aa1ed6594d9655f451a23b846d..07b50a503d7981466f0c50242816ac5f477715fd 100644 (file)
@@ -11708,6 +11708,7 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event)
                                        ast_log(LOG_WARNING, "Cannot allocate new structure on channel %d\n", i->channel);
                                } else if (ast_pthread_create_detached(&threadid, NULL, analog_ss_thread, chan)) {
                                        ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
+                                       ast_hangup(chan);
                                }
                        }
                        break;
@@ -11975,6 +11976,7 @@ static void *do_monitor(void *data)
                                                                                        res = ast_pthread_create_detached(&threadid, NULL, analog_ss_thread, chan);
                                                                                        if (res) {
                                                                                                ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
+                                                                                               ast_hangup(chan);
                                                                                        } else {
                                                                                                i->dtmfcid_holdoff_state = 1;
                                                                                        }
index 2c4bbb4b85e17a27b143b08c1f48e4d8c6c7c058..35593ad055601b7541feba634fbdc96126615db1 100644 (file)
@@ -3837,6 +3837,7 @@ void *analog_handle_init_event(struct analog_pvt *i, int event)
                                        ast_log(LOG_WARNING, "Cannot allocate new structure on channel %d\n", i->channel);
                                } else if (ast_pthread_create_detached(&threadid, NULL, __analog_ss_thread, i)) {
                                        ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
+                                       ast_hangup(chan);
                                }
                        }
                        break;
@@ -3861,6 +3862,7 @@ void *analog_handle_init_event(struct analog_pvt *i, int event)
                                        ast_log(LOG_WARNING, "Cannot allocate new structure on channel %d\n", i->channel);
                                } else if (ast_pthread_create_detached(&threadid, NULL, __analog_ss_thread, i)) {
                                        ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
+                                       ast_hangup(chan);
                                }
                        }
                        break;