summaryrefslogtreecommitdiff
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorMoises Silva <moises.silva@gmail.com>2009-05-23 04:27:47 +0000
committerMoises Silva <moises.silva@gmail.com>2009-05-23 04:27:47 +0000
commitb93c1a2df5d6efc0afa4e2d9be279e994aa4e25d (patch)
tree8931b4a73a6f959e610f98d9676b65ff7be6e53e /channels/chan_dahdi.c
parent3982b8c71b79a2739abf8e9e22422e0e01d8f88f (diff)
set MFCR2_CATEGORY just when starting the pbx
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index f4b6d3aca..b3fcac294 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -7758,10 +7758,6 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb
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;
/* Assure there is no confmute on this channel */
@@ -7776,6 +7772,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);