Skip to content
Snippets Groups Projects
Commit 9773d235 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

Add missing ast_hangup() calls on some analog exception paths.

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
........

Merged revisions 370025 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent c1354af5
Branches
Tags
No related merge requests found
...@@ -11841,6 +11841,7 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event) ...@@ -11841,6 +11841,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); 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)) { } 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_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
ast_hangup(chan);
} }
} }
ast_callid_threadstorage_auto_clean(callid, callid_created); ast_callid_threadstorage_auto_clean(callid, callid_created);
...@@ -12111,6 +12112,7 @@ static void *do_monitor(void *data) ...@@ -12111,6 +12112,7 @@ static void *do_monitor(void *data)
res = ast_pthread_create_detached(&threadid, NULL, analog_ss_thread, chan); res = ast_pthread_create_detached(&threadid, NULL, analog_ss_thread, chan);
if (res) { if (res) {
ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel); ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
ast_hangup(chan);
} else { } else {
i->dtmfcid_holdoff_state = 1; i->dtmfcid_holdoff_state = 1;
} }
......
...@@ -3886,6 +3886,7 @@ void *analog_handle_init_event(struct analog_pvt *i, int event) ...@@ -3886,6 +3886,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); 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)) { } 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_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
ast_hangup(chan);
} }
} }
ast_callid_threadstorage_auto_clean(callid, callid_created); ast_callid_threadstorage_auto_clean(callid, callid_created);
...@@ -3912,6 +3913,7 @@ void *analog_handle_init_event(struct analog_pvt *i, int event) ...@@ -3912,6 +3913,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); 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)) { } 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_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
ast_hangup(chan);
} }
} }
ast_callid_threadstorage_auto_clean(callid, callid_created); ast_callid_threadstorage_auto_clean(callid, callid_created);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment