Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 286645) +++ channels/chan_sip.c (working copy) @@ -16850,7 +16850,8 @@ return 0; /* Check for messages */ - ast_app_inboxcount(peer->mailbox, &newmsgs, &oldmsgs); + if (ast_app_inboxcount(peer->mailbox, &newmsgs, &oldmsgs) == -1) + return 0; peer->lastmsgcheck = time(NULL); Index: main/app.c =================================================================== --- main/app.c (revision 286645) +++ main/app.c (working copy) @@ -194,7 +194,7 @@ ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s but voicemail not loaded.\n", mailbox); } - return 0; + return -1; } int ast_app_messagecount(const char *context, const char *mailbox, const char *folder)