[Home]

Summary:ASTERISK-13763: When using IMAP voicemail storage, you cannot retrieve messages by logging into VoicemailMain()
Reporter:Jeff Phelps (blargman)Labels:
Date Opened:2009-03-17 09:51:59Date Closed:2009-04-03 09:34:04
Priority:BlockerRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 14685.patch
( 1) ast-debug-2009-03-17.txt
( 2) gdb-2009-03-17.txt
( 3) prtscn.bmp
Description:I can not get MWI working on 1.6.1.0-rc2.

I am using IMAP Storage, and no matter what, * does not report that I have voicemail.  No new and no old.  Even if I have 20 old voicemails and 5 new, it will say I have no messages at all.

****** STEPS TO REPRODUCE ******

- Leave message
- MWI lights up on phone and Voicemail shows up in email
- Call voicemail
- Voicemail indicates that there are no messages in my mailbox
- Hangup and MWI goes off
- Voicemail is still in email and status is still unread.

Also, here is another scenario:

- Leave message
- MWI lights up on phone and Voicemail shows up in email
- Read email
- MWI goes off
- Call voicemail which indicates that I have no messages

****** ADDITIONAL INFORMATION ******

I did a straight upgrade from 1.6.1-rc1 to 1.6.1.0-rc2, with no config changes or anything, and MWI with the IMAP storage appears to have broken.

I will be attaching debug files shortly.
Comments:By: Jeff Phelps (blargman) 2009-03-17 09:59:42

added a backtrace of a crash that happened, which could be related to bug 14492

By: Jeff Phelps (blargman) 2009-03-17 10:20:46

added the output from the console debug...  there sure is an awful lot of lock -> unlok -> trying going on just to leave a voicemail...  hmmm...

By: Jeff Phelps (blargman) 2009-03-17 11:06:33

getting

[Mar 17 10:56:12] WARNING[9524]: app_voicemail.c:2715 check_quota: Mailstream not available for mailbox: Voicemail

anytime voicemail is accessed or left...  The voicemail's are being placed into the IMAP folder correctly, but * is not counting them, or recognizing when they are fetched or expunged...

also getting:

[Mar 17 10:43:43] WARNING[9503]: app_voicemail.c:3686 base_encode: Failed to open file: /var/spool/asterisk/voicemail/default/1688/INBOX.WAV: No such file or directory

By: Jeff Phelps (blargman) 2009-03-17 11:26:35

added a PrintScreen showing that the count is getting some weird numbers as well...

By: George Qualley IV (qualleyiv) 2009-03-19 14:27:37

I'm getting the MWI and messages are being delivered to my email as they should, but all mailboxes report that there are no messages in the mailbox if I use comedian mail. I'm going to go out on a limb here and say that this is related.

Same scenario here - worked under 1.6.0.1-rc1. Not working under 1.6.0.1-rc2



By: Leif Madsen (lmadsen) 2009-03-19 15:16:25

OK, I had run into the same issues previously, but have since resolved them. I don't know exactly what I did yet, so when I figure that part out, I'll report back.

By: Jeff Phelps (blargman) 2009-03-20 16:36:12

Update...

This may be resolved by upgrading to 1.6.1.0-rc3...

Will do more extensive testing, and report back...

By: George Qualley IV (qualleyiv) 2009-03-22 14:05:05

1.6.1.0-rc3 doesn't seem to change it for me. Just to be clear, I just left myself a message and here is the scenario:

- Leave message
- MWI lights up on phone and Voicemail shows up in email
- Call voicemail
- Voicemail indicates that there are no messages in my mailbox
- Hangup and MWI goes off
- Voicemail is still in email and status is still unread.

Also, here is another scenario:

- Leave message
- MWI lights up on phone and Voicemail shows up in email
- Read email
- MWI goes off
- Call voicemail which indicates that I have no messages

I checked the console and the only message that I'm getting when I'm checking voicemail is:

[Mar 22 14:03:24] WARNING[15707]: app_voicemail.c:2319 mm_log: IMAP Warning: Kerberos error: No credentials cache found (try running kinit) for XXX.XXX.com

However, I've gotten that error regularly in the past and it never caused this problem before.

Oh, and as far as my configuration information, my * box is a Dell server running Debian (Lenny) and the mail server is an X Serve running OS X Server 10.5.6.

UPDATE: I eliminated the Kerberos error by getting kerberos working (just to be sure) and I'm still having the same issue.



By: Jeff Phelps (blargman) 2009-03-23 09:10:37

ok...

Just verified that I am having the same exact scenario as qualleyiv.  I have this in both 1.6.1.0-rc3 and 1.6.2.0-beta1...

It appears that 'voicemail show users' reports the correct number of new messages, and app_voicemail appears to be processing the FETCH and EXPUNGE requests properly, you just can't check the messages on the phone like you could previously in 1.6.1-rc1...

I don't and have never had the Kerberos errors, so I know that is not a factor...



By: Leif Madsen (lmadsen) 2009-03-27 12:26:38

OK, I have also reproduced the error here, and will acknowledge the issue. I have gotten it with the 1.6.0 branch as of yesterday, so this appears to be an issue with IMAP in the 1.6.x branches all around.

By: Leif Madsen (lmadsen) 2009-03-27 12:27:11

Status changed to Acknowledged as I have reproduced the error.

By: Mark Michelson (mmichelson) 2009-04-02 11:46:39

I have also now reproduced this and am working on fixing this.

By: Mark Michelson (mmichelson) 2009-04-02 11:59:37

Based on a cursory look at the code, the biggest difference I'm seeing between the working and non-working versions is that there were some changes made to use some thread-local storage for voice mail states when using VoiceMailMain. These changes were made to fix a crash, but it appears that this may have also triggered this issue, too.

