summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels/chan_iax2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 8f6b37351..5cbe6fd32 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3475,6 +3475,10 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
i->owner = tmp;
i->capability = capability;
+
+ 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);
@@ -3484,9 +3488,6 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
}
}
- for (v = i->vars ; v ; v = v->next)
- pbx_builtin_setvar_helper(tmp, v->name, v->value);
-
ast_module_ref(ast_module_info->self);
return tmp;
}