diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-23 20:51:56 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-23 20:51:56 +0000 |
commit | 7cf509f4482b22cb88a22ed795e7805a6455f302 (patch) | |
tree | e97afde9a8fccdcbe4bfe9c7cfbc35252145060e /channels/chan_sip.c | |
parent | ff30a7b40df3b0399cbfc52fec45e17ef9ae7f53 (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.4@65683 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index aed2576bc..e7bb64086 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); |