[asterisk-commits] russell: branch russell/events r127107 - in /team/russell/events: ./ build_to...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 1 14:30:27 CDT 2008


Author: russell
Date: Tue Jul  1 14:30:25 2008
New Revision: 127107

URL: http://svn.digium.com/view/asterisk?view=rev&rev=127107
Log:
resolve, reset

Modified:
    team/russell/events/   (props changed)
    team/russell/events/build_tools/menuselect-deps.in
    team/russell/events/channels/chan_iax2.c
    team/russell/events/configure
    team/russell/events/configure.ac
    team/russell/events/images/kpad2.jpg
    team/russell/events/include/asterisk/autoconfig.h.in
    team/russell/events/makeopts.in
    team/russell/events/res/Makefile
    team/russell/events/res/ais/ais.h
    team/russell/events/res/res_ais.c

Propchange: team/russell/events/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/russell/events/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

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

Propchange: team/russell/events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jul  1 14:30:25 2008
@@ -1,1 +1,1 @@
-/trunk:1-126984
+/trunk:1-127100

Modified: team/russell/events/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/russell/events/build_tools/menuselect-deps.in?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/build_tools/menuselect-deps.in (original)
+++ team/russell/events/build_tools/menuselect-deps.in Tue Jul  1 14:30:25 2008
@@ -30,8 +30,7 @@
 POPT=@PBX_POPT@
 PORTAUDIO=@PBX_PORTAUDIO@
 PRI=@PBX_PRI@
-SACLM=@PBX_SACLM@
-SAEVT=@PBX_SAEVT@
+AIS=@PBX_AIS@
 RADIUS=@PBX_RADIUS@
 SPANDSP=@PBX_SPANDSP@
 SPEEX=@PBX_SPEEX@

Modified: team/russell/events/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_iax2.c?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/channels/chan_iax2.c (original)
+++ team/russell/events/channels/chan_iax2.c Tue Jul  1 14:30:25 2008
@@ -1147,12 +1147,16 @@
 
 	ast_mutex_lock(&iaxsl[callno]);
 
-	while (iaxs[callno] && iaxs[callno]->pingid != -1) {
+	if (iaxs[callno]) {
 		if (iaxs[callno]->peercallno) {
 			send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
-		}
-		iaxs[callno]->pingid = iax2_sched_add(sched, ping_time * 1000, send_ping, data);
-		break;
+			iaxs[callno]->pingid = iax2_sched_add(sched, ping_time * 1000, send_ping, data);
+		} else {
+			/* I am the schedule, so I'm allowed to do this */
+			iaxs[callno]->pingid = -1;
+		}
+	} else if (option_debug > 0) {
+		ast_log(LOG_DEBUG, "I was supposed to send a PING with callno %d, but no such call exists (and I cannot remove pingid, either).\n", callno);
 	}
 
 	ast_mutex_unlock(&iaxsl[callno]);
@@ -1160,14 +1164,6 @@
 
 static int send_ping(const void *data)
 {
-	int callno = (long) data;
-
-	ast_mutex_lock(&iaxsl[callno]);
-	if (iaxs[callno]) {
-		iaxs[callno]->pingid = -1;
-	}
-	ast_mutex_unlock(&iaxsl[callno]);
-
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__send_ping, data))
 #endif		
@@ -1196,12 +1192,16 @@
 
 	ast_mutex_lock(&iaxsl[callno]);
 
-	while (iaxs[callno] && iaxs[callno]->lagid > -1) {
+	if (iaxs[callno]) {
 		if (iaxs[callno]->peercallno) {
 			send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_LAGRQ, 0, NULL, 0, -1);
-		}
-		iaxs[callno]->lagid = iax2_sched_add(sched, lagrq_time * 1000, send_lagrq, data);
-		break;
+			iaxs[callno]->lagid = iax2_sched_add(sched, lagrq_time * 1000, send_lagrq, data);
+		} else {
+			/* I am the schedule, so I'm allowed to do this */
+			iaxs[callno]->lagid = -1;
+		}
+	} else if (option_debug > 0) {
+		ast_log(LOG_DEBUG, "I was supposed to send a LAGRQ with callno %d, but no such call exists (and I cannot remove lagid, either).\n", callno);
 	}
 
 	ast_mutex_unlock(&iaxsl[callno]);
@@ -1209,14 +1209,6 @@
 
 static int send_lagrq(const void *data)
 {
-	int callno = (long) data;
-
-	ast_mutex_lock(&iaxsl[callno]);
-	if (iaxs[callno]) {
-		iaxs[callno]->lagid = -1;
-	}
-	ast_mutex_unlock(&iaxsl[callno]);
-
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__send_lagrq, data))
 #endif		
