[svn-commits] russell: branch russell/events r59292 - /team/russell/events/apps/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Mar 28 13:27:25 MST 2007


Author: russell
Date: Wed Mar 28 15:27:24 2007
New Revision: 59292

URL: http://svn.digium.com/view/asterisk?view=rev&rev=59292
Log:
Only generate MWI events if someone is subscribed to events for that mailbox

Modified:
    team/russell/events/apps/app_voicemail.c

Modified: team/russell/events/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_voicemail.c?view=diff&rev=59292&r1=59291&r2=59292
==============================================================================
--- team/russell/events/apps/app_voicemail.c (original)
+++ team/russell/events/apps/app_voicemail.c Wed Mar 28 15:27:24 2007
@@ -3938,7 +3938,7 @@
 	return cmd;
 }
 
-static void queue_mwi_event(const char *mbox, int new, int old, int with_sub_only)
+static void queue_mwi_event(const char *mbox, int new, int old)
 {
 	struct ast_event *event;
 	char *mailbox;
@@ -3948,7 +3948,7 @@
 	if (strstr(mailbox, "@default"))
 		mailbox = strsep(&mailbox, "@");
 
-	if (with_sub_only && ast_event_check_subscriber(AST_EVENT_MWI,
+	if (ast_event_check_subscriber(AST_EVENT_MWI,
 		AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
 		AST_EVENT_IE_END) == AST_EVENT_SUB_NONE) {
 		return;
@@ -4016,7 +4016,7 @@
 	if (ast_app_has_voicemail(ext_context, NULL)) 
 		ast_app_inboxcount(ext_context, &newmsgs, &oldmsgs);
 
-	queue_mwi_event(ext_context, newmsgs, oldmsgs, 1);
+	queue_mwi_event(ext_context, newmsgs, oldmsgs);
 
 	manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\nNew: %d\r\nOld: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs);
 	run_externnotify(vmu->context, vmu->mailbox);
@@ -6800,7 +6800,7 @@
 		manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s\r\nWaiting: %d\r\n", ext_context, has_voicemail(ext_context, NULL));
 		run_externnotify(vmu->context, vmu->mailbox);
 		ast_app_inboxcount(ext_context, &new, &old);
-		queue_mwi_event(ext_context, new, old, 1);
+		queue_mwi_event(ext_context, new, old);
 	}
 #ifdef IMAP_STORAGE
 	/* expunge message - use UID Expunge if supported on IMAP server*/
@@ -6965,7 +6965,7 @@
 	strcat(mailbox_full, context);
 
 	inboxcount(mailbox_full, &new, &old);
-	queue_mwi_event(mailbox_full, new, old, 0);
+	queue_mwi_event(mailbox_full, new, old);
 
 	return 0;
 }



More information about the svn-commits mailing list