summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-08-08 15:31:31 +0000
committerMark Michelson <mmichelson@digium.com>2008-08-08 15:31:31 +0000
commit4e2406fda49fa5aade5cef21d70b85a40e492989 (patch)
tree5d63762e87896a63c45f35e138ca88bd33ea7832 /apps/app_voicemail.c
parent7330024a145b026c17c85064f7017a51218873b4 (diff)
Fix compilation for ODBC voicemail
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c58
1 files changed, 28 insertions, 30 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ed2df4614..c0adc3324 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3277,6 +3277,33 @@ static void rename_file(char *sdir, int smsg, char *mailboxuser, char *mailboxco
return;
}
+/*!
+ * \brief Removes a voicemail message file.
+ * \param dir the path to the message file.
+ * \param msgnum the unique number for the message within the mailbox.
+ *
+ * Removes the message content file and the information file.
+ * This method is used by the DISPOSE macro when mailboxes are stored in an ODBC back end.
+ * Typical use is to clean up after a RETRIEVE operation.
+ * Note that this does not remove the message from the mailbox folders, to do that we would use delete_file().
+ * \return zero on success, -1 on error.
+ */
+static int remove_file(char *dir, int msgnum)
+{
+ char fn[PATH_MAX];
+ char full_fn[PATH_MAX];
+ char msgnums[80];
+
+ if (msgnum > -1) {
+ snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
+ make_file(fn, sizeof(fn), dir, msgnum);
+ } else
+ ast_copy_string(fn, dir, sizeof(fn));
+ ast_filedelete(fn, NULL);
+ snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
+ unlink(full_fn);
+ return 0;
+}
#else
#ifndef IMAP_STORAGE
/*!
@@ -3368,36 +3395,6 @@ static int last_message_index(struct ast_vm_user *vmu, char *dir)
return x - 1;
}
-#if (defined(IMAP_STORAGE) || defined(ODBC_STORAGE))
-/*!
- * \brief Removes a voicemail message file.
- * \param dir the path to the message file.
- * \param msgnum the unique number for the message within the mailbox.
- *
- * Removes the message content file and the information file.
- * This method is used by the DISPOSE macro when mailboxes are stored in an ODBC back end.
- * Typical use is to clean up after a RETRIEVE operation.
- * Note that this does not remove the message from the mailbox folders, to do that we would use delete_file().
- * \return zero on success, -1 on error.
- */
-static int remove_file(char *dir, int msgnum)
-{
- char fn[PATH_MAX];
- char full_fn[PATH_MAX];
- char msgnums[80];
-
- if (msgnum > -1) {
- snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
- make_file(fn, sizeof(fn), dir, msgnum);
- } else
- ast_copy_string(fn, dir, sizeof(fn));
- ast_filedelete(fn, NULL);
- snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
- unlink(full_fn);
- return 0;
-}
-#endif
-
/*!
* \brief Utility function to copy a file.
@@ -3512,6 +3509,7 @@ static void copy_plain_file(char *frompath, char *topath)
#endif /* #ifndef IMAP_STORAGE */
#endif /* #else of #ifdef ODBC_STORAGE */
+
#if (!defined(ODBC_STORAGE) && !defined(IMAP_STORAGE))
/*!
* \brief Removes the voicemail sound and information file.