[asterisk-commits] kpfleming: branch group/new_loader_completion r40396 - in /team/group/new_loa...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Aug 18 12:23:22 MST 2006


Author: kpfleming
Date: Fri Aug 18 14:23:21 2006
New Revision: 40396

URL: http://svn.digium.com/view/asterisk?rev=40396&view=rev
Log:
update to trunk so IMAP support will build

Modified:
    team/group/new_loader_completion/   (props changed)
    team/group/new_loader_completion/apps/app_voicemail.c
    team/group/new_loader_completion/configs/zapata.conf.sample
    team/group/new_loader_completion/configure
    team/group/new_loader_completion/configure.ac
    team/group/new_loader_completion/doc/imapstorage.txt
    team/group/new_loader_completion/doc/queues-with-callback-members.txt
    team/group/new_loader_completion/include/asterisk/autoconfig.h.in
    team/group/new_loader_completion/include/asterisk/lock.h

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
    automerge = yes

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Aug 18 14:23:21 2006
@@ -1,1 +1,1 @@
-/trunk:1-40282
+/trunk:1-40394

Modified: team/group/new_loader_completion/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_voicemail.c?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_voicemail.c (original)
+++ team/group/new_loader_completion/apps/app_voicemail.c Fri Aug 18 14:23:21 2006
@@ -6469,10 +6469,13 @@
 	/* expunge message - use UID Expunge if supported on IMAP server*/
 	ast_log(LOG_DEBUG, "*** Checking if we can expunge, deleted set to %d, expungeonhangup set to %d\n",deleted,expungeonhangup);
 	if (vmu && deleted == 1 && expungeonhangup == 1)  {
+#ifdef HAVE_IMAP_TK2006
 	      	if (LEVELUIDPLUS (vms.mailstream)) {
 			ast_log(LOG_DEBUG, "*** About to expunge messages using UID\n");
 			mail_expunge_full(vms.mailstream,NIL,EX_UID);
-		} else {
+		} else 
+#endif
+		{
 			ast_log(LOG_DEBUG, "*** About to expunge messages\n");
 			mail_expunge(vms.mailstream);
 		}

Modified: team/group/new_loader_completion/configs/zapata.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/configs/zapata.conf.sample?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/configs/zapata.conf.sample (original)
+++ team/group/new_loader_completion/configs/zapata.conf.sample Fri Aug 18 14:23:21 2006
@@ -328,10 +328,17 @@
 ; Use either "yes", "no", or a power of two from 32 to 256 if you wish to
 ; actually set the number of taps of cancellation.
 ;
+; Note that if any of your Zaptel cards have hardware echo cancellers,
+; then this setting only turns them on and off; numeric settings will
+; be treated as "yes". There are no special settings required for
+; hardware echo cancellers; when present and enabled in their kernel
+; modules, they take precedence over the software echo canceller compiled
+; into Zaptel automatically.
+;
 echocancel=yes
 ;
 ; Generally, it is not necessary (and in fact undesirable) to echo cancel when
-; the circuit path is entirely TDM.  You may, however, reverse this behavior
+; the circuit path is entirely TDM.  You may, however, change this behavior
 ; by enabling the echo cancel during pure TDM bridging below.
 ;
 echocancelwhenbridged=yes
@@ -342,6 +349,8 @@
 ; response to pre-train the echo canceller so it can start out with a much
 ; closer idea of the actual echo.  Value may be "yes", "no", or a number of
 ; milliseconds to delay before training (default = 400)
+;
+; Note that these parameters do not apply to hardware echo cancellers.
 ;
 ;echotraining=yes
 ;echotraining=800

Modified: team/group/new_loader_completion/configure
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/configure?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/configure (original)
+++ team/group/new_loader_completion/configure Fri Aug 18 14:23:21 2006
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 40129 .
+# From configure.ac Revision: 40221 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.60.
 #
@@ -5173,7 +5173,7 @@
       if ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
          GNU_MAKE=$a ;
          GNU_MAKE_VERSION_MAJOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
-         GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.'`
+         GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
          break;
       fi
    done ;
@@ -17070,10 +17070,6 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include "c-client.h"
-int
-main ()
-{
-
 		void mm_searched (MAILSTREAM *stream,unsigned long number)
 		{
 		}
@@ -17119,10 +17115,11 @@
 		void mm_fatal (char *string)
 		{
 		}
-		int main()
-		{
+int
+main ()
+{
+
 		MAILSTREAM *foo = mail_open(NULL, "", 0);
-		}
 
 
   ;
@@ -17174,6 +17171,116 @@
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
+   if test "${ac_cv_imap_tk}" = "yes"; then
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "c-client.h"
+         void mm_searched (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_exists (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_expunged (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_flags (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_notify (MAILSTREAM *stream,char *string,long errflg)
+         {
+         }
+         void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+         {
+         }
+         void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+         {
+         }
+         void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
+         {
+         }
+         void mm_log (char *string,long errflg)
+         {
+         }
+         void mm_dlog (char *string)
+         {
+         }
+         void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
+         {
+         }
+         void mm_critical (MAILSTREAM *stream)
+         {
+         }
+         void mm_nocritical (MAILSTREAM *stream)
+         {
+         }
+         long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
+         {
+         }
+         void mm_fatal (char *string)
+         {
+         }
+int
+main ()
+{
+
+         long check = mail_expunge_full(NULL, "", 0);
+
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_imap_tk2006="yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_imap_tk2006="no"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  fi
    CPPFLAGS="${saved_cppflags}"
    LIBS="${saved_libs}"
    if test "${ac_cv_imap_tk}" = "yes"; then
@@ -17187,6 +17294,13 @@
 #define HAVE_IMAP_TK 1
 _ACEOF
 
+      if test "${ac_cv_imap_tk2006}" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IMAP_TK2006 1
+_ACEOF
+
+      fi
    elif test ! -z "${IMAP_TK_MANDATORY}"; then
       { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }

Modified: team/group/new_loader_completion/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/configure.ac?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/configure.ac (original)
+++ team/group/new_loader_completion/configure.ac Fri Aug 18 14:23:21 2006
@@ -359,62 +359,116 @@
    LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
    AC_LINK_IFELSE(
 	AC_LANG_PROGRAM(
-		[#include "c-client.h"],
+		[#include "c-client.h"
+		void mm_searched (MAILSTREAM *stream,unsigned long number)
+		{
+		}
+		void mm_exists (MAILSTREAM *stream,unsigned long number)
+		{
+		}
+		void mm_expunged (MAILSTREAM *stream,unsigned long number)
+		{
+		}
+		void mm_flags (MAILSTREAM *stream,unsigned long number)
+		{
+		}
+		void mm_notify (MAILSTREAM *stream,char *string,long errflg)
+		{
+		}
+		void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+		{
+		}
+		void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+		{
+		}
+		void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
+		{
+		}
+		void mm_log (char *string,long errflg)
+		{
+		}
+		void mm_dlog (char *string)
+		{
+		}
+		void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
+		{
+		}
+		void mm_critical (MAILSTREAM *stream)
+		{
+		}
+		void mm_nocritical (MAILSTREAM *stream)
+		{
+		}
+		long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
+		{
+		}
+		void mm_fatal (char *string)
+		{
+		}],
 		[
-		void mm_searched (MAILSTREAM *stream,unsigned long number)
-		{
-		}
-		void mm_exists (MAILSTREAM *stream,unsigned long number)
-		{
-		}
-		void mm_expunged (MAILSTREAM *stream,unsigned long number)
-		{
-		}
-		void mm_flags (MAILSTREAM *stream,unsigned long number)
-		{
-		}
-		void mm_notify (MAILSTREAM *stream,char *string,long errflg)
-		{
-		}
-		void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
-		{
-		}
-		void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
-		{
-		}
-		void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
-		{
-		}
-		void mm_log (char *string,long errflg)
-		{
-		}
-		void mm_dlog (char *string)
-		{
-		}
-		void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
-		{
-		}
-		void mm_critical (MAILSTREAM *stream)
-		{
-		}
-		void mm_nocritical (MAILSTREAM *stream)
-		{
-		}
-		long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
-		{
-		}
-		void mm_fatal (char *string)
-		{
-		}
-		int main()
-		{
 		MAILSTREAM *foo = mail_open(NULL, "", 0);
-		}
 		]
 	),
 	[ac_cv_imap_tk="yes"],
 	[ac_cv_imap_tk="no"]
    )
+   if test "${ac_cv_imap_tk}" = "yes"; then
+   AC_LINK_IFELSE(
+      AC_LANG_PROGRAM(
+         [#include "c-client.h"
+         void mm_searched (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_exists (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_expunged (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_flags (MAILSTREAM *stream,unsigned long number)
+         {
+         }
+         void mm_notify (MAILSTREAM *stream,char *string,long errflg)
+         {
+         }
+         void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+         {
+         }
+         void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+         {
+         }
+         void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
+         {
+         }
+         void mm_log (char *string,long errflg)
+         {
+         }
+         void mm_dlog (char *string)
+         {
+         }
+         void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
+         {
+         }
+         void mm_critical (MAILSTREAM *stream)
+         {
+         }
+         void mm_nocritical (MAILSTREAM *stream)
+         {
+         }
+         long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
+         {
+         }
+         void mm_fatal (char *string)
+         {
+         }],
+         [
+         long check = mail_expunge_full(NULL, "", 0);
+         ]
+      ),
+      [ac_cv_imap_tk2006="yes"],
+      [ac_cv_imap_tk2006="no"]
+  )
+  fi
    CPPFLAGS="${saved_cppflags}"
    LIBS="${saved_libs}"
    if test "${ac_cv_imap_tk}" = "yes"; then
@@ -423,6 +477,9 @@
       IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
       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
+         AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
+      fi
    elif test ! -z "${IMAP_TK_MANDATORY}"; then
       AC_MSG_RESULT(no) 
       AC_MSG_NOTICE(***)

Modified: team/group/new_loader_completion/doc/imapstorage.txt
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/doc/imapstorage.txt?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/doc/imapstorage.txt (original)
+++ team/group/new_loader_completion/doc/imapstorage.txt Fri Aug 18 14:23:21 2006
@@ -39,8 +39,10 @@
 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/).  You will want to make the
-appropriate changes to the c-client Makefile, for instance:
+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.  You will want to make the appropriate changes 
+to the c-client Makefile, for instance:
 
 EXTRAAUTHENTICATORS=gss
 EXTRADRIVERS=mbox
@@ -58,7 +60,7 @@
 or where ever you built the University of Washington IMAP C-Client.
 Then make menuselect go to voicemail options and check the imap box
 then make, make install and asterisk will have imap storage support for 
-voicemail.
+voicemail. 
 
 ---------------------
 Modify voicemail.conf

Modified: team/group/new_loader_completion/doc/queues-with-callback-members.txt
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/doc/queues-with-callback-members.txt?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/doc/queues-with-callback-members.txt (original)
+++ team/group/new_loader_completion/doc/queues-with-callback-members.txt Fri Aug 18 14:23:21 2006
@@ -396,6 +396,107 @@
 which correspond to the Login and Logout actions.
 
 
+=======================================================
+|    Controlling The Way Queues Call the Agents       |
+=======================================================
+
+Notice in the above, that the commands to manipulate agents in queues have
+"@agents" in their arguments. This is a reference to the agents context:
+
+context agents
+{
+	// General sales queue
+	8010 =>
+	{
+		Set(QUEUE_MAX_PENALTY=10);
+		Queue(sales-general|t);
+		Set(QUEUE_MAX_PENALTY=0);
+		Queue(sales-general|t);
+		Set(CALLERID(name)=EmptySalQ);
+		goto dispatch|s|1;
+	}
+	// Customer Service queue
+	8011 =>
+	{
+		Set(QUEUE_MAX_PENALTY=10);
+		Queue(customerservice|t);
+		Set(QUEUE_MAX_PENALTY=0);
+		Queue(customerservice|t);
+		Set(CALLERID(name)=EMptyCSVQ);
+		goto dispatch|s|1;
+	}
+	8013 =>
+	{
+		Dial(iax2/sweatshop/9456 at from-ecstacy);
+
+		Set(CALLERID(name)=EmptySupQ);
+		Set(QUEUE_MAX_PENALTY=10);
+		Queue(support-dispatch,t);
+		Set(QUEUE_MAX_PENALTY=20);
+		Queue(support-dispatch,t);
+		Set(QUEUE_MAX_PENALTY=0); // means no max
+		Queue(support-dispatch,t);
+		goto dispatch|s|1;
+	}
+	6121 => &callagent(${RAQUEL});
+	6165 => &callagent(${SPEARS});
+	6170 => &callagent(${ROCK});
+	6070 => &callagent(${SALINE});
+}
+
+In the above, the variables ${RAQUEL}, etc stand for
+actual devices to ring that person's
+phone (like Zap/37).
+
+The 8010, 8011, and 8013 extensions are purely for transferring
+incoming callers to queues. For instance, a customer service 
+agent might want to transfer the caller to talk to sales. The 
+agent only has to transfer to extension 8010, in this case.
+
+Here is the callagent macro, note that if a person in the
+queue is called, but does not answer, then they are automatically
+removed from the queue.
+
+macro callagent(device)
+{
+	if( ${GROUP_COUNT(${MACRO_EXTEN}@agents)}=0 )
+	{
+		Set(OUTBOUND_GROUP=${MACRO_EXTEN}@agents);
+		Dial(${device}|300|t);
+		switch(${DIALSTATUS})
+		{
+		case BUSY:
+			Busy();
+			break;
+		case NOANSWER:
+			Set(queue-announce-success=0);
+			goto queues-manip|O${MACRO_EXTEN}|1;
+		default:
+			Hangup();
+			break;
+		}
+	}
+	else
+	{
+		Busy();
+	}
+}
+
+In the callagent macro above, the ${MACRO_EXTEN} will
+be 6121, or 6165, etc, which is the extension of the agent.
+
+The use of the GROUP_COUNT, and OUTBOUND_GROUP follow this line
+of thinking. Incoming calls can be queued to ring all agents in the
+current priority. If some of those agents are already talking, they
+would get bothersome call-waiting tones. To avoid this inconvenience,
+when an agent gets a call, the OUTBOUND_GROUP assigns that 
+conversation to the group specified, for instance 6171 at agents.
+The ${GROUP_COUNT()} variable on a subsequent call should return
+"1" for that group. If GROUP_COUNT returns 1, then the busy() 
+is returned without actually trying to dial the agent.
+
+
+
 ================ Caveats 
 
 In the above examples, some of the possible error checking has been omitted,

Modified: team/group/new_loader_completion/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/include/asterisk/autoconfig.h.in?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/include/asterisk/autoconfig.h.in (original)
+++ team/group/new_loader_completion/include/asterisk/autoconfig.h.in Fri Aug 18 14:23:21 2006
@@ -126,6 +126,10 @@
 
 /* Define if your system has the UW IMAP Toolkit c-client library. */
 #undef HAVE_IMAP_TK
+
+/* Define if your system has the UW IMAP Toolkit c-client library version 2006
+   or greater. */
+#undef HAVE_IMAP_TK2006
 
 /* Define to 1 if you have the `inet_ntoa' function. */
 #undef HAVE_INET_NTOA

Modified: team/group/new_loader_completion/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/include/asterisk/lock.h?rev=40396&r1=40395&r2=40396&view=diff
==============================================================================
--- team/group/new_loader_completion/include/asterisk/lock.h (original)
+++ team/group/new_loader_completion/include/asterisk/lock.h Fri Aug 18 14:23:21 2006
@@ -789,12 +789,12 @@
 #elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 4)
 AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
 {
-	return OSAtomicDecrement32((int32_t *) p) == 0;
+	return OSAtomicAdd32( -1, (int32_t *) p) == 0;
 })
 #elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8)
 AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
 {
-	return OSAtomicDecrement64((int64_t *) p) == 0;
+	return OSAtomicAdd64( -1, (int64_t *) p) == 0;
 #else
 AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
 {



More information about the asterisk-commits mailing list