[Freeswitch-svn] [commit] r12086 - in freeswitch/trunk: libs/esl/perl libs/esl/src libs/esl/src/include libs/speex src/mod/event_handlers/mod_event_socket

FreeSWITCH SVN anthm at freeswitch.org
Tue Feb 17 06:13:32 PST 2009


Author: anthm
Date: Tue Feb 17 08:13:32 2009
New Revision: 12086

Log:
add some stuff to esl

Modified:
   freeswitch/trunk/libs/esl/perl/ESL.pm
   freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
   freeswitch/trunk/libs/esl/src/esl.c
   freeswitch/trunk/libs/esl/src/esl_oop.cpp
   freeswitch/trunk/libs/esl/src/include/esl.h
   freeswitch/trunk/libs/esl/src/include/esl_oop.h
   freeswitch/trunk/libs/speex/config.h.in
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c

Modified: freeswitch/trunk/libs/esl/perl/ESL.pm
==============================================================================
--- freeswitch/trunk/libs/esl/perl/ESL.pm	(original)
+++ freeswitch/trunk/libs/esl/perl/ESL.pm	Tue Feb 17 08:13:32 2009
@@ -135,6 +135,8 @@
 *filter = *ESLc::eslConnection_filter;
 *events = *ESLc::eslConnection_events;
 *execute = *ESLc::eslConnection_execute;
+*setBlockingExecute = *ESLc::eslConnection_setBlockingExecute;
+*setEventLock = *ESLc::eslConnection_setEventLock;
 sub DISOWN {
     my $self = shift;
     my $ptr = tied(%$self);

Modified: freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/perl/esl_wrap.cpp	(original)
+++ freeswitch/trunk/libs/esl/perl/esl_wrap.cpp	Tue Feb 17 08:13:32 2009
@@ -2981,8 +2981,8 @@
   {
     eslConnection *arg1 = (eslConnection *) 0 ;
     char *arg2 = (char *) 0 ;
-    char *arg3 = (char *) 0 ;
-    char *arg4 = (char *) 0 ;
+    char *arg3 = (char *) NULL ;
+    char *arg4 = (char *) NULL ;
     esl_status_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
@@ -2998,7 +2998,7 @@
     int argvi = 0;
     dXSARGS;
     
-    if ((items < 4) || (items > 4)) {
+    if ((items < 2) || (items > 4)) {
       SWIG_croak("Usage: eslConnection_execute(self,app,arg,uuid);");
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_eslConnection, 0 |  0 );
@@ -3011,16 +3011,20 @@
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "eslConnection_execute" "', argument " "2"" of type '" "char const *""'");
     }
     arg2 = reinterpret_cast< char * >(buf2);
-    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
-    if (!SWIG_IsOK(res3)) {
-      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "eslConnection_execute" "', argument " "3"" of type '" "char const *""'");
-    }
-    arg3 = reinterpret_cast< char * >(buf3);
-    res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "eslConnection_execute" "', argument " "4"" of type '" "char const *""'");
+    if (items > 2) {
+      res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+      if (!SWIG_IsOK(res3)) {
+        SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "eslConnection_execute" "', argument " "3"" of type '" "char const *""'");
+      }
+      arg3 = reinterpret_cast< char * >(buf3);
+    }
+    if (items > 3) {
+      res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+      if (!SWIG_IsOK(res4)) {
+        SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "eslConnection_execute" "', argument " "4"" of type '" "char const *""'");
+      }
+      arg4 = reinterpret_cast< char * >(buf4);
     }
-    arg4 = reinterpret_cast< char * >(buf4);
     result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
     ST(argvi) = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN | 0); argvi++ ;
     
@@ -3038,6 +3042,84 @@
 }
 
 
+XS(_wrap_eslConnection_setBlockingExecute) {
+  {
+    eslConnection *arg1 = (eslConnection *) 0 ;
+    char *arg2 = (char *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: eslConnection_setBlockingExecute(self,val);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_eslConnection, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "eslConnection_setBlockingExecute" "', argument " "1"" of type '" "eslConnection *""'"); 
+    }
+    arg1 = reinterpret_cast< eslConnection * >(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "eslConnection_setBlockingExecute" "', argument " "2"" of type '" "char const *""'");
+    }
+    arg2 = reinterpret_cast< char * >(buf2);
+    result = (int)(arg1)->setBlockingExecute((char const *)arg2);
+    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+    
+    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_eslConnection_setEventLock) {
+  {
+    eslConnection *arg1 = (eslConnection *) 0 ;
+    char *arg2 = (char *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: eslConnection_setEventLock(self,val);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_eslConnection, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "eslConnection_setEventLock" "', argument " "1"" of type '" "eslConnection *""'"); 
+    }
+    arg1 = reinterpret_cast< eslConnection * >(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "eslConnection_setEventLock" "', argument " "2"" of type '" "char const *""'");
+    }
+    arg2 = reinterpret_cast< char * >(buf2);
+    result = (int)(arg1)->setEventLock((char const *)arg2);
+    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+    
+    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+    SWIG_croak_null();
+  }
+}
+
+
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
@@ -3114,6 +3196,8 @@
 {"ESLc::eslConnection_filter", _wrap_eslConnection_filter},
 {"ESLc::eslConnection_events", _wrap_eslConnection_events},
 {"ESLc::eslConnection_execute", _wrap_eslConnection_execute},
