Summary:ASTERISK-12676: Mailbox greetings not working w/IMAP
Reporter:Mike Thomas (mthomasslo)Labels:
Date Opened:2008-09-02 21:01:34Date Closed:2008-09-05 11:26:51
Versions:Frequency of
Environment:Attachments:( 0) 13414.patch
( 1) 13414v2.patch
Description:The unavailable and busy greetings are not working.  I have only noticed this when using IMAP for messsage storage.  The system appears to be recording the greetings properly into the /var/spool/asterisk/voicemail/<context>/<mailbox>/ properly.  I can see the files unavail.tmp.gsm being created.  After completing the recording by pressing # I can choose option 2 to play the recording which is working properly.  When I choose 1 to save, I hear the prompt saying "Your message has been saved", at this point I see the file names change to remove the .tmp.  About 2 seconds later the files dissapear.  The next call to the mailbox hears the generic mailbox number greeting.
Comments:By: Leif Madsen (lmadsen) 2008-09-02 21:06:26

FYI: this is the third issue I've seen from you today that was set to severity of major which is actually a minor issue. When in doubt in the future, please set the severity to minor.


By: Mike Thomas (mthomasslo) 2008-09-03 11:16:09

Understood, I guess my definition of major is based on the old telecom standards wherein a feature that affects more than 10% of the subscribers is considered major, and when an important feature isn't working at all I'd consider it severe.  If I'm the only one experiencing the problem, then it's indeed minor, but if all deployments of this branch (using IMAP) have the same difficulty it might deserve a higher priority. At any rate I'll post future bugs like this as minor.

By: Mark Michelson (mmichelson) 2008-09-03 13:11:57

I have reproduced this myself and am working on a fix. Thanks for the detailed description!

By: Mark Michelson (mmichelson) 2008-09-03 13:29:34

13414.patch is now available for testing. It worked for me locally and I'd like confirmation that it works for you, too. Thanks!

By: Mike Thomas (mthomasslo) 2008-09-04 14:13:24

System was recompiled with the patched app_voicemail.c, but unfortunately the greeting files are still being deleted moments after being renamed.

By: Mark Michelson (mmichelson) 2008-09-04 14:19:58

Ah, I see what the problem is. I was looking much too narrowly at the problem. I only prevented the case of deleting a greeting when it is recorded. I found several other places where a greeting could get deleted when using IMAP storage. I'll upload a new patch soon.

By: Mark Michelson (mmichelson) 2008-09-04 14:21:03

I've uploaded 13414v2.patch for testing. It should cover any case where Asterisk attempts to delete a greeting when using IMAP storage.

By: Mike Thomas (mthomasslo) 2008-09-04 15:29:27

This patch seems to have corrected the problem with the greetings.  Howerver during testing I observed a problem I've had before.  When forwarding a message (without prepend) the sytem crashed with the logged mesage "ERROR[xxxxx} app.voicemail.c: IMAP access FATAL error: Unlock when not locked"  I restarted the system and It hasn't happened again, but it's only been a few minutes.

By: Mark Michelson (mmichelson) 2008-09-05 11:22:38

All right, I'm glad that the greetings problem is fixed. I'll commit the changes and close this bug as a result.

As far as the other issue goes, I've seen it a few times myself, and the problem is that I can't actually with any certainty say that it's an Asterisk bug. The message "Unlock when not locked" means that the c-client attempted to unlock a mutex which it did not lock to begin with. The mutex handling is done completely within the c-client, so it's not that Asterisk was expected to lock a mutex before calling a certain c-client function. Based on my thinking, the only way this can happen is if a certain code path in the c-client assumes that a lock is supposed to have been locked but it was not. This seems like a c-client issue and not an Asterisk issue. If anyone can point out how Asterisk could actually contribute towards such a failure, then I could work on trying to correct the problem myself.

By: Digium Subversion (svnbot) 2008-09-05 11:26:42

Repository: asterisk
Revision: 141267

U   branches/1.4/apps/app_voicemail.c

r141267 | mmichelson | 2008-09-05 11:26:41 -0500 (Fri, 05 Sep 2008) | 11 lines

Since greetings are not stored in IMAP, we should
not be DISPOSE'ing of them the same way we do with
other messages.

(closes issue ASTERISK-12676)
Reported by: mthomasslo
     13414v2.patch uploaded by putnopvut (license 60)
Tested by: mthomasslo