Message Waiting Indicator (MWI) without Asterisk VoiceMail

Hi Guys,

I built my own VoiceMail using an IVR (AGI-Python) and I would like to send a MWI (Message Waiting Indicator) to SIP phones via AGI or Dialplan Commands.

Is this possible? If it’s not possible, can I send a LOGO or TEXT to the SIP Phone? I tried the Dialplan SendText or SendImage and it doesn’t seem to do anything.

exten => _1010,n,SendImage(/var/lib/asterisk/images/asterisk-intro.jpg)
exten => _1010,n,SendText(Welcome to Asterisk)

I use Asterisk 1.4.22 on Debian with Linksys SPA 942 and SPA 962 IP Phones.

Thanks,

Dave

Hi Guys,

Lots of people are looking at this thread but no answers.

Does anyone have any experience with this or possibly “hints” ?

Thanks,

Dave

Have you had any luck with getting an answer to this? This is actually a dealbreaker for me. I have had to look at alternatives to asterisk for this simple fact. It’s really not impressive if you can give a client all the “extra” features of a phone system, but can’t make the light on their phone blink.

In my case, I have integrated Exchange UM to asterisk through sipx. And I have a 3rd party utility (mwi2007) that will send the mwi alert. But asterisk won’t accept it. I’ve posted this on other forums and the only response I get is “well, you’re alerted in an emai, isn’t that good enough?”

The short answer is “No”. The cheapest phone systems in the world can have a message light blink. And other non-asterisk based phone systems (ie sipx) can handle it. But noone has answered how to get it to work.

I hope you have more success…
-j

This piqued my curiosity a bit. Asterisk uses the standard NOTIFY SIP message with the “Messages-Waiting” SDP payload.

NOTIFY sip:5555551212@192.168.200.3 SIP/2.0
Via: SIP/2.0/UDP 192.168.200.2:5060;branch=z9hG4bK0badbc35;rport
From: "asterisk" <sip:asterisk@domain.com>;tag=as734e7c2f
To: <sip:5555551212@192.168.200.3>
Contact: <sip:asterisk@192.168.200.2>
Call-ID: 1e26aa38597700413010de2f252c9d99@domain.com
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX
Max-Forwards: 70
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 97

Messages-Waiting: yes
Message-Account: sip:asterisk@domain.com
Voice-Message: 1/2 (0/0)


SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.200.2:5060;branch=z9hG4bK0badbc35;rport
From: "asterisk" <sip:asterisk@domain.com>;tag=as734e7c2f
To: <sip:5555551212@192.168.200.3>;tag=17E7A1DE-3AF553EF
CSeq: 102 NOTIFY
Call-ID: 1e26aa38597700413010de2f252c9d99@domain.com
Contact: <sip:5555551212@192.168.200.3>
Event: message-summary
User-Agent: PolycomSoundPointIP-SPIP_320-UA/2.1.2.0049
Content-Length: 0

I have dug into the SIP channel driver a bit, and the method which is called to send send NOTIFY message is:

static int transmit_notify_with_mwi(struct sip_pvt *p, int newmsgs, int oldmsgs, char *vmexten)

I would think you have two options here:

1 - you poke around in the SIP channel code enough to figure out how to write your own dialplan Application to send MWI messages to a sip extension.

2 - you roll your own SIP stack and just send the NOTIFY to the SIP UA from some higher level application.

You cannot, as far as I can see set the MWI counts, within asterisk because the count is issued on-the-fly by the vm module. To replace this you’d need to write a new vm app in C as a module, I think.

However I do see a potential workaround. If you config & maintan the config for the native vm mailboxes and then get your vm app to add / remove the Message Information files the system uses then * will think it has messages and act accordingly. The Message Information file names are of the form: -

/var/spool/asterisk/voicemail/CONTEXT/MBXID/INBOX/msgNNNN.txt

eg.

/var/spool/asterisk/voicemail/default/300/INBOX/msg0000.txt

Contents of the files should be easy to duplicate using a ntively generated file as an example.

Is this any help to you?

I don’t think simply modifying the underlying filesystem will cause asterisk to send the SIP NOTIFY message… which is the heart of our problem here. I could be wrong.

I actually moved on and left the MWI unresolved.

I was however able to send a “TEXT MESSAGE” once I upgraded the firmware on the Linksys SPA.

Since the Asterisk VM works well with the MWI, I suspect the best way to get the MWI as one poster suggested is to “Fake” a message in the Linux Sub-Directory and remove it to turn the light On or Off.

Good Luck,

Dave

Hi

I assume the sets you want to light the light on are connected to your asterisk. If you use the standard voicemail file structure asterisk will recognie there is a message in there and light the light.

I use this method for catalog request lines where users are asked multiple questions then the completed message is put into a mailbox . from then on its treated like a normal message. lights message count datestamp etc work as normal
PM me if you want more details.

Ian

So asterisk does scan the voicemail directory structure for changes? that’s pretty cool… did not know that. I can actually use that in one of my applications.

Yes it does. In fact the file system IS it’s data store, it does not maintain a separate one in a DB ore anything. Every time a device (SIP, Zap, DAHDI etc.) comes round for an MWI notify event, the query goes to the VM module which then checks the dirs.

So that means you can ‘legally’ manipulate the dir contents outside *. I think this is actually intended than just a useful side effect.

Hi

It works well, you do have to set the msgXXXX.txt contensts correctly and increment them. ALso pay attention to what you have set as the maximum number of messages.

And AFAIK the email notification isnt triggered. But this is easily solved by the script doing it when its creating the .txt file.

Ian

cool… thanks for the info. much appreciated.

I have a solution that works great for me. it uses an auto attendant so the external VM can leave an indication for the users, and when the user calls back to the VM it also clears the indication. Very simple, and the email notification works as well.

I use it for Meridian mail and also Audix VM systems.

I don’t have the files available at this time, will have Monday morning.
Let me know if you want me to post them!