Missing quote in ODBC query.
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 5 Mar 2010 04:37:36 +0000 (04:37 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 5 Mar 2010 04:37:36 +0000 (04:37 +0000)
(closes issue #16953)
 Reported by: elguero
 Patches:
       app_voicemail-odbc-syntax-fix.diff uploaded by elguero (license 37)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250913 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index c146fe1..b21c0e1 100644 (file)
@@ -4973,7 +4973,7 @@ static int messagecount(const char *context, const char *mailbox, const char *fo
        obj = ast_odbc_request_obj(odbc_database, 0);
        if (obj) {
                if (!strcmp(folder, "INBOX")) {
-                       snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/INBOX' OR dir = '%s%s/%s/Urgent", odbc_table, VM_SPOOL_DIR, context, mailbox, VM_SPOOL_DIR, context, mailbox);
+                       snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/INBOX' OR dir = '%s%s/%s/Urgent'", odbc_table, VM_SPOOL_DIR, context, mailbox, VM_SPOOL_DIR, context, mailbox);
                } else {
                        snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/%s'", odbc_table, VM_SPOOL_DIR, context, mailbox, folder);
                }