diff options
author | Mark Spencer <markster@digium.com> | 2005-01-04 20:54:36 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-01-04 20:54:36 +0000 |
commit | 88721d2e74cf074f7720a178aca0b82ab2d49625 (patch) | |
tree | 9a687adb1ef2973ad5709c5cb7e163ef16ae5d96 /app.c | |
parent | c9d317ba1a8c34656074e797e4381d6bf6871674 (diff) |
Only print message one time (bug #3240)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'app.c')
-rwxr-xr-x | app.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -168,18 +168,21 @@ void ast_uninstall_vm_functions(void) 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 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs) 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; } |