[asterisk-commits] jrose: trunk r320178 - in /trunk: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 20 13:30:11 CDT 2011


Author: jrose
Date: Fri May 20 13:29:59 2011
New Revision: 320178

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320178
Log:
Merged revisions 320162 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r320162 | jrose | 2011-05-20 13:12:21 -0500 (Fri, 20 May 2011) | 15 lines
  
  Fixes an imapfolder related crash
  
  imapfolders being set in the general section of voicemail would cause the inbox folder name to
  change.  Since sound file names are made based on the names of the folders, this would cause
  the audio related to that folder name to change and if Asterisk attempted to play it, the
  channel would instantly hang up when the audio file couldn't be found.  This patch searches for
  the name of the folder first to leave existing behavior in tact and if that fails, it uses
  the normal inbox name to get the sound file instead.
  
  
  (closes issue #16104)
  Reported by: blkline
  
  Review: https://reviewboard.asterisk.org/r/1215/
........

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=320178&r1=320177&r2=320178
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri May 20 13:29:59 2011
@@ -6698,7 +6698,21 @@
 		if (d)
 			return d;
 		snprintf(fn, sizeof(fn), "vm-%s", mbox(NULL, x));	/* Folder name */
-		d = vm_play_folder_name(chan, fn);
+
+		/* The inbox folder can have its name changed under certain conditions
+		 * so this checks if the sound file exists for the inbox folder name and
+		 * if it doesn't, plays the default name instead. */
+		if (x == 0) {
+			if (ast_fileexists(fn, NULL, NULL)) {
+				d = vm_play_folder_name(chan, fn);
+			} else {
+				ast_verb(1, "failed to find %s\n", fn);
+				d = vm_play_folder_name(chan, "vm-INBOX");
+			}
+		} else {
+			d = vm_play_folder_name(chan, fn);
+		}
+
 		if (d)
 			return d;
 		d = ast_waitfordigit(chan, 500);




More information about the asterisk-commits mailing list