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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 15 14:00:26 CDT 2008


Author: mmichelson
Date: Tue Jul 15 14:00:26 2008
New Revision: 131076

URL: http://svn.digium.com/view/asterisk?view=rev&rev=131076
Log:
Progress. I had been experiencing crashes and the reason was
due to a perfectly valid assumption I had regarding the vm_state
retrieval functions.

For get_vm_state_by_imapuser, the "interactive" parameter may
be 0, 1, or 2. 2 means to not try to match based on the saved
vm_state's interactive field. For get_vm_state_by_mailbox, the
interactive parameter always is attempted to be matched with
the saved vm_state's interactive field. This means that passing
a 2 will never ever match. Stupid stupid inconsistency.


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=131076&r1=131075&r2=131076
==============================================================================
--- team/mmichelson/imap_consistency/apps/app_voicemail.c (original)
+++ team/mmichelson/imap_consistency/apps/app_voicemail.c Tue Jul 15 14:00:26 2008
@@ -1671,10 +1671,9 @@
 	}
 	
 	/* Before anything can happen, we need a vm_state so that we can
-	 * actually access the imap server
+	 * actually access the imap server through the vms->mailstream
 	 */
-	vms = get_vm_state_by_mailbox(vmu->mailbox, 2);
-	if (!vms) {
+	if(!(vms = get_vm_state_by_mailbox(vmu->mailbox, 0)) && !(vms = get_vm_state_by_mailbox(vmu->mailbox, 1))) {
 		/* This should not happen. If it does, then I guess we'd
 		 * need to create the vm_state, extract which mailbox to
 		 * open, and then set up the msgArray so that the correct
@@ -1682,6 +1681,7 @@
 		 * though, the vms should be obtainable from the vmstates list
 		 * and should have its msgArray properly set up.
 		 */
+		ast_log(LOG_ERROR, "Couldn't find a vm_state for mailbox %s!!! Oh no!\n", vmu->mailbox);
 	}
 
 	if (option_debug > 2)
@@ -1744,6 +1744,7 @@
 	fprintf(text_file_ptr, "duration=%s\n", S_OR(origtime, ""));
 	category = get_header_by_tag(header_content, "X-Asterisk-VM-Category:");
 	fprintf(text_file_ptr, "category=%s\n", S_OR(category, ""));
+	
 	fclose(text_file_ptr);
 	return 0;
 }




More information about the asterisk-commits mailing list