} else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
}
- ast_mutex_unlock(&pvt->lock);
return ch;
}
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;