From 906d6654771d4a64956e175218cf5de5784bf99a Mon Sep 17 00:00:00 2001 From: Doug Bailey Date: Tue, 27 Jan 2009 15:23:40 +0000 Subject: [PATCH] Handle new VMWI ioctl structure (Now there are two VMWI ioctl calls.) (issue #14104) Reported by: alecdavis Tested by: dbailey git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171558 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_dahdi.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 0d70126755..edd32880e3 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -8249,21 +8249,12 @@ static void *do_monitor(void *data) !ast_strlen_zero(last->mailbox) && (thispass - last->onhooktime > 3)) { res = has_voicemail(last); if (last->msgstate != res) { -#ifndef HAVE_DAHDI_LINEREVERSE_VMWI /* Set driver resources for signalling VMWI */ res2 = ioctl(last->subs[SUB_REAL].dfd, DAHDI_VMWI, &res); if (res2) { /* TODO: This message will ALWAYS be generated on some cards; any way to restrict it to those cards where it is interesting? */ ast_debug(3, "Unable to control message waiting led on channel %d: %s\n", last->channel, strerror(errno)); } -#else - last->mwisend_setting.messages = res; - res2 = ioctl(last->subs[SUB_REAL].dfd, DAHDI_VMWI, &last->mwisend_setting); - if (res2) { - /* TODO: This message will ALWAYS be generated on some cards; any way to restrict it to those cards where it is interesting? */ - ast_debug(3, "Unable to control MWI on channel %d: %s\n", last->channel, strerror(errno)); - } -#endif /* If enabled for FSK spill then initiate it */ if (mwi_send_init(last)) { ast_log(LOG_WARNING, "Unable to initiate mwi send sequence on channel %d\n", last->channel); @@ -9031,6 +9022,9 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, if (!res) { tmp->fxsoffhookstate = p.rxisoffhook; } +#ifdef HAVE_DAHDI_LINEREVERSE_VMWI + res = ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_VMWI_CONFIG, &tmp->mwisend_setting); +#endif } tmp->onhooktime = time(NULL); tmp->group = conf->chan.group;