[asterisk-commits] tilghman: branch 1.6.0 r224449 - in /branches/1.6.0: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 18 19:12:17 CDT 2009


Author: tilghman
Date: Sun Oct 18 19:12:13 2009
New Revision: 224449

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=224449
Log:
Merged revisions 224448 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r224448 | tilghman | 2009-10-18 19:05:56 -0500 (Sun, 18 Oct 2009) | 3 lines
  
  Allow ODBC storage to be queried with multiple mailboxes.
  This corrects an issue reported on the -users list.
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/apps/app_voicemail.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/apps/app_voicemail.c?view=diff&rev=224449&r1=224448&r2=224449
==============================================================================
--- branches/1.6.0/apps/app_voicemail.c (original)
+++ branches/1.6.0/apps/app_voicemail.c Sun Oct 18 19:12:13 2009
@@ -3976,7 +3976,6 @@
 }
 
 #ifdef ODBC_STORAGE
-/*! XXX \todo Fix this function to support multiple mailboxes in the intput string */
 static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
 {
 	int x = -1;
@@ -3999,7 +3998,24 @@
 		return 0;
 
 	ast_copy_string(tmp, mailbox, sizeof(tmp));
-	
+
+	if (strchr(mailbox, ',') || strchr(mailbox, ' ')) {
+		char *next, *remaining = tmp;
+		int n, o;
+		while ((next = strsep(&remaining, " ,"))) {
+			if (inboxcount(next, &n, &o)) {
+				return -1;
+			}
+			if (newmsgs) {
+				*newmsgs += n;
+			}
+			if (oldmsgs) {
+				*oldmsgs += o;
+			}
+		}
+		return 0;
+	}
+
 	context = strchr(tmp, '@');
 	if (context) {
 		*context = '\0';




More information about the asterisk-commits mailing list