diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-08 15:33:47 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-08 15:33:47 +0000 |
commit | f97f5f35303e351152d43442032bfe94bf6f15c3 (patch) | |
tree | 53eaf79cdfde48d31331c4de1129661c31e662c7 | |
parent | ffa7ffcf39083b7ffb044301eac19b12c299300a (diff) |
Merged revisions 136784 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r136784 | mmichelson | 2008-08-08 10:31:31 -0500 (Fri, 08 Aug 2008) | 3 lines
Fix compilation for ODBC voicemail
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@136785 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_voicemail.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 0af7119ce..5bef5b385 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2893,6 +2893,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 static int count_messages(struct ast_vm_user *vmu, char *dir) @@ -2963,35 +2990,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 #endif /* #ifndef IMAP_STORAGE */ #endif /* #else of #ifdef ODBC_STORAGE */ @@ -3088,6 +3086,7 @@ static void copy_plain_file(char *frompath, char *topath) ast_variables_destroy(var); } + #if (!defined(ODBC_STORAGE) && !defined(IMAP_STORAGE)) /*! * \brief Removes the voicemail sound and information file. |