[Asterisk-cvs] asterisk app.c,1.38,1.39

markster at lists.digium.com markster at lists.digium.com
Tue Jan 4 14:49:32 CST 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv13098

Modified Files:
	app.c 
Log Message:
Only print message one time (bug #3240)


Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- app.c	31 Dec 2004 01:11:33 -0000	1.38
+++ app.c	4 Jan 2005 20:54:36 -0000	1.39
@@ -168,18 +168,21 @@
 
 int ast_app_has_voicemail(const char *mailbox, const char *folder)
 {
+	static int warned = 0;
 	if (ast_has_voicemail_func)
 		return ast_has_voicemail_func(mailbox, folder);
 
-        if (option_verbose > 2)
-                ast_verbose(VERBOSE_PREFIX_3 "Message check requested for mailbox %s/folder %s but voicemail not loaded.", mailbox, folder);
-
+	if ((option_verbose > 2) && !warned) {
+		ast_verbose(VERBOSE_PREFIX_3 "Message check requested for mailbox %s/folder %s but voicemail not loaded.", mailbox, folder ? folder : "INBOX");
+		warned++;
+	}
 	return 0;
 }
 
 
 int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
 {
+	static int warned = 0;
 	if (newmsgs)
 		*newmsgs = 0;
 	if (oldmsgs)
@@ -187,8 +190,10 @@
 	if (ast_messagecount_func)
 		return ast_messagecount_func(mailbox, newmsgs, oldmsgs);
 
-        if (option_verbose > 2)
-                ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s but voicemail not loaded.", mailbox);
+	if (!warned && (option_verbose > 2)) {
+		warned++;
+		ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s but voicemail not loaded.", mailbox);
+	}
 
 	return 0;
 }




More information about the svn-commits mailing list