]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 65676 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 23 May 2007 20:07:59 +0000 (20:07 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 23 May 2007 20:07:59 +0000 (20:07 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65676 | kpfleming | 2007-05-23 16:06:13 -0400 (Wed, 23 May 2007) | 2 lines

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.4@65677 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index af33defe66bd417534bcc96eca27b01c36320a0b..10c79f31bfafb253b668e84539f539974a53b743 100644 (file)
@@ -3309,6 +3309,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);
@@ -3318,9 +3322,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;