[asterisk-commits] mmichelson: branch mmichelson/1.4-test r69595 - /team/mmichelson/1.4-test/apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 15 15:43:51 CDT 2007


Author: mmichelson
Date: Fri Jun 15 15:43:51 2007
New Revision: 69595

URL: http://svn.digium.com/view/asterisk?view=rev&rev=69595
Log:
Attempting to put greetings in a different folder than messages. This is an incomplete fix but should temporarily give
some indication if things are working like I'd expect.


Modified:
    team/mmichelson/1.4-test/apps/app_voicemail.c

Modified: team/mmichelson/1.4-test/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/1.4-test/apps/app_voicemail.c?view=diff&rev=69595&r1=69594&r2=69595
==============================================================================
--- team/mmichelson/1.4-test/apps/app_voicemail.c (original)
+++ team/mmichelson/1.4-test/apps/app_voicemail.c Fri Jun 15 15:43:51 2007
@@ -144,6 +144,7 @@
 };
 AST_MUTEX_DEFINE_STATIC(vmstate_lock);
 static struct vmstate *vmstates = NULL;
+#define GREETING_FOLDER		2
 #endif
 
 #define SMDI_MWI_WAIT_TIMEOUT 1000 /* 1 second */
@@ -2445,7 +2446,10 @@
 		((char *)buf)[len] = '\0';
 		INIT(&str, mail_string, buf, len);
 		init_mailstream(vms, 0);
-		imap_mailbox_name(mailbox, vms, 0, 1);
+		if (msgnum > -1)
+			imap_mailbox_name(mailbox, vms, 0, 1);
+		else
+			imap_mailbox_name(mailbox, vms, GREETING_FOLDER, 1);
 		if(!mail_append(vms->mailstream, mailbox, &str))
 			ast_log(LOG_ERROR, "Error while sending the message to %s\n", mailbox);
 		fclose(p);
@@ -4677,6 +4681,8 @@
 
 	if(box == 0 || box == 1)
 		sprintf(spec, "%s%s", tmp, use_folder? imapfolder: "INBOX");
+	else if ( box == GREETING_FOLDER)
+		sprintf(spec, "%s%s", tmp, "greetings");
 	else
 		sprintf(spec, "%s%s%c%s", tmp, imapfolder, delimiter, mbox(box));
 }
@@ -4947,7 +4953,7 @@
 			ast_log (LOG_DEBUG, "Poised to delete message number %d\n", i+1);
 			sprintf (arg,"%lu", i+1);
 			mail_setflag (vms->mailstream,arg,"\\DELETED");
-			mail_expunged(vms->mailstream, i+1);
+			mail_expunge_full(vms->mailstream, NIL, EX_UID);
 			return 0;
 		}
 	}	




More information about the asterisk-commits mailing list