diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-09 21:15:44 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-09 21:15:44 +0000 |
commit | 25566768cf5f5b5928738db0ae0c1357df508cf0 (patch) | |
tree | b22a1cf8d8eefbbde5aa226350915189897db5b5 /channels | |
parent | a1eaf77b395fc651114049c936e54dd5b41241b8 (diff) |
Fix H.323 locking (bug #3540)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4992 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_h323.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 2b07ca980..3756dc940 100755 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -832,7 +832,6 @@ static struct ast_channel *oh323_new(struct oh323_pvt *pvt, int state, const cha } else { ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); } - ast_mutex_unlock(&pvt->lock); return ch; } @@ -1389,8 +1388,14 @@ static int answer_call(unsigned call_reference, const char *token) ast_log(LOG_ERROR, "Something is wrong: answer_call\n"); return 0; } + /* Briefly lock call for oh323_new() */ + ast_mutex_lock(&pvt->lock); + /* allocate a channel and tell asterisk about it */ c = oh323_new(pvt, AST_STATE_RINGING, pvt->cd.call_token); + + /* And release when done */ + ast_mutex_unlock(&pvt->lock); if (!c) { ast_log(LOG_ERROR, "Couldn't create channel. This is bad\n"); return 0; |