[Asterisk-Dev] Performance bottleneck in voicemail2 on nfsed huge mailboxes

asterisk at billheckel.com asterisk at billheckel.com
Sat Sep 27 20:17:42 MST 2003


There has been a long standing design flaw in voicemail that I have mentioned repeatedly.  If you 
are listening to your voicemail and another voicemail comes in it ends up orphaned until you get at 
least that many voicemails in your box.  I had looked into a simple patch to fix this before but it 
requires a fairly serious redesign of the numbering scheme.  All voicemail should have a unique ID 
that is globally unique and time based ( like unix milliseconds ) so that incoming voicemail is 
always in order.

If each mail is named using this and the voicemail listening section checks for the total number of 
existant files it will work but there is a bit of work to be done.  I had started to rewrite this 
but when voicemail2 was announced I assumed it would be corrected.

Bill


Steven Critchfield wrote:
> On Sat, 2003-09-27 at 10:33, Levent Guendogdu wrote:
> 
>>... another "workaround" just popped into my mind, which would be
>>simpler to implement IMHO:
>>
>>after playing the beep, record the voicemail audio to a (some) tmp
>>file(s), like 
>>
>>/tmp/<currentsystemtime>.gsm
>>
>>After hangup, look for the next msg num and save the meta file and
>>voicemail.
>>
>>Sounds good to me for a first step, if no one objects, I'll patch this.
> 
> 
> Or a more scalable method that would also help out for a project that
> Tilghman needs, just name the messages with the epoch of creation and
> maybe a md5 of the caller id. This would let you create the filename in
> a method that is sortable and pretty much guaranteed to be unique
> without consulting the filesystem first. This also should make the
> filenames unique enough to bounce from mailbox to mailbox without
> renaming. Also you could delete a message and still have the gap filled.
> BTW, if MySQL is the answer than you probably are asking the wrong
> question.
> 
> 
>>On Sat, 2003-09-27 at 17:20, Levent Guendogdu wrote:
>>
>>>Hi all,
>>>
>>>there is a performance bottleneck in the voicemail2 code where it
>>>determines the next message number for the voicemail by checking for
>>>filename existance. On my K6/400 * box, which serves only a few
>>>mailboxes, this takes up to two seconds. So, logically, because this
>>>occurs after the BEEP has already been played to the caller, the first
>>>two seconds of the message are being dropped.
>>>
>>>I've seen the addition of mysql support in voicemail2. How about storing
>>>the currenct msg num in mysql, too? 
>>>
>>>Or adding some sort of index file for a mail box which contains the last
>>>msg num.
>>>
>>>I see that, if you delete message in between, the current code would
>>>simply "fill the gap" by numbering the next incoming voicemail to the
>>>"first free" one. 
>>>
>>>To bring both worlds together I'd suggest switching to a voicemail
>>>message id instead of msg num.
>>>
>>>What do you people think?
>>>
>>>Levon.
>>>
>>>_______________________________________________
>>>Asterisk-Dev mailing list
>>>Asterisk-Dev at lists.digium.com
>>>http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>>_______________________________________________
>>Asterisk-Dev mailing list
>>Asterisk-Dev at lists.digium.com
>>http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list