[Home]

Summary:ASTERISK-15292: [patch] Message forwarding with prepention does not backup original message and length as intended
Reporter:Tomo Takebe (tomo1657)Labels:
Date Opened:2009-12-08 11:33:47.000-0600Date Closed:2010-03-27 11:51:52
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) prepention.patch
Description:When a message is forwarded with prepention using file system storage, the prepended message portion is not removed from the original message in the sender's mailbox afterward.  Whether the forward operation is cancelled or completed does not matter.  The duration in the msgXXXX.txt file in the sender's message also keeps the prepended duration, even if the operation was cancelled and there was no forwarding to the recepient.  In certain cancel conditions (non-hangups), the original message is correctly restored but the msgXXXX.txt is not, and causes a discrepancy in actual duration and announced duration.

In IMAP storage there are no such issues; the original message stays the same without prepention, whether it is cancelled or sent.

The main issue seems to be that the backup message msgXXXX.bak is being created but is never restored properly after a cancel / hang up.  Upon a hangup or cancel, the attached patch will call ast_filerename(backup, msgfile, NULL) to restore the original backup file instead of calling ast_filedelete(backup,NULL) to delete it.  Also, when a forward succeeds, forward_message() is patched to restore the backup file in the original mailbox so that the prepention message is removed.

This alone does not restore the original message length in msgXXXX.txt, though.  This patch also adds new temp file msgXXXX.bak.txt that is created, removed, and restored along with the msgXXXX.bak.

I confirm this in asterisk-1.6.1.1, 1.6.1.2, 1.6.1.4, 1.6.1.11, 1.6.2-rc7, and svn-trunk. This patch has been necessary in our deployment to meet customer expectations.
Comments:By: Digium Subversion (svnbot) 2010-02-01 17:13:45.000-0600

Repository: asterisk
Revision: 244242

U   branches/1.4/apps/app_voicemail.c

------------------------------------------------------------------------
r244242 | tilghman | 2010-02-01 17:13:44 -0600 (Mon, 01 Feb 2010) | 11 lines

Backup and restore original textfile, for prosthesis (gerund of prepend).

Also, fix menuselect such that changing voicemail build options correctly
causes rebuild.

(closes issue ASTERISK-15292)
Reported by: tomo1657
Patches:
      prepention.patch uploaded by tomo1657 (license 484)
      (with modifications by me to backport to 1.4)

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

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

By: Digium Subversion (svnbot) 2010-02-01 17:16:13.000-0600

Repository: asterisk
Revision: 244243

_U  trunk/
U   trunk/apps/app_voicemail.c

------------------------------------------------------------------------
r244243 | tilghman | 2010-02-01 17:16:12 -0600 (Mon, 01 Feb 2010) | 18 lines

Merged revisions 244242 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r244242 | tilghman | 2010-02-01 17:13:44 -0600 (Mon, 01 Feb 2010) | 11 lines
 
 Backup and restore original textfile, for prosthesis (gerund of prepend).
 
 Also, fix menuselect such that changing voicemail build options correctly
 causes rebuild.
 
 (closes issue ASTERISK-15292)
  Reported by: tomo1657
  Patches:
        prepention.patch uploaded by tomo1657 (license 484)
        (with modifications by me to backport to 1.4)
........

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

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

By: Digium Subversion (svnbot) 2010-02-01 17:30:20.000-0600

Repository: asterisk
Revision: 244303

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

------------------------------------------------------------------------
r244303 | tilghman | 2010-02-01 17:30:20 -0600 (Mon, 01 Feb 2010) | 25 lines

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

................
 r244243 | tilghman | 2010-02-01 17:16:12 -0600 (Mon, 01 Feb 2010) | 18 lines
 
 Merged revisions 244242 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r244242 | tilghman | 2010-02-01 17:13:44 -0600 (Mon, 01 Feb 2010) | 11 lines
   
   Backup and restore original textfile, for prosthesis (gerund of prepend).
   
   Also, fix menuselect such that changing voicemail build options correctly
   causes rebuild.
   
   (closes issue ASTERISK-15292)
    Reported by: tomo1657
    Patches:
          prepention.patch uploaded by tomo1657 (license 484)
          (with modifications by me to backport to 1.4)
 ........
................

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

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

By: Digium Subversion (svnbot) 2010-02-01 17:31:05.000-0600

Repository: asterisk
Revision: 244307

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

------------------------------------------------------------------------
r244307 | tilghman | 2010-02-01 17:31:04 -0600 (Mon, 01 Feb 2010) | 25 lines

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

................
 r244243 | tilghman | 2010-02-01 17:16:12 -0600 (Mon, 01 Feb 2010) | 18 lines
 
 Merged revisions 244242 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r244242 | tilghman | 2010-02-01 17:13:44 -0600 (Mon, 01 Feb 2010) | 11 lines
   
   Backup and restore original textfile, for prosthesis (gerund of prepend).
   
   Also, fix menuselect such that changing voicemail build options correctly
   causes rebuild.
   
   (closes issue ASTERISK-15292)
    Reported by: tomo1657
    Patches:
          prepention.patch uploaded by tomo1657 (license 484)
          (with modifications by me to backport to 1.4)
 ........
................

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

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

By: Digium Subversion (svnbot) 2010-02-01 17:34:14.000-0600

Repository: asterisk
Revision: 244320

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

------------------------------------------------------------------------
r244320 | tilghman | 2010-02-01 17:34:13 -0600 (Mon, 01 Feb 2010) | 25 lines

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

................
 r244243 | tilghman | 2010-02-01 17:16:12 -0600 (Mon, 01 Feb 2010) | 18 lines
 
 Merged revisions 244242 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r244242 | tilghman | 2010-02-01 17:13:44 -0600 (Mon, 01 Feb 2010) | 11 lines
   
   Backup and restore original textfile, for prosthesis (gerund of prepend).
   
   Also, fix menuselect such that changing voicemail build options correctly
   causes rebuild.
   
   (closes issue ASTERISK-15292)
    Reported by: tomo1657
    Patches:
          prepention.patch uploaded by tomo1657 (license 484)
          (with modifications by me to backport to 1.4)
 ........
................

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

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