aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorjrose <jrose@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-05 19:33:11 +0000
committerjrose <jrose@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-05 19:33:11 +0000
commitbfc33d9dcff53e99e94732e402a0a3c5621f52bf (patch)
treee40605b6c4b7dbdd6813d6faff58591f4e2fc6f4 /channels
parentf25192cb5f4f9f56e6314b1c1f90f6ddd5ae3ed6 (diff)
Merged revisions 317283 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317283 | jrose | 2011-05-05 14:09:13 -0500 (Thu, 05 May 2011) | 10 lines Resolves a deadlock that occurs during sip_new This is based on an uncommitted patch by jpeeler for the issue. Instead of relocking and then unlocking the channel though, we keep the lock on the channel until we are finished doing what we need to the channel. (closes issue #18441) Reported by: Alric ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@317334 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6d532760f..2ab88b37b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6722,7 +6722,6 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
sip_pvt_lock(i);
ast_channel_cc_params_init(tmp, i->cc_params);
tmp->caller.id.tag = ast_strdup(i->cid_tag);
- ast_channel_unlock(tmp);
tmp->tech = ( ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_INFO || ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_SHORTINFO) ? &sip_tech_info : &sip_tech;
@@ -6888,6 +6887,8 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
pbx_builtin_setvar_helper(tmp, v->name, ast_get_encoded_str(v->value, valuebuf, sizeof(valuebuf)));
}
+ ast_channel_unlock(tmp); /* ast_hangup requires the channel to be unlocked */
+
if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
tmp->hangupcause = AST_CAUSE_SWITCH_CONGESTION;