[asterisk-dev] [Code Review] Switch public voicemail APIs over to use unique message IDs instead of message indexes.
Mark Michelson
reviewboard at asterisk.org
Tue Apr 24 11:46:53 CDT 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1883/
-----------------------------------------------------------
Review request for Asterisk Developers and Matt Jordan.
Summary
-------
Voicemail has some new public functions added to it in order to interoperate with Digium phones. These public functions give fine control over the ability to move, remove, forward, and play back messages. In the implementation in 1.8-digiumphones and 10-digiumphones, a message index is used to identify which message to operate on. This is potentially unreliable since mailboxes can be acted on by multiple sources. While the most likely result is that a user may try to manipulate a message that no longer exists, it is also possible that a user may end up manipulating an incorrect message instead. This could be disastrous depending on which wrong message is manipulated and how it is.
This patches the trunk version of app_voicemail to use unique message IDs instead of message indexes. It is not possible to manipulate the wrong message. The result of this is a performance decrease since there is more message retrieval from whatever storage is used, and there are more disk reads in order to check message IDs. A long-term goal would be to store message IDs in memory so that finding a message by its ID is not as expensive. However, this is a dark and treacherous road to go down and way beyond the scope of what needs to be done for now.
If there are additional changes that should be added with regards to the voicemail APIs, let me know.
Diffs
-----
/team/mmichelson/trunk-digiumphones/apps/app_voicemail.c 363307
/team/mmichelson/trunk-digiumphones/include/asterisk/app_voicemail.h 363307
/team/mmichelson/trunk-digiumphones/tests/test_voicemail_api.c 363307
Diff: https://reviewboard.asterisk.org/r/1883/diff
Testing
-------
As you'll see in this review, I have updated the unit tests in tests/test_voicemail_api.c. They all pass.
Thanks,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120424/bfee813d/attachment.htm>
More information about the asterisk-dev
mailing list