> Joshua Colp <mailto:jcolp at digium.com> > Wednesday, December 04, 2013 12:19 PM > > > What worries me about persisting this information is keeping it in > sync with the outside world. If a mailbox goes away externally and the > Asterisk instance is not running now the application has to do one of > the following: > > 1. Keep a log of this fact and then ensure it is removed from Asterisk > when it starts up > > 2. Destroy with hate any mailboxes it doesn't know about when Asterisk > starts up (what about other applications?) > > That seems like a lot of work, and potentially issue prone which > brings me to... > > Why are we persisting at all? Since this is completely externally > driven there's going to be a chance no matter what that the > information is stale. I would argue that not persisting and letting > the external application feed it back in is better. This gives you a > guarantee that the state is the same. > > Thoughts? > ------------------------------------------------------------------------ The basic scenario where persistence is desirable is when Asterisk has accumulated a bunch of MWI state, then restarts, then a device requests current MWI state for a mailbox. If mailbox state is not persisted, then Asterisk has to respond with incorrect state. If the MWI state is persisted, then Asterisk can respond with the latest known state. Regarding work required by the application, having state not be persisted is, in my opinion, more of a hassle. If Asterisk restarts, then the application needs to know that it happened and then retransmit all MWI state to Asterisk in order to repopulate Asterisk's cache. If state is persisted, then the only state that needs to be retransmitted by the application is whatever couldn't previously have been delivered during the downtime. Regarding the mailbox destruction scenario, the application is going to have to create a backlog of updates to send at any point when Asterisk is down, whether those updates are changes to MWI state or creation or destruction of said state. I don't think that removing persistence will have any effect on this. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20131204/122986ad/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: compose-unknown-contact.jpg Type: image/jpeg Size: 770 bytes Desc: not available URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20131204/122986ad/attachment.jpg>