aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-06 00:26:02 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-06 00:26:02 +0000
commite86805285423fefb7016201de9971592da3a22a1 (patch)
tree82794a7bb3a85d7ce42b6e8f1797e781ade1db7f /apps/app_voicemail.c
parentf43b90f6f5f53cdecfa51dbef3b70c7fec1d8d2e (diff)
Move around some defines to unbreak ODBC storage.
(closes issue #11932) Reported by: snuffy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@102576 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c52
1 files changed, 25 insertions, 27 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ea0047f3d..4cf6895d1 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1479,6 +1479,30 @@ static void rename_file(char *sfn, char *dfn)
}
#endif
+/*
+ * A negative return value indicates an error.
+ */
+#if (!defined(IMAP_STORAGE) && !defined(ODBC_STORAGE))
+static int last_message_index(struct ast_vm_user *vmu, char *dir)
+{
+ int x;
+ char fn[PATH_MAX];
+
+ if (vm_lock_path(dir))
+ return ERROR_LOCK_PATH;
+
+ for (x = 0; x < vmu->maxmsg; x++) {
+ make_file(fn, sizeof(fn), dir, x);
+ if (ast_fileexists(fn, NULL, NULL) < 1)
+ break;
+ }
+ ast_unlock_path(dir);
+
+ return x - 1;
+}
+#endif
+#endif
+
static int copy(char *infile, char *outfile)
{
int ifd;
@@ -1538,31 +1562,6 @@ static void copy_plain_file(char *frompath, char *topath)
copy(frompath2, topath2);
}
-/*
- * A negative return value indicates an error.
- */
-#if (!defined(IMAP_STORAGE) && !defined(ODBC_STORAGE))
-static int last_message_index(struct ast_vm_user *vmu, char *dir)
-{
- int x;
- char fn[PATH_MAX];
-
- if (vm_lock_path(dir))
- return ERROR_LOCK_PATH;
-
- for (x = 0; x < vmu->maxmsg; x++) {
- make_file(fn, sizeof(fn), dir, x);
- if (ast_fileexists(fn, NULL, NULL) < 1)
- break;
- }
- ast_unlock_path(dir);
-
- return x - 1;
-}
-#endif
-#endif
-
-#ifndef ODBC_STORAGE
static int vm_delete(char *file)
{
char *txt;
@@ -1577,7 +1576,6 @@ static int vm_delete(char *file)
unlink(txt);
return ast_filedelete(file, NULL);
}
-#endif
static int inbuf(struct baseio *bio, FILE *fi)
{
@@ -4240,7 +4238,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
}
/* Remove surrogate file */
- DELETE(tmpdir, curmsg, msgfile);
+ vm_delete(msgfile);
}
/* If anything failed above, we still have this list to free */