]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
if we are going to set variables on a newly created channel, it should be done *befor...
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 23 May 2007 20:06:13 +0000 (20:06 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 23 May 2007 20:06:13 +0000 (20:06 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@65676 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index f9821eabe4cb6dffdbca9a4d93192b90e532576b..70164b9e72a6529a687874e9e183b2a5dd51b6ae 100644 (file)
@@ -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);