From 0f71b29e2fb6210573652da80f7f9da1e6509665 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 6 Jun 2012 21:34:10 +0000 Subject: Fix POTS flash hook to orignate a second call deadlock. A deadlock can occur when a POTS phone tries to flash hook to originate a second call for 3-way or transfer. If another process is scanning the channels container when the POTS line flash hooks then a deadlock will occur. * Release the channel and private locks when creating a new channel as a result of a flash hook. (closes issue ASTERISK-19842) Reported by: rmudgett Tested by: rmudgett ........ Merged revisions 368644 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368645 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368646 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/sig_analog.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'channels/sig_analog.c') 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", -- cgit v1.2.3