Summary:ASTERISK-18042: [patch] information from unsolicited MWI is lost during asterisk restart; cache to ast_db to avoid this
Reporter:Kai Hoerner (kaii)Labels:patch
Date Opened:2011-06-20 11:58:01Date Closed:
Versions:SVN 1.8.3 1.8.4 13.18.4 Frequency of
Environment:Asterisk 1.8.x / trunk inter-operating with Exchange 2010 UM for VoicemailAttachments:( 0) asterisk-trunk-r324236-sip-unsolicited_MWI-cached_v1.patch
Description:Asterisk can receive unsolicited MWI and store that in a virtual mailbox.

* With the patch from ASTERISK-17362 asterisk is also able to parse that unsolicited MWI notify and break it down to multiple virtual mailboxes. this is half the work to get Exchange Voicemail working.
Without this patch, all MWI are stored in the same single "virtual" mailbox.

* In the patch (v2) from ASTERISK-17997 a bugfix / regression is included, that makes the information from the cached unsolicited MWI available on initial subscribe.
Without this patch, the answer to an initial SUBSCRIBE for a unsolicited mailbox always results in a 0/0 mwi NOTIFY to the subscriber. Only when a new unsolicited MWI NOTIFY was received, that one was passed correctly to the end user device.

The attached patch here combines both patches above (credits to [~rsw686] and [~cgoudie]) and enhances the unsolicited MWI feature by caching the several virtual mailboxes in the ast_db storage. It will make the MWI content of external (unsolicited, e.g. Exchange 2010 UM) mailboxes available after restart.
When asterisk receives a SUBSCRIBE for MWI from a sip friend, and there is neither a cached MWI nor a local mailbox with the requested name, it tries to look it up in the SIP/unsolicited_MWI_cache namespace and loads the values from the ast_db into the event cache.

I have tested this patch with Exchange 2010 UM, asterisk-1.8.3-rc2 and ported it to the current SVN trunk.
In all scenarios i now have the correct information from exchange on my phones:
- when the MWI is updated from the exchange by receiving a unsolicited MWI NOTIFY  (core feature, enhanced by ASTERISK-17362)
- when restarting asterisk  (ast_db caching enhancement)
- when restarting the phone  (initial subscribe fix)

When needed, i can also port this patch to

My sip.conf looks basically like this:


mailbox=200@exchangeVM   ; (200 is the UM address/tel-uri of the mailbox user)