]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Wed, 23 May 2007 21:23:10 +0000 (21:23 +0000)
committerAutomerge Script <automerge@asterisk.org>
Wed, 23 May 2007 21:23:10 +0000 (21:23 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@65730 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c
channels/chan_sip.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);
index 16b1097d18d670d2748e8664d114d890a65c6568..ab11cb8147a94987614bd22d6a8c72609078aa40 100644 (file)
@@ -2918,6 +2918,11 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
        pbx_builtin_setvar_helper(tmp, "OSPPEER", peer);
 #endif
        ast_setstate(tmp, state);
+
+       /* Set channel variables for this call from configuration */
+       for (v = i->chanvars ; 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);
@@ -2925,10 +2930,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
                        tmp = NULL;
                }
        }
-       /* Set channel variables for this call from configuration */
-       for (v = i->chanvars ; v ; v = v->next)
-               pbx_builtin_setvar_helper(tmp,v->name,v->value);
-                               
+
        ast_mutex_lock(&usecnt_lock);
        usecnt++;
        ast_mutex_unlock(&usecnt_lock);