if we are going to set variables on a newly created channel, it should be done *before* we start the PBX on it

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@65676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2
Kevin P. Fleming 18 years ago
parent 2f0f1f5e00
commit 9edd1e094c

@ -3485,6 +3485,10 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
i->owner = tmp;
i->capability = capability;
ast_setstate(tmp, state);
for (v = i->vars ; v ; v = v->next)
pbx_builtin_setvar_helper(tmp, v->name, v->value);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@ -3492,9 +3496,7 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
tmp = NULL;
}
}
for (v = i->vars ; v ; v = v->next)
pbx_builtin_setvar_helper(tmp,v->name,v->value);
ast_mutex_lock(&usecnt_lock);
usecnt++;
ast_mutex_unlock(&usecnt_lock);

Loading…
Cancel
Save