aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-09 05:55:44 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-09 05:55:44 +0000
commit4726be05ab070f714cb1052fc4e09a161cff0280 (patch)
tree2795ac9a0bf2226961f7feaceb565e051e90abb6 /apps
parent43d78c44a2de39f9eae6a9a657d5dc8f58d9b8c2 (diff)
Bug 7009 - use the actual path, so that a table index can be used
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25830 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 924d1084f..f9ba86965 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2047,7 +2047,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
odbc_release_obj(obj);
goto yuck;
}
- snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir LIKE '%%%s/%s/%s'", odbc_table, context, tmp, "INBOX");
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/%s'", odbc_table, VM_SPOOL_DIR, context, tmp, "INBOX");
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2085,7 +2085,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
odbc_release_obj(obj);
goto yuck;
}
- snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like '%%%s/%s/%s'", odbc_table, context, tmp, "Old");
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/%s'", odbc_table, VM_SPOOL_DIR, context, tmp, "Old");
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2158,7 +2158,7 @@ static int has_voicemail(const char *mailbox, const char *folder)
odbc_release_obj(obj);
goto yuck;
}
- snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like '%%%s/%s/%s'", odbc_table, context, tmp, "INBOX");
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/%s'", odbc_table, VM_SPOOL_DIR, context, tmp, "INBOX");
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2235,7 +2235,7 @@ static int has_voicemail(const char *mailbox, const char *folder)
context++;
} else
context = "default";
- snprintf(fn, sizeof(fn), "%s/%s/%s/%s", VM_SPOOL_DIR, context, tmp, folder);
+ snprintf(fn, sizeof(fn), "%s%s/%s/%s", VM_SPOOL_DIR, context, tmp, folder);
dir = opendir(fn);
if (!dir)
return 0;
@@ -2293,7 +2293,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
} else
context = "default";
if (newmsgs) {
- snprintf(fn, sizeof(fn), "%s/%s/%s/INBOX", VM_SPOOL_DIR, context, tmp);
+ snprintf(fn, sizeof(fn), "%s%s/%s/INBOX", VM_SPOOL_DIR, context, tmp);
dir = opendir(fn);
if (dir) {
while ((de = readdir(dir))) {
@@ -2306,7 +2306,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
}
}
if (oldmsgs) {
- snprintf(fn, sizeof(fn), "%s/%s/%s/Old", VM_SPOOL_DIR, context, tmp);
+ snprintf(fn, sizeof(fn), "%s%s/%s/Old", VM_SPOOL_DIR, context, tmp);
dir = opendir(fn);
if (dir) {
while ((de = readdir(dir))) {