[asterisk-commits] russell: branch russell/chan_console r71704 - in /team/russell/chan_console: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 25 14:41:12 CDT 2007


Author: russell
Date: Mon Jun 25 14:41:12 2007
New Revision: 71704

URL: http://svn.digium.com/view/asterisk?view=rev&rev=71704
Log:
Merged revisions 71658,71688 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r71658 | tilghman | 2007-06-25 13:20:18 -0500 (Mon, 25 Jun 2007) | 18 lines

Merged revisions 71657 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r71657 | tilghman | 2007-06-25 13:14:59 -0500 (Mon, 25 Jun 2007) | 10 lines

Merged revisions 71656 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71656 | tilghman | 2007-06-25 13:12:37 -0500 (Mon, 25 Jun 2007) | 2 lines

Issue 10035 - handle_exec returns a result inconsistent with all of the other AGI commands

........

................

................
r71688 | russell | 2007-06-25 14:20:07 -0500 (Mon, 25 Jun 2007) | 3 lines

Allow compilation off app_voicemail with IMAP_STORAE against a system installed
version of the c-client library.  (issue #10047, jcollie)

................

Modified:
    team/russell/chan_console/   (props changed)
    team/russell/chan_console/apps/app_voicemail.c
    team/russell/chan_console/configure.ac
    team/russell/chan_console/doc/imapstorage.tex
    team/russell/chan_console/res/res_agi.c

Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jun 25 14:41:12 2007
@@ -1,1 +1,1 @@
-/trunk:1-71652
+/trunk:1-71703

Modified: team/russell/chan_console/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_voicemail.c?view=diff&rev=71704&r1=71703&r2=71704
==============================================================================
--- team/russell/chan_console/apps/app_voicemail.c (original)
+++ team/russell/chan_console/apps/app_voicemail.c Mon Jun 25 14:41:12 2007
@@ -82,9 +82,15 @@
 #include <ctype.h>
 #include <signal.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 "imap4r1.h"
 #include "linkage.h"
+#endif
 #endif
 
 #include "asterisk/lock.h"
@@ -148,7 +154,7 @@
 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 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 vm_state *vms;
@@ -4807,7 +4813,11 @@
 
 	if (delimiter == '\0') {		/* did not probe the server yet */
 		char *cp;
+#ifdef USE_SYSTEM_IMAP
+#include <imap/linkage.c>
+#else
 #include "linkage.c"
+#endif
 		/* Connect to INBOX first to get folders delimiter */
 		imap_mailbox_name(tmp, vms, 0, 0);
 		stream = mail_open(stream, tmp, debug ? OP_DEBUG : NIL);

Modified: team/russell/chan_console/configure.ac
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/configure.ac?view=diff&rev=71704&r1=71703&r2=71704
==============================================================================
--- team/russell/chan_console/configure.ac (original)
+++ team/russell/chan_console/configure.ac Mon Jun 25 14:41:12 2007
@@ -437,7 +437,9 @@
 fi
 
 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"
       if test  -n "${IMAP_TK_MANDATORY}"; then
 	 AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
@@ -446,17 +448,29 @@
 	 AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
       fi
    fi
-   AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
+   if test "${IMAP_TK_DIR}" != "system" ; then
+      AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
+   fi
    saved_cppflags="${CPPFLAGS}"
    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`
-   fi
-   CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
-   LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
+      imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
+      imap_include="-I${IMAP_TK_DIR}/c-client"
+   fi
+   CPPFLAGS="${CPPFLAGS} ${imap_include}"
+   LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
    AC_LINK_IFELSE(
 	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)
 		{
 		}
@@ -512,7 +526,11 @@
    if test "${ac_cv_imap_tk}" = "yes"; then
    AC_LINK_IFELSE(
       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)
          {
          }
@@ -570,8 +588,8 @@
    LIBS="${saved_libs}"
    if test "${ac_cv_imap_tk}" = "yes"; then
       AC_MSG_RESULT(yes) 
-      IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
-      IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
+      IMAP_TK_LIB="${imap_libs}"`echo ${imap_ldflags}`
+      IMAP_TK_INCLUDE="${imap_include}"
       PBX_IMAP_TK=1
       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

Modified: team/russell/chan_console/doc/imapstorage.tex
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/doc/imapstorage.tex?view=diff&rev=71704&r1=71703&r2=71704
==============================================================================
--- team/russell/chan_console/doc/imapstorage.tex (original)
+++ team/russell/chan_console/doc/imapstorage.tex Mon Jun 25 14:41:12 2007
@@ -19,10 +19,11 @@
 
 \subsubsection{University of Washington IMAP C-Client}
 
-You will need a source distribution of University of Washington's IMAP
-c-client (http://www.washington.edu/imap/).  Asterisk supports both the
-2004 and 2006 versions of c-client, however mail\_expunge\_full is enabled
-in the 2006 version.
+If you do not have the University of Washington's IMAP c-client
+installed on your system, you will need to download the c-client
+source distribution (http://www.washington.edu/imap/) and compile it.
+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,
 but building it also builds an IMAP server and various other utilities.
@@ -50,19 +51,17 @@
 
 \subsubsection{Compiling Asterisk}
 
-Configure with ./configure --with-imap=/usr/src/imap
-or where ever you built thfe UWashington IMAP Toolkit. When you run
-'make menuselect', choose 'Voicemail Build Options' and the
-IMAP\_STORAGE option should be available for selection.
+To use the system c-client library, configure Asterisk with
+./configure --with-imap=system. If you downloaded the c-client source
+and compiled it according to the above instructions, configure
+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
-installed copy of the IMAP Toolkit c-client library; the Asterisk
-Makefiles and configure script are designed to build against an
-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.
+After selecting the IMAP\_STORAGE option, use the 'x' key to exit
+menuselect and save your changes, and the build/install Asterisk
+normally.
 
 \subsection{Modify voicemail.conf}
 

Modified: team/russell/chan_console/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/res/res_agi.c?view=diff&rev=71704&r1=71703&r2=71704
==============================================================================
--- team/russell/chan_console/res/res_agi.c (original)
+++ team/russell/chan_console/res/res_agi.c Mon Jun 25 14:41:12 2007
@@ -1125,7 +1125,7 @@
 	}
 	fdprintf(agi->fd, "200 result=%d\n", res);
 
-	return res;
+	return res >= 0 ? RESULT_SUCCESS : RESULT_FAILURE;
 }
 
 static int handle_setcallerid(struct ast_channel *chan, AGI *agi, int argc, char **argv)




More information about the asterisk-commits mailing list