summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels/chan_dahdi.c12
-rw-r--r--channels/sig_analog.c12
2 files changed, 22 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 0db84df1f..46c45899b 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -8603,8 +8603,18 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
ast_log(LOG_WARNING, "Unable to allocate three-way subchannel\n");
goto winkflashdone;
}
- /* Make new channel */
+
+ /*
+ * Make new channel
+ *
+ * We cannot hold the p or ast locks while creating a new
+ * channel.
+ */
+ ast_mutex_unlock(&p->lock);
+ ast_channel_unlock(ast);
chan = dahdi_new(p, AST_STATE_RESERVED, 0, SUB_THREEWAY, 0, NULL);
+ ast_channel_lock(ast);
+ ast_mutex_lock(&p->lock);
if (p->dahditrcallerid) {
if (!p->origcid_num)
p->origcid_num = ast_strdup(p->cid_num);
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 63523358c..5d71696be 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -3205,8 +3205,18 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
ast_log(LOG_WARNING, "Unable to allocate three-way subchannel\n");
goto winkflashdone;
}
- /* Make new channel */
+
+ /*
+ * Make new channel
+ *
+ * We cannot hold the p or ast locks while creating a new
+ * channel.
+ */
+ analog_unlock_private(p);
+ ast_channel_unlock(ast);
chan = analog_new_ast_channel(p, AST_STATE_RESERVED, 0, ANALOG_SUB_THREEWAY, NULL);
+ ast_channel_lock(ast);
+ analog_lock_private(p);
if (!chan) {
ast_log(LOG_WARNING,
"Cannot allocate new call structure on channel %d\n",