Skip to content
Snippets Groups Projects
Commit 6776ea7a authored by Mark Spencer's avatar Mark Spencer
Browse files

Fix H.323 locking (bug #3540)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent ad369fa9
No related branches found
No related tags found
No related merge requests found
...@@ -832,7 +832,6 @@ static struct ast_channel *oh323_new(struct oh323_pvt *pvt, int state, const cha ...@@ -832,7 +832,6 @@ static struct ast_channel *oh323_new(struct oh323_pvt *pvt, int state, const cha
} else { } else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
} }
ast_mutex_unlock(&pvt->lock);
return ch; return ch;
} }
...@@ -1389,8 +1388,14 @@ static int answer_call(unsigned call_reference, const char *token) ...@@ -1389,8 +1388,14 @@ static int answer_call(unsigned call_reference, const char *token)
ast_log(LOG_ERROR, "Something is wrong: answer_call\n"); ast_log(LOG_ERROR, "Something is wrong: answer_call\n");
return 0; return 0;
} }
/* Briefly lock call for oh323_new() */
ast_mutex_lock(&pvt->lock);
/* allocate a channel and tell asterisk about it */ /* allocate a channel and tell asterisk about it */
c = oh323_new(pvt, AST_STATE_RINGING, pvt->cd.call_token); c = oh323_new(pvt, AST_STATE_RINGING, pvt->cd.call_token);
/* And release when done */
ast_mutex_unlock(&pvt->lock);
if (!c) { if (!c) {
ast_log(LOG_ERROR, "Couldn't create channel. This is bad\n"); ast_log(LOG_ERROR, "Couldn't create channel. This is bad\n");
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment