From: Kevin P. Fleming Date: Wed, 23 May 2007 20:51:56 +0000 (+0000) Subject: Merged revisions 65682 via svnmerge from X-Git-Tag: 1.4.5~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca6b421be452e6ab80e315cb8fb5c0795a7e1bbf;p=thirdparty%2Fasterisk.git Merged revisions 65682 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r65682 | kpfleming | 2007-05-23 16:46:22 -0400 (Wed, 23 May 2007) | 2 lines ensure that variables are set on a newly created channel before we start a PBX on it ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65683 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index aed2576bcd..e7bb640863 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3932,15 +3932,17 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit pbx_builtin_setvar_helper(tmp, "SIPCALLID", i->callid); if (i->rtp) ast_jb_configure(tmp, &global_jbconf); + + /* 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 && ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name); tmp->hangupcause = AST_CAUSE_SWITCH_CONGESTION; ast_hangup(tmp); 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); if (!ast_test_flag(&i->flags[0], SIP_NO_HISTORY)) append_history(i, "NewChan", "Channel %s - from %s", tmp->name, i->callid);