[asterisk-dev] [Code Review] app_voicemail: fix problem where we kill the msg_id of a message when changing its folder in odbc storage.

jrose reviewboard at asterisk.org
Mon Dec 3 11:22:34 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2220/
-----------------------------------------------------------

(Updated Dec. 3, 2012, 11:22 a.m.)


Review request for Asterisk Developers, Mark Michelson, Matt Jordan, and kmoore.


Changes
-------

Drop System name details from the msg_id. I talked about this with Matt and we came to the conclusion that this would be something better left for uuid support to solve. This does leave in the change from the change from using the hash to using the automatically incrementing value though for a couple reasons:

1 - COPY can happen to many voicemessages at a single time. This means that if a mailbox has two messages from the same person sent to the same extension recorded and the user happens to listen to both of them before hanging up, they will both be copied at the same time and if the original hashing function were used, they would very frequently end up with duplicate msg_ids.

2 - By using the new function, no information has to be read from the voicemail message being copied. Reading the msg_id field from the db requires a considerable amount of preparation and accounting for problems which would introduce a lot of extra activity into the COPY function which could likely cause problems.


Summary
-------

When a message is moved between folders (such as after listening to new messages, they are switched to the old messages folder), the msg_id field added in Asterisk 11 isn't copied. This patch simply adds that field to what is copied in the odbc COPY function and appears to solve the problem.


This addresses bug ASTERISK-20717.
    https://issues.asterisk.org/jira/browse/ASTERISK-20717


Diffs (updated)
-----

  /branches/11/apps/app_voicemail.c 376833 

Diff: https://reviewboard.asterisk.org/r/2220/diff


Testing
-------

Made messages in a mailbox using app_voicemail. Checked mysql to see the msg_id. Verified an ID was created.
Listened to messages, made sure the COPY function was invoked. Checked mysql again and saw that the IDs were gone.

Applied the patch, repeated the process, the IDs remained intact.


Thanks,

jrose

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121203/2fa89e5b/attachment.htm>


More information about the asterisk-dev mailing list