From ef5124a43fa2361d430c8ef357e78a910faa953c Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Sat, 23 May 2009 05:29:33 +0000 Subject: [PATCH] Merged revisions 196456 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r196456 | moy | 2009-05-22 23:27:47 -0500 (Fri, 22 May 2009) | 1 line set MFCR2_CATEGORY just when starting the pbx ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@196487 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_dahdi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 9c684601a7..78de3620ea 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -7518,10 +7518,6 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb /* Assume calls are not idle calls unless we're told differently */ i->isidlecall = 0; i->alreadyhungup = 0; -#endif -#ifdef HAVE_OPENR2 - if (i->mfcr2call) - pbx_builtin_setvar_helper(tmp, "MFCR2_CATEGORY", openr2_proto_get_category_string(i->mfcr2_recvd_category)); #endif /* clear the fake event in case we posted one before we had ast_channel */ i->fake_event = 0; @@ -7537,6 +7533,11 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb pbx_builtin_setvar_helper(tmp, v->name, v->value); if (startpbx) { +#ifdef HAVE_OPENR2 + if (i->mfcr2call) { + pbx_builtin_setvar_helper(tmp, "MFCR2_CATEGORY", openr2_proto_get_category_string(i->mfcr2_recvd_category)); + } +#endif if (ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name); ast_hangup(tmp);