[asterisk-commits] mmichelson: branch mmichelson/imap_consistency r129571 - /team/mmichelson/ima...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 10 11:17:08 CDT 2008


Author: mmichelson
Date: Thu Jul 10 11:17:07 2008
New Revision: 129571

URL: http://svn.digium.com/view/asterisk?view=rev&rev=129571
Log:
Make the remove_file function available when using IMAP storage. This 
probably has broken the build for file-storage voicemail, but that can and
will be corrected.

Next up: Audit to make sure that the vms->msgArray is actually populated
properly at the time that imap_retrieve_file is called. Then modify
imap_retrieve_file to ignore greeting retrieval requests.


Modified:
    team/mmichelson/imap_consistency/apps/app_voicemail.c

Modified: team/mmichelson/imap_consistency/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/imap_consistency/apps/app_voicemail.c?view=diff&rev=129571&r1=129570&r2=129571
==============================================================================
--- team/mmichelson/imap_consistency/apps/app_voicemail.c (original)
+++ team/mmichelson/imap_consistency/apps/app_voicemail.c Thu Jul 10 11:17:07 2008
@@ -412,7 +412,7 @@
 #else
 #ifdef IMAP_STORAGE
 #define RETRIEVE(a,b,c) imap_retrieve_file(a,b,c)
-#define DISPOSE(a,b)
+#define DISPOSE(a,b) remove_file(a,b)
 #define STORE(a,b,c,d,e,f,g,h,i) (imap_store_file(a,b,c,d,e,f,g,h,i))
 #define EXISTS(a,b,c,d) (ast_fileexists(c,NULL,d) > 0)
 #define RENAME(a,b,c,d,e,f,g,h) (rename_file(g,h));
@@ -1171,23 +1171,6 @@
 	return x - 1;
 }
 
-static int remove_file(char *dir, int msgnum)
-{
-	char fn[PATH_MAX];
-	char full_fn[PATH_MAX];
-	char msgnums[80];
-	
-	if (msgnum > -1) {
-		snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
-		make_file(fn, sizeof(fn), dir, msgnum);
-	} else
-		ast_copy_string(fn, dir, sizeof(fn));
-	ast_filedelete(fn, NULL);	
-	snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
-	unlink(full_fn);
-	return 0;
-}
-
 static int last_message_index(struct ast_vm_user *vmu, char *dir)
 {
 	int x = 0;
@@ -1571,6 +1554,23 @@
 }
 #endif
 #endif
+
+static int remove_file(char *dir, int msgnum)
+{
+	char fn[PATH_MAX];
+	char full_fn[PATH_MAX];
+	char msgnums[80];
+	
+	if (msgnum > -1) {
+		snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
+		make_file(fn, sizeof(fn), dir, msgnum);
+	} else
+		ast_copy_string(fn, dir, sizeof(fn));
+	ast_filedelete(fn, NULL);	
+	snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
+	unlink(full_fn);
+	return 0;
+}
 
 static int copy(char *infile, char *outfile)
 {




More information about the asterisk-commits mailing list