* \param chan the channel
* \param vars a linked list of variables
*
- * \pre chan is locked
+ * \warning The channel must not be locked if there's a possibility that
+ * a dialplan function would be invoked.
*
* \details
* Variable names can be for a regular channel variable or a dialplan function
/* Copy/inherit important information into new channel */
if (oh) {
if (oh->vars) {
- ast_channel_lock(new_chan);
ast_set_variables(new_chan, oh->vars);
- ast_channel_unlock(new_chan);
}
if (oh->parent_channel) {
call_forward_inherit(new_chan, oh->parent_channel, orig);
if (oh) {
if (oh->vars) {
- ast_channel_lock(chan);
ast_set_variables(chan, oh->vars);
- ast_channel_unlock(chan);
}
if (!ast_strlen_zero(oh->cid_num) && !ast_strlen_zero(oh->cid_name)) {
/*
return -1;
}
- ast_channel_lock(dialed);
if (vars) {
ast_set_variables(dialed, vars);
}
+ ast_channel_lock(dialed);
if (!ast_strlen_zero(account)) {
ast_channel_stage_snapshot(dialed);
ast_channel_accountcode_set(dialed, account);
if (failed) {
char failed_reason[12];
- ast_set_variables(failed, vars);
snprintf(failed_reason, sizeof(failed_reason), "%d", *reason);
pbx_builtin_setvar_helper(failed, "REASON", failed_reason);
ast_channel_unlock(failed);
+ ast_set_variables(failed, vars);
if (ast_pbx_run(failed)) {
ast_log(LOG_ERROR, "Unable to run PBX on '%s'\n",
ast_channel_set_connected_line(chan, &connected, NULL);
}
- ast_channel_lock(chan);
if (variables) {
ast_set_variables(chan, variables);
}
}
snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(chan));
- ast_channel_unlock(chan);
/* Before starting the async dial bump the ref in case the dial quickly goes away and takes
* the reference with it