mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 14:56:58 +00:00
Allow compilation off app_voicemail with IMAP_STORAE against a system installed
version of the c-client library. (issue #10047, jcollie) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -82,10 +82,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#ifdef USE_SYSTEM_IMAP
|
||||||
|
#include <imap/c-client.h>
|
||||||
|
#include <imap/imap4r1.h>
|
||||||
|
#include <imap/linkage.h>
|
||||||
|
#else
|
||||||
#include "c-client.h"
|
#include "c-client.h"
|
||||||
#include "imap4r1.h"
|
#include "imap4r1.h"
|
||||||
#include "linkage.h"
|
#include "linkage.h"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "asterisk/lock.h"
|
#include "asterisk/lock.h"
|
||||||
#include "asterisk/file.h"
|
#include "asterisk/file.h"
|
||||||
@@ -148,7 +154,7 @@ static void mm_parsequota (MAILSTREAM *stream, unsigned char *msg, QUOTALIST *pq
|
|||||||
static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int target);
|
static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int target);
|
||||||
static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms);
|
static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms);
|
||||||
static void update_messages_by_imapuser(const char *user, unsigned long number);
|
static void update_messages_by_imapuser(const char *user, unsigned long number);
|
||||||
|
static int count_messages(struct ast_vm_user *vmu, char *dir);
|
||||||
|
|
||||||
struct vmstate {
|
struct vmstate {
|
||||||
struct vm_state *vms;
|
struct vm_state *vms;
|
||||||
@@ -4807,7 +4813,11 @@ static int init_mailstream(struct vm_state *vms, int box)
|
|||||||
|
|
||||||
if (delimiter == '\0') { /* did not probe the server yet */
|
if (delimiter == '\0') { /* did not probe the server yet */
|
||||||
char *cp;
|
char *cp;
|
||||||
|
#ifdef USE_SYSTEM_IMAP
|
||||||
|
#include <imap/linkage.c>
|
||||||
|
#else
|
||||||
#include "linkage.c"
|
#include "linkage.c"
|
||||||
|
#endif
|
||||||
/* Connect to INBOX first to get folders delimiter */
|
/* Connect to INBOX first to get folders delimiter */
|
||||||
imap_mailbox_name(tmp, vms, 0, 0);
|
imap_mailbox_name(tmp, vms, 0, 0);
|
||||||
stream = mail_open(stream, tmp, debug ? OP_DEBUG : NIL);
|
stream = mail_open(stream, tmp, debug ? OP_DEBUG : NIL);
|
||||||
|
33
configure
vendored
33
configure
vendored
@@ -1,5 +1,5 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# From configure.ac Revision: 67029 .
|
# From configure.ac Revision: 69703 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61.
|
# Generated by GNU Autoconf 2.61.
|
||||||
#
|
#
|
||||||
@@ -19102,7 +19102,10 @@ fi
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "${USE_IMAP_TK}" != "no"; then
|
if test "${USE_IMAP_TK}" != "no"; then
|
||||||
if test "${IMAP_TK_DIR}" = ""; then
|
if test "${IMAP_TK_DIR}" = "system" ; then
|
||||||
|
{ echo "$as_me:$LINENO: Checking for system c-client library..." >&5
|
||||||
|
echo "$as_me: Checking for system c-client library..." >&6;}
|
||||||
|
elif test "${IMAP_TK_DIR}" = ""; then
|
||||||
IMAP_TK_DIR=`pwd`"/../imap-2004g"
|
IMAP_TK_DIR=`pwd`"/../imap-2004g"
|
||||||
if test -n "${IMAP_TK_MANDATORY}"; then
|
if test -n "${IMAP_TK_MANDATORY}"; then
|
||||||
{ echo "$as_me:$LINENO: The --with-imap option does not search your system for installed" >&5
|
{ echo "$as_me:$LINENO: The --with-imap option does not search your system for installed" >&5
|
||||||
@@ -19115,22 +19118,34 @@ echo "$as_me: the configure script will assume you have placed built the c-clien
|
|||||||
echo "$as_me: files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file." >&6;}
|
echo "$as_me: files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file." >&6;}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if test "${IMAP_TK_DIR}" != "system" ; then
|
||||||
{ echo "$as_me:$LINENO: checking for UW IMAP Toolkit c-client library" >&5
|
{ echo "$as_me:$LINENO: checking for UW IMAP Toolkit c-client library" >&5
|
||||||
echo $ECHO_N "checking for UW IMAP Toolkit c-client library... $ECHO_C" >&6; }
|
echo $ECHO_N "checking for UW IMAP Toolkit c-client library... $ECHO_C" >&6; }
|
||||||
|
fi
|
||||||
saved_cppflags="${CPPFLAGS}"
|
saved_cppflags="${CPPFLAGS}"
|
||||||
saved_libs="${LIBS}"
|
saved_libs="${LIBS}"
|
||||||
if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
|
if test "${IMAP_TK_DIR}" = "system" ; then
|
||||||
|
imap_ldflags=""
|
||||||
|
imap_libs="-lc-client"
|
||||||
|
imap_include="-DUSE_SYSTEM_IMAP"
|
||||||
|
elif test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
|
||||||
imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
|
imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
|
||||||
|
imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
|
||||||
|
imap_include="-I${IMAP_TK_DIR}/c-client"
|
||||||
fi
|
fi
|
||||||
CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
|
CPPFLAGS="${CPPFLAGS} ${imap_include}"
|
||||||
LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
|
LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
/* confdefs.h. */
|
/* confdefs.h. */
|
||||||
_ACEOF
|
_ACEOF
|
||||||
cat confdefs.h >>conftest.$ac_ext
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
cat >>conftest.$ac_ext <<_ACEOF
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
#ifdef USE_SYSTEM_IMAP
|
||||||
|
#include <imap/c-client.h>
|
||||||
|
#else
|
||||||
#include "c-client.h"
|
#include "c-client.h"
|
||||||
|
#endif
|
||||||
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -19223,7 +19238,11 @@ _ACEOF
|
|||||||
cat confdefs.h >>conftest.$ac_ext
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
cat >>conftest.$ac_ext <<_ACEOF
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
#ifdef USE_SYSTEM_IMAP
|
||||||
|
#include <imap/c-client.h>
|
||||||
|
#else
|
||||||
#include "c-client.h"
|
#include "c-client.h"
|
||||||
|
#endif
|
||||||
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -19315,8 +19334,8 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
|||||||
if test "${ac_cv_imap_tk}" = "yes"; then
|
if test "${ac_cv_imap_tk}" = "yes"; then
|
||||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||||
echo "${ECHO_T}yes" >&6; }
|
echo "${ECHO_T}yes" >&6; }
|
||||||
IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
|
IMAP_TK_LIB="${imap_libs}"`echo ${imap_ldflags}`
|
||||||
IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
|
IMAP_TK_INCLUDE="${imap_include}"
|
||||||
PBX_IMAP_TK=1
|
PBX_IMAP_TK=1
|
||||||
|
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
34
configure.ac
34
configure.ac
@@ -436,7 +436,9 @@ if test "${PBX_IKSEMEL}" = 1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "${USE_IMAP_TK}" != "no"; then
|
if test "${USE_IMAP_TK}" != "no"; then
|
||||||
if test "${IMAP_TK_DIR}" = ""; then
|
if test "${IMAP_TK_DIR}" = "system" ; then
|
||||||
|
AC_MSG_NOTICE([Checking for system c-client library...])
|
||||||
|
elif test "${IMAP_TK_DIR}" = ""; then
|
||||||
IMAP_TK_DIR=`pwd`"/../imap-2004g"
|
IMAP_TK_DIR=`pwd`"/../imap-2004g"
|
||||||
if test -n "${IMAP_TK_MANDATORY}"; then
|
if test -n "${IMAP_TK_MANDATORY}"; then
|
||||||
AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
|
AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
|
||||||
@@ -445,17 +447,29 @@ if test "${USE_IMAP_TK}" != "no"; then
|
|||||||
AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
|
AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if test "${IMAP_TK_DIR}" != "system" ; then
|
||||||
AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
|
AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
|
||||||
|
fi
|
||||||
saved_cppflags="${CPPFLAGS}"
|
saved_cppflags="${CPPFLAGS}"
|
||||||
saved_libs="${LIBS}"
|
saved_libs="${LIBS}"
|
||||||
if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
|
if test "${IMAP_TK_DIR}" = "system" ; then
|
||||||
|
imap_ldflags=""
|
||||||
|
imap_libs="-lc-client"
|
||||||
|
imap_include="-DUSE_SYSTEM_IMAP"
|
||||||
|
elif test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
|
||||||
imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
|
imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
|
||||||
|
imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
|
||||||
|
imap_include="-I${IMAP_TK_DIR}/c-client"
|
||||||
fi
|
fi
|
||||||
CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
|
CPPFLAGS="${CPPFLAGS} ${imap_include}"
|
||||||
LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
|
LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
AC_LANG_PROGRAM(
|
AC_LANG_PROGRAM(
|
||||||
[#include "c-client.h"
|
[#ifdef USE_SYSTEM_IMAP
|
||||||
|
#include <imap/c-client.h>
|
||||||
|
#else
|
||||||
|
#include "c-client.h"
|
||||||
|
#endif
|
||||||
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -511,7 +525,11 @@ if test "${USE_IMAP_TK}" != "no"; then
|
|||||||
if test "${ac_cv_imap_tk}" = "yes"; then
|
if test "${ac_cv_imap_tk}" = "yes"; then
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
AC_LANG_PROGRAM(
|
AC_LANG_PROGRAM(
|
||||||
[#include "c-client.h"
|
[#ifdef USE_SYSTEM_IMAP
|
||||||
|
#include <imap/c-client.h>
|
||||||
|
#else
|
||||||
|
#include "c-client.h"
|
||||||
|
#endif
|
||||||
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
void mm_searched (MAILSTREAM *stream,unsigned long number)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -569,8 +587,8 @@ if test "${USE_IMAP_TK}" != "no"; then
|
|||||||
LIBS="${saved_libs}"
|
LIBS="${saved_libs}"
|
||||||
if test "${ac_cv_imap_tk}" = "yes"; then
|
if test "${ac_cv_imap_tk}" = "yes"; then
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
|
IMAP_TK_LIB="${imap_libs}"`echo ${imap_ldflags}`
|
||||||
IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
|
IMAP_TK_INCLUDE="${imap_include}"
|
||||||
PBX_IMAP_TK=1
|
PBX_IMAP_TK=1
|
||||||
AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
|
AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
|
||||||
if test "${ac_cv_imap_tk2006}" = "yes"; then
|
if test "${ac_cv_imap_tk2006}" = "yes"; then
|
||||||
|
@@ -19,10 +19,11 @@ additional voicemail functionality, including:
|
|||||||
|
|
||||||
\subsubsection{University of Washington IMAP C-Client}
|
\subsubsection{University of Washington IMAP C-Client}
|
||||||
|
|
||||||
You will need a source distribution of University of Washington's IMAP
|
If you do not have the University of Washington's IMAP c-client
|
||||||
c-client (http://www.washington.edu/imap/). Asterisk supports both the
|
installed on your system, you will need to download the c-client
|
||||||
2004 and 2006 versions of c-client, however mail\_expunge\_full is enabled
|
source distribution (http://www.washington.edu/imap/) and compile it.
|
||||||
in the 2006 version.
|
Asterisk supports both the 2004 and 2006 versions of c-client, however
|
||||||
|
mail\_expunge\_full is enabled in the 2006 version.
|
||||||
|
|
||||||
Note that Asterisk only uses the 'client' portion of the UW IMAP toolkit,
|
Note that Asterisk only uses the 'client' portion of the UW IMAP toolkit,
|
||||||
but building it also builds an IMAP server and various other utilities.
|
but building it also builds an IMAP server and various other utilities.
|
||||||
@@ -50,19 +51,17 @@ need to run 'make install'.
|
|||||||
|
|
||||||
\subsubsection{Compiling Asterisk}
|
\subsubsection{Compiling Asterisk}
|
||||||
|
|
||||||
Configure with ./configure --with-imap=/usr/src/imap
|
To use the system c-client library, configure Asterisk with
|
||||||
or where ever you built thfe UWashington IMAP Toolkit. When you run
|
./configure --with-imap=system. If you downloaded the c-client source
|
||||||
'make menuselect', choose 'Voicemail Build Options' and the
|
and compiled it according to the above instructions, configure
|
||||||
IMAP\_STORAGE option should be available for selection.
|
Asterisk with with ./configure --with-imap=/usr/src/imap or where ever
|
||||||
|
you built the UWashington IMAP Toolkit. When you run 'make
|
||||||
|
menuselect', choose 'Voicemail Build Options' and the IMAP\_STORAGE
|
||||||
|
option should be available for selection.
|
||||||
|
|
||||||
Note that the --with-imap option will NOT search your system for an
|
After selecting the IMAP\_STORAGE option, use the 'x' key to exit
|
||||||
installed copy of the IMAP Toolkit c-client library; the Asterisk
|
menuselect and save your changes, and the build/install Asterisk
|
||||||
Makefiles and configure script are designed to build against an
|
normally.
|
||||||
unpacked and compiled source tree of the IMAP Toolkit, not a binary
|
|
||||||
distribution.
|
|
||||||
|
|
||||||
After selecting it, use the 'x' key to exit menuselect and save
|
|
||||||
your changes, and the build/install Asterisk normally.
|
|
||||||
|
|
||||||
\subsection{Modify voicemail.conf}
|
\subsection{Modify voicemail.conf}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user