@@ -1569,13 +1561,19 @@
 	for (x = TRUNK_CALL_START; x < ARRAY_LEN(iaxs) - 1; x++) {
 		ast_mutex_lock(&iaxsl[x]);
 		if (!iaxs[x] && ((now.tv_sec - lastused[x].tv_sec) > MIN_REUSE_TIME)) {
+			/*!
+			 * \note We delete these before switching the slot, because if
+			 * they fire in the meantime, they will generate a warning.
+			 */
+			AST_SCHED_DEL(sched, iaxs[callno]->pingid);
+			AST_SCHED_DEL(sched, iaxs[callno]->lagid);
 			iaxs[x] = iaxs[callno];
 			iaxs[x]->callno = x;
 			iaxs[callno] = NULL;
 			/* Update the two timers that should have been started */
-			iaxs[x]->pingid = iax2_sched_replace(iaxs[x]->pingid, sched, 
+			iaxs[x]->pingid = iax2_sched_add(sched, 
 				ping_time * 1000, send_ping, (void *)(long)x);
-			iaxs[x]->lagid = iax2_sched_replace(iaxs[x]->lagid, sched, 
+			iaxs[x]->lagid = iax2_sched_add(sched, 
 				lagrq_time * 1000, send_lagrq, (void *)(long)x);
 			if (locked)
 				ast_mutex_unlock(&iaxsl[callno]);
@@ -1648,6 +1646,15 @@
 				pvt = NULL;
 				return res;
 			}
+		}
+
+		/* This will occur on the first response to a message that we initiated,
+		 * such as a PING. */
+		if (callno && dcallno && iaxs[dcallno] && !iaxs[dcallno]->peercallno && match(sin, callno, dcallno, iaxs[dcallno], check_dcallno)) {
+			iaxs[dcallno]->peercallno = callno;
+			res = dcallno;
+			store_by_peercallno(iaxs[dcallno]);
+			return res;
 		}
 
 		for (x = 1; !res && x < maxnontrunkcall; x++) {

Modified: team/russell/events/configure.ac
URL: http://svn.digium.com/view/asterisk/team/russell/events/configure.ac?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/configure.ac (original)
+++ team/russell/events/configure.ac Tue Jul  1 14:30:25 2008
@@ -241,8 +241,7 @@
 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
 AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
 AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image library], [SDL_image])
-AST_EXT_LIB_SETUP([SACLM], [SAForum AIS CLM], [SaClm])
-AST_EXT_LIB_SETUP([SAEVT], [SAForum AIS EVT], [SaEvt])
+AST_EXT_LIB_SETUP([OPENAIS], [OpenAIS], [openais])
 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
 AST_EXT_LIB_SETUP([SPEEXDSP], [Speexdsp], [speexdsp])
 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
@@ -1352,10 +1351,31 @@
 
 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
 
-AST_EXT_LIB_CHECK([SACLM], [SaClm], [saClmInitialize], [openais/saClm.h], [-L/usr/lib/openais])
-AST_EXT_LIB_CHECK([SACLM], [SaClm], [saClmInitialize], [openais/saClm.h])
-AST_EXT_LIB_CHECK([SAEVT], [SaEvt], [saEvtInitialize], [openais/saEvt.h], [-L/usr/lib/openais])
-AST_EXT_LIB_CHECK([SAEVT], [SaEvt], [saEvtInitialize], [openais/saEvt.h])
+# This is a bit complex... in reality, Asterisk's AIS support is dependent on finding
+# *any* implementation of AIS, not just OpenAIS. However, the configure script needs
+# to know the specifics of each possible implementation, and then represent the one
+# that was found as 'AIS'.
+
+PBX_AIS=0
+
+# OpenAIS installs its libraries into /usr/lib/openais by default, so check there
+
+AST_EXT_LIB_CHECK([OPENAIS], [SaClm], [saClmInitialize], [openais/saClm.h], [-L/usr/lib/openais])
+
+if test "${PBX_OPENAIS}" = 1; then
+   PBX_AIS=1
+   if test -n "${OPENAIS_DIR}"; then
+      AIS_INCLUDE="${OPENAIS_INCLUDE}/openais"
+      AIS_LIB="-lSaEvt ${OPENAIS_LIB}"
+   else
+      AIS_INCLUDE="-I/usr/include/openais"
+      AIS_LIB="-lSaClm -lSaEvt -L/usr/lib/openais"
+   fi
+fi
+
+AC_SUBST(PBX_AIS)
+AC_SUBST(AIS_INCLUDE)
+AC_SUBST(AIS_LIB)
 
 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
 

Modified: team/russell/events/images/kpad2.jpg
URL: http://svn.digium.com/view/asterisk/team/russell/events/images/kpad2.jpg?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
Binary files - no diff available.

Modified: team/russell/events/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/russell/events/include/asterisk/autoconfig.h.in?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/include/asterisk/autoconfig.h.in (original)
+++ team/russell/events/include/asterisk/autoconfig.h.in Tue Jul  1 14:30:25 2008
@@ -539,6 +539,12 @@
 /* Define to indicate the ${OGG_DESCRIP} library version */
 #undef HAVE_OGG_VERSION
 
+/* Define this to indicate the ${OPENAIS_DESCRIP} library */
+#undef HAVE_OPENAIS
+
+/* Define to indicate the ${OPENAIS_DESCRIP} library version */
+#undef HAVE_OPENAIS_VERSION
+
 /* Define if your system has the OpenH323 libraries. */
 #undef HAVE_OPENH323
 
@@ -691,18 +697,6 @@
 
 /* Define RTLD_NOLOAD headers version */
 #undef HAVE_RTLD_NOLOAD_VERSION
-
-/* Define this to indicate the ${SACLM_DESCRIP} library */
-#undef HAVE_SACLM
-
-/* Define to indicate the ${SACLM_DESCRIP} library version */
-#undef HAVE_SACLM_VERSION
-
-/* Define this to indicate the ${SAEVT_DESCRIP} library */
-#undef HAVE_SAEVT
-
-/* Define to indicate the ${SAEVT_DESCRIP} library version */
-#undef HAVE_SAEVT_VERSION
 
 /* Define to 1 if your system has /sbin/launchd. */
 #undef HAVE_SBIN_LAUNCHD
@@ -1179,6 +1173,9 @@
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
 
 /* Define like PROTOTYPES; this can be used by system headers. */
 #undef __PROTOTYPES

Modified: team/russell/events/makeopts.in
URL: http://svn.digium.com/view/asterisk/team/russell/events/makeopts.in?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/makeopts.in (original)
+++ team/russell/events/makeopts.in Tue Jul  1 14:30:25 2008
@@ -154,11 +154,8 @@
 PWLIB_INCLUDE=@PWLIB_INCLUDE@
 PWLIB_LIB=@PWLIB_LIB@
 
-SACLM_INCLUDE=@SACLM_INCLUDE@
-SACLM_LIB=@SACLM_LIB@
-
-SAEVT_INCLUDE=@SAEVT_INCLUDE@
-SAEVT_LIB=@SAEVT_LIB@
+AIS_INCLUDE=@AIS_INCLUDE@
+AIS_LIB=@AIS_LIB@
 
 RADIUS_INCLUDE=@RADIUS_INCLUDE@
 RADIUS_LIB=@RADIUS_LIB@

Modified: team/russell/events/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/events/res/Makefile?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/res/Makefile (original)
+++ team/russell/events/res/Makefile Tue Jul  1 14:30:25 2008
@@ -35,6 +35,8 @@
 ael/ael.tab.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
 ael/ael.tab.o: ASTCFLAGS+=-I. -Iael -DYYENABLE_NLS=0
 
+ais/clm.o ais/evt.o: ASTCFLAGS+=${AIS_INCLUDE}
+
 $(if $(filter res_ais,$(EMBEDDED_MODS)),modules.link,res_ais.so): ais/clm.o ais/evt.o
 
 $(if $(filter res_snmp,$(EMBEDDED_MODS)),modules.link,res_snmp.so): snmp/agent.o

Modified: team/russell/events/res/ais/ais.h
URL: http://svn.digium.com/view/asterisk/team/russell/events/res/ais/ais.h?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/res/ais/ais.h (original)
+++ team/russell/events/res/ais/ais.h Tue Jul  1 14:30:25 2008
@@ -25,15 +25,15 @@
  * \arg http://www.openais.org/
  */
 
-#ifndef AST_AIS_H
-#define AST_AIS_H
+#ifndef RES_AIS_AIS_H
+#define RES_AIS_AIS_H
 
-#include <openais/saAis.h>
-#include <openais/saAmf.h>
-#include <openais/saCkpt.h>
-#include <openais/saClm.h>
-#include <openais/saEvt.h>
-#include <openais/saLck.h>
+#include <saAis.h>
+#include <saClm.h>
+#include <saEvt.h>
+#include <saAis.h>
+#include <saAmf.h>
+#include <saLck.h>
 
 extern SaVersionT ais_version;
 
@@ -60,4 +60,4 @@
 
 const char *ais_err2str(SaAisErrorT error);
 
-#endif /* AST_AIS_H */
+#endif /* RES_AIS_AIS_H */

Modified: team/russell/events/res/res_ais.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/res/res_ais.c?view=diff&rev=127107&r1=127106&r2=127107
==============================================================================
--- team/russell/events/res/res_ais.c (original)
+++ team/russell/events/res/res_ais.c Tue Jul  1 14:30:25 2008
@@ -29,8 +29,7 @@
  */
 
 /*** MODULEINFO
-	<depend>SaClm</depend>
-	<depend>SaEvt</depend>
+	<depend>ais</depend>
  ***/
 
 #include "asterisk.h"




More information about the asterisk-commits mailing list