summaryrefslogtreecommitdiff
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2009-09-15 16:12:49 +0000
committerJeff Peeler <jpeeler@digium.com>2009-09-15 16:12:49 +0000
commit0d5e318cb2fc3d8dbc6547f2d30a6f7f5ea90a60 (patch)
treed1cb2dc5501ea20d2a4a4c368938abe85b432545 /channels/chan_dahdi.c
parent95da50292e5360df75979d251e46beac343c4e34 (diff)
Add some changes related to 218430.
* Remove thread_spawned in handle_init_event since it was never used * Always check handle_init_event in case a channel is destroyed git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 1c84511df..28fa20055 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -9922,7 +9922,6 @@ static int dahdi_destroy_channel_bynum(int channel)
static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event)
{
int res;
- int thread_spawned = 0;
pthread_t threadid;
struct ast_channel *chan;
@@ -9976,8 +9975,6 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event)
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
ast_hangup(chan);
- } else {
- thread_spawned = 1;
}
} else
ast_log(LOG_WARNING, "Unable to create channel\n");
@@ -10019,8 +10016,6 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
}
ast_hangup(chan);
- } else {
- thread_spawned = 1;
}
break;
default:
@@ -10109,8 +10104,6 @@ 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);
- } else {
- thread_spawned = 1;
}
}
break;
@@ -10363,7 +10356,8 @@ static void *do_monitor(void *data)
struct ast_channel *chan;
ast_mutex_unlock(&iflock);
if (analog_lib_handles(i->sig, i->radio, i->oprmode)) {
- analog_handle_init_event(i->sig_pvt, ANALOG_EVENT_DTMFCID);
+ /* just in case this event changes or somehow destroys a channel, set doomed here too */
+ doomed = analog_handle_init_event(i->sig_pvt, ANALOG_EVENT_DTMFCID);
i->dtmfcid_holdoff_state = 1;
} else {
chan = dahdi_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0, NULL);