[Home]

Summary:ASTERISK-14000: [patch] Greetings are stored as IMAP messages even when imapgreetings=no
Reporter:Noah Miller (noahisaac)Labels:
Date Opened:2009-04-22 14:49:52Date Closed:2009-08-24 12:08:06
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail/IMAP
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 14950.patch
Description:When using IMAP voicemail storage, every time greetings are recorded, they are stored as IMAP messages, even when imapgreetings is set to 'no' in voicemail.conf.

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

Record any greeting (unavailable, busy, temporary) or your name in VoicemailMain().

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

In 1.6.2.X, before the greetings are stored, there's a check to see if the system is using IMAP voicemail, and if it is, they're not stored as files.  It looks like this:

#ifndef IMAP_STORAGE
   STORE(recordfile, vmu->mailbox, vmu->context, -1, chan, vmu, fmt, *duration, vms, flag);
   DISPOSE(recordfile, -1);
#endif


This is good, but I think this precludes storing greetings as IMAP messages.  Instead, I think we need to modify the target of the STORAGE() macro - imap_store_file() - to detect if we're storing greetings as IMAP messages or not.
Comments:By: Noah Miller (noahisaac) 2009-04-22 14:52:52

Woops - I took the revision number form the wrong system.  It should be: 186621

By: Noah Miller (noahisaac) 2009-04-24 15:35:30

Woops again!  The additional information section should read more like this:

In 1.6.2.X, before the greetings are stored, there's a check to see if the system is not using IMAP voicemail, and if it isn't, the recorded file is stored and then disposed of. It looks like this:

#ifndef IMAP_STORAGE
   STORE(recordfile, vmu->mailbox, vmu->context, -1, chan, vmu, fmt, *duration, vms, flag);
   DISPOSE(recordfile, -1);
#endif

This fixes the problem of greetings being stored as IMAP messages when they should be stored as files, but I think this precludes storing greetings as IMAP messages. Instead, I think we need to modify the target of the STORAGE() macro - imap_store_file() - to detect if we're storing greetings as IMAP messages or not.

By: Mark Michelson (mmichelson) 2009-05-27 16:56:13

Good idea, noahisaac. I changed the imap_store_file function to immediately return if the message we are attempting to store is a greeting and the imapgreetings option is not enabled.

The DISPOSE macro target (imap_remove_file) appears to already take this into consideration and will not delete the corresponding file on the file system if imapgreetings are not enabled.

Please try applying 14950.patch and see if this fixes the issue. Thanks for reporting!

By: Leif Madsen (lmadsen) 2009-08-17 10:28:14

I may be getting a different error here (or maybe it is the same?) but when I have imapgreeting=yes, then I record a greeting, it is recorded to the /var/spool/asterisk/voicemail/.../ directory, and then it is available the first time it is played, but then the 2nd time, it is removed from that directory, but isn't played (thus it must be not moved to the IMAP correctly).

I'm gonna test the imapgreeting=no, and then try applying this patch and see if it fixes anything for me here in my testing.

By: Leif Madsen (lmadsen) 2009-08-17 10:32:05

Actually, looking a the patch this probably isn't gonna do anything for the issue I just saw. I'm going to open a new issue I think, and just relate it to this one. Thanks!

By: Digium Subversion (svnbot) 2009-08-24 11:44:34

Repository: asterisk
Revision: 213833

U   trunk/apps/app_voicemail.c

------------------------------------------------------------------------
r213833 | jpeeler | 2009-08-24 11:44:34 -0500 (Mon, 24 Aug 2009) | 14 lines

Fix storage of greetings when using IMAP_STORAGE

The store macro was not getting called preventing storage of IMAP greetings
at all. This has been corrected along with fixing checking if the
imapgreetings option is turned on to store the greeting in IMAP. Lastly,
the attachment filename was incorrectly using the full path instead of just
the basename, which was causing problems with retrieval of the greeting.

(closes issue ASTERISK-14000)
Reported by: noahisaac

(closes issue ASTERISK-14666)
Reported by: lmadsen

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

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

By: Digium Subversion (svnbot) 2009-08-24 11:49:38

Repository: asterisk
Revision: 213835

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

------------------------------------------------------------------------
r213835 | jpeeler | 2009-08-24 11:49:38 -0500 (Mon, 24 Aug 2009) | 21 lines

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

........
 r213833 | jpeeler | 2009-08-24 11:43:57 -0500 (Mon, 24 Aug 2009) | 14 lines
 
 Fix storage of greetings when using IMAP_STORAGE
 
 The store macro was not getting called preventing storage of IMAP greetings
 at all. This has been corrected along with fixing checking if the
 imapgreetings option is turned on to store the greeting in IMAP. Lastly,
 the attachment filename was incorrectly using the full path instead of just
 the basename, which was causing problems with retrieval of the greeting.
 
 (closes issue ASTERISK-14000)
 Reported by: noahisaac
 
 (closes issue ASTERISK-14666)
 Reported by: lmadsen
........

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

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

By: Digium Subversion (svnbot) 2009-08-24 11:50:34

Repository: asterisk
Revision: 213836

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

------------------------------------------------------------------------
r213836 | jpeeler | 2009-08-24 11:50:34 -0500 (Mon, 24 Aug 2009) | 21 lines

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

........
 r213833 | jpeeler | 2009-08-24 11:43:57 -0500 (Mon, 24 Aug 2009) | 14 lines
 
 Fix storage of greetings when using IMAP_STORAGE
 
 The store macro was not getting called preventing storage of IMAP greetings
 at all. This has been corrected along with fixing checking if the
 imapgreetings option is turned on to store the greeting in IMAP. Lastly,
 the attachment filename was incorrectly using the full path instead of just
 the basename, which was causing problems with retrieval of the greeting.
 
 (closes issue ASTERISK-14000)
 Reported by: noahisaac
 
 (closes issue ASTERISK-14666)
 Reported by: lmadsen
........

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

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

By: Digium Subversion (svnbot) 2009-08-24 12:08:05

Repository: asterisk
Revision: 213837

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

------------------------------------------------------------------------
r213837 | jpeeler | 2009-08-24 12:08:05 -0500 (Mon, 24 Aug 2009) | 17 lines

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

........
 r213833 | jpeeler | 2009-08-24 11:43:57 -0500 (Mon, 24 Aug 2009) | 14 lines
 
 Fix storage of greetings when using IMAP_STORAGE
 
 Fix checking if the imapgreetings option is turned on to store the greeting
 in IMAP.
 
 (closes issue ASTERISK-14000)
 Reported by: noahisaac
 Patches:
     14950.patch uploaded by mmichelson (license 60)
........

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

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