By: Mark Michelson (mmichelson) 2009-04-02 15:11:51

I have confirmed that this problem was caused by a side effect of the thread-local storage conversion. I now know what area to target and will have a fix ready as soon as I can.

By: Mark Michelson (mmichelson) 2009-04-02 15:33:40

I have uploaded 14865.patch which has solved the problem for me locally. I'm now going to assign this issue to lmadsen for testing. BlargMaN, feel free to also test if you would like. I'd love to hear if this is working for you, too.

By: George Qualley IV (qualleyiv) 2009-04-02 22:33:07

I have applied the patch and voicemail is working as normal. Thanks for the help!

By: Mark Michelson (mmichelson) 2009-04-03 09:22:02

Thanks for the feedback, qualleyiv. I really just needed at least one other person to confirm that this worked for him, since I was confident that my patch would work properly.

BlargMaN, I talked with you on IRC yesterday about this issue. I think that with both me and qualleyiv showing that things work properly, I'm ready to commit this. If you should find that this issue still exists, you can feel free to re-open the issue.

By: Digium Subversion (svnbot) 2009-04-03 09:32:08

Repository: asterisk
Revision: 186286

U   trunk/apps/app_voicemail.c

------------------------------------------------------------------------
r186286 | mmichelson | 2009-04-03 09:32:06 -0500 (Fri, 03 Apr 2009) | 20 lines

Fix the ability to retrieve voicemail messages from IMAP.

A recent change made interactive vm_states no longer get
added to the list of vm_states and instead get stored in
thread-local storage.

In trunk and all the 1.6.X branches, the problem is that
when we search for messages in a voicemail box, we would
attempt to update the appropriate vm_state struct by directly
searching in the list of vm_states instead of using the
get_vm_state_by_imap_user function. This meant we could not
find the interactive vm_state that we wanted.

(closes issue ASTERISK-13763)
Reported by: BlargMaN
Patches:
     14685.patch uploaded by mmichelson (license 60)
Tested by: BlargMaN, qualleyiv, mmichelson


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=186286

By: Digium Subversion (svnbot) 2009-04-03 09:32:38

Repository: asterisk
Revision: 186287

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_voicemail.c

------------------------------------------------------------------------
r186287 | mmichelson | 2009-04-03 09:32:38 -0500 (Fri, 03 Apr 2009) | 26 lines

Merged revisions 186286 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r186286 | mmichelson | 2009-04-03 09:32:05 -0500 (Fri, 03 Apr 2009) | 20 lines
 
 Fix the ability to retrieve voicemail messages from IMAP.
 
 A recent change made interactive vm_states no longer get
 added to the list of vm_states and instead get stored in
 thread-local storage.
 
 In trunk and all the 1.6.X branches, the problem is that
 when we search for messages in a voicemail box, we would
 attempt to update the appropriate vm_state struct by directly
 searching in the list of vm_states instead of using the
 get_vm_state_by_imap_user function. This meant we could not
 find the interactive vm_state that we wanted.
 
 (closes issue ASTERISK-13763)
 Reported by: BlargMaN
 Patches:
       14685.patch uploaded by mmichelson (license 60)
 Tested by: BlargMaN, qualleyiv, mmichelson
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=186287

By: Digium Subversion (svnbot) 2009-04-03 09:33:43

Repository: asterisk
Revision: 186288

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_voicemail.c

------------------------------------------------------------------------
r186288 | mmichelson | 2009-04-03 09:33:42 -0500 (Fri, 03 Apr 2009) | 26 lines

Merged revisions 186286 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r186286 | mmichelson | 2009-04-03 09:32:05 -0500 (Fri, 03 Apr 2009) | 20 lines
 
 Fix the ability to retrieve voicemail messages from IMAP.
 
 A recent change made interactive vm_states no longer get
 added to the list of vm_states and instead get stored in
 thread-local storage.
 
 In trunk and all the 1.6.X branches, the problem is that
 when we search for messages in a voicemail box, we would
 attempt to update the appropriate vm_state struct by directly
 searching in the list of vm_states instead of using the
 get_vm_state_by_imap_user function. This meant we could not
 find the interactive vm_state that we wanted.
 
 (closes issue ASTERISK-13763)
 Reported by: BlargMaN
 Patches:
       14685.patch uploaded by mmichelson (license 60)
 Tested by: BlargMaN, qualleyiv, mmichelson
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=186288

By: Digium Subversion (svnbot) 2009-04-03 09:34:03

Repository: asterisk
Revision: 186289

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_voicemail.c

------------------------------------------------------------------------
r186289 | mmichelson | 2009-04-03 09:34:03 -0500 (Fri, 03 Apr 2009) | 26 lines

Merged revisions 186286 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r186286 | mmichelson | 2009-04-03 09:32:05 -0500 (Fri, 03 Apr 2009) | 20 lines
 
 Fix the ability to retrieve voicemail messages from IMAP.
 
 A recent change made interactive vm_states no longer get
 added to the list of vm_states and instead get stored in
 thread-local storage.
 
 In trunk and all the 1.6.X branches, the problem is that
 when we search for messages in a voicemail box, we would
 attempt to update the appropriate vm_state struct by directly
 searching in the list of vm_states instead of using the
 get_vm_state_by_imap_user function. This meant we could not
 find the interactive vm_state that we wanted.
 
 (closes issue ASTERISK-13763)
 Reported by: BlargMaN
 Patches:
       14685.patch uploaded by mmichelson (license 60)
 Tested by: BlargMaN, qualleyiv, mmichelson
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=186289