+{"ESLc::eslConnection_setBlockingExecute", _wrap_eslConnection_setBlockingExecute},
+{"ESLc::eslConnection_setEventLock", _wrap_eslConnection_setEventLock},
 {0,0}
 };
 /* -----------------------------------------------------------------------------

Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl.c	Tue Feb 17 08:13:32 2009
@@ -450,6 +450,8 @@
 	char cmd_buf[128] = "sendmsg";
 	char app_buf[512] = "";
 	char arg_buf[512] = "";
+	const char *el_buf = "event-lock: true\n";
+	const char *bl_buf = "blocking: true\n";
 	char send_buf[1292] = "";
 	
 	if (!handle->connected) {
@@ -468,7 +470,8 @@
 		snprintf(arg_buf, sizeof(arg_buf), "execute-app-arg: %s\n", arg);
 	}
 
-	snprintf(send_buf, sizeof(send_buf), "%s\ncall-command: execute\n%s%s\n", cmd_buf, app_buf, arg_buf);
+	snprintf(send_buf, sizeof(send_buf), "%s\ncall-command: execute\n%s%s%s%s\n", 
+			 cmd_buf, app_buf, arg_buf, handle->event_lock ? el_buf : NULL, handle->blocking_execute ? bl_buf : NULL);
 
 	return esl_send_recv(handle, send_buf);
 }

Modified: freeswitch/trunk/libs/esl/src/esl_oop.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_oop.cpp	(original)
+++ freeswitch/trunk/libs/esl/src/esl_oop.cpp	Tue Feb 17 08:13:32 2009
@@ -60,6 +60,22 @@
 	return NULL;
 }
 
+int eslConnection::setBlockingExecute(const char *val)
+{
+	if (val) {
+		handle.blocking_execute = esl_true(val);
+	}
+	return handle.blocking_execute;
+}
+
+int eslConnection::setEventLock(const char *val)
+{
+	if (val) {
+		handle.event_lock = esl_true(val);
+	}
+	return handle.event_lock;
+}
+
 esl_status_t eslConnection::execute(const char *app, const char *arg, const char *uuid)
 {
 	return esl_execute(&handle, app, arg, uuid);

Modified: freeswitch/trunk/libs/esl/src/include/esl.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl.h	(original)
+++ freeswitch/trunk/libs/esl/src/include/esl.h	Tue Feb 17 08:13:32 2009
@@ -270,6 +270,8 @@
 	int connected;
 	struct sockaddr_in addr;
 	esl_mutex_t *mutex;
+	int blocking_execute;
+	int event_lock;
 } esl_handle_t;
 
 typedef enum {

Modified: freeswitch/trunk/libs/esl/src/include/esl_oop.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl_oop.h	(original)
+++ freeswitch/trunk/libs/esl/src/include/esl_oop.h	Tue Feb 17 08:13:32 2009
@@ -83,7 +83,9 @@
 	eslEvent *recvEventTimed(int ms);
 	esl_status_t filter(const char *header, const char *value);
 	esl_status_t events(const char *etype, const char *value);
-	esl_status_t execute(const char *app, const char *arg, const char *uuid);
+	esl_status_t execute(const char *app, const char *arg = NULL, const char *uuid = NULL);
+	int setBlockingExecute(const char *val);
+	int setEventLock(const char *val);
 };
 
 

Modified: freeswitch/trunk/libs/speex/config.h.in
==============================================================================
--- freeswitch/trunk/libs/speex/config.h.in	(original)
+++ freeswitch/trunk/libs/speex/config.h.in	Tue Feb 17 08:13:32 2009
@@ -96,13 +96,13 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* The size of `int', as computed by sizeof. */
+/* The size of a `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
-/* The size of `long', as computed by sizeof. */
+/* The size of a `long', as computed by sizeof. */
 #undef SIZEOF_LONG
 
-/* The size of `short', as computed by sizeof. */
+/* The size of a `short', as computed by sizeof. */
 #undef SIZEOF_SHORT
 
 /* Version extra */
@@ -129,12 +129,6 @@
 /* Make use of alloca */
 #undef USE_ALLOCA
 
-/* Use FFTW3 for FFT */
-#undef USE_GPL_FFTW3
-
-/* Use Intel Math Kernel Library for FFT */
-#undef USE_INTEL_MKL
-
 /* Use KISS Fast Fourier Transform */
 #undef USE_KISS_FFT
 

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Tue Feb 17 08:13:32 2009
@@ -1470,7 +1470,14 @@
 		}
 
 		if (switch_strlen_zero(uuid) && listener->session) {
-			if (switch_test_flag(listener, LFLAG_ASYNC)) {
+			const char *blocking = switch_event_get_header(*event, "blocking");
+			int async = switch_test_flag(listener, LFLAG_ASYNC);
+			
+			if (blocking && switch_true(blocking)) {
+				async = 0;
+			}
+
+			if (async) {
 				if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) {
 					switch_snprintf(reply, reply_len, "+OK");
 				} else {



More information about the Freeswitch-svn mailing list