[asterisk-commits] pcadach: branch pcadach/chan_h323-live r40379 - in /team/pcadach/chan_h323-li...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Aug 17 20:42:18 MST 2006


Author: pcadach
Date: Thu Aug 17 22:42:17 2006
New Revision: 40379

URL: http://svn.digium.com/view/asterisk?rev=40379&view=rev
Log:
Merged revisions 40302-40303,40335,40337,40360 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r40302 | russell | 2006-08-18 03:10:16 +0600 (Птн, 18 Авг 2006) | 2 lines

update configure script to reflect change to make version check

........
r40303 | file | 2006-08-18 03:14:03 +0600 (Птн, 18 Авг 2006) | 2 lines

Use OSAtomicAdd instead of OSAtomicDecrement to decrement the value by 1.

........
r40335 | mogorman | 2006-08-18 04:39:48 +0600 (Птн, 18 Авг 2006) | 3 lines

changes to configure to support older c-client than the
2004 version.

........
r40337 | mogorman | 2006-08-18 04:52:07 +0600 (Птн, 18 Авг 2006) | 3 lines

updating configure script and putting comments in the docs
in english. yay!

........
r40360 | murf | 2006-08-18 08:31:12 +0600 (Птн, 18 Авг 2006) | 3 lines

Updated this as per wishes of Kevin Fleming. Needs review. Any mistakes/misconceptions/glaring errors?


........

Modified:
    team/pcadach/chan_h323-live/   (props changed)
    team/pcadach/chan_h323-live/apps/app_voicemail.c
    team/pcadach/chan_h323-live/configure
    team/pcadach/chan_h323-live/configure.ac
    team/pcadach/chan_h323-live/doc/imapstorage.txt
    team/pcadach/chan_h323-live/doc/queues-with-callback-members.txt
    team/pcadach/chan_h323-live/include/asterisk/autoconfig.h.in
    team/pcadach/chan_h323-live/include/asterisk/lock.h

Propchange: team/pcadach/chan_h323-live/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/pcadach/chan_h323-live/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 17 22:42:17 2006
@@ -1,1 +1,1 @@
-/trunk:1-40299
+/trunk:1-40378

Modified: team/pcadach/chan_h323-live/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/apps/app_voicemail.c?rev=40379&r1=40378&r2=40379&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/apps/app_voicemail.c (original)
+++ team/pcadach/chan_h323-live/apps/app_voicemail.c Thu Aug 17 22:42:17 2006
@@ -6470,10 +6470,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/pcadach/chan_h323-live/configure
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/configure?rev=40379&r1=40378&r2=40379&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/configure (original)
+++ team/pcadach/chan_h323-live/configure Thu Aug 17 22:42:17 2006
@@ -4244,7 +4244,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 ;
@@ -14102,10 +14102,6 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include "c-client.h"
-int
-main ()
-{
-
 		void mm_searched (MAILSTREAM *stream,unsigned long number)
 		{
 		}
@@ -14151,10 +14147,11 @@
 		void mm_fatal (char *string)
 		{
 		}
-		int main()
-		{
+int
+main ()
+{
+
 		MAILSTREAM *foo = mail_open(NULL, "", 0);
-		}
 
 
   ;
@@ -14192,6 +14189,102 @@
 fi
 rm -f 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 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
@@ -14205,6 +14298,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/pcadach/chan_h323-live/configure.ac
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/configure.ac?rev=40379&r1=40378&r2=40379&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/configure.ac (original)
+++ team/pcadach/chan_h323-live/configure.ac Thu Aug 17 22:42:17 2006
@@ -349,62 +349,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
@@ -413,6 +467,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/pcadach/chan_h323-live/doc/imapstorage.txt
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/doc/imapstorage.txt?rev=40379&r1=40378&r2=40379&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/doc/imapstorage.txt (original)
+++ team/pcadach/chan_h323-live/doc/imapstorage.txt Thu Aug 17 22:42:17 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/pcadach/chan_h323-live/doc/queues-with-callback-members.txt
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/doc/queues-with-callback-members.txt?rev=40379&r1=40378&r2=40379&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/doc/queues-with-callback-members.txt (original)
+++ team/pcadach/chan_h323-live/doc/queues-with-callback-members.txt Thu Aug 17 22:42:17 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/pcadach/chan_h323-live/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/include/asterisk/autoconfig.h.in?rev=40379&r1=40378&r2=40379&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/include/asterisk/autoconfig.h.in (original)
+++ team/pcadach/chan_h323-live/include/asterisk/autoconfig.h.in Thu Aug 17 22:42:17 2006
@@ -123,6 +123,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/pcadach/chan_h323-live/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/include/asterisk/lock.h?rev=40379&r1=40378&r2=40379&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/include/asterisk/lock.h (original)
+++ team/pcadach/chan_h323-live/include/asterisk/lock.h Thu Aug 17 22:42:17 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