Revision
16921
Author
anthm
Date
2010-03-05 17:10:41 -0600 (Fri, 05 Mar 2010)

Log Message

fix esl sendevent issue and change the sendEvent method to return the reply text like sendRecv etc

Modified Paths

Diff

Modified: freeswitch/trunk/libs/esl/ESL.i (16920 => 16921)


--- freeswitch/trunk/libs/esl/ESL.i	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/ESL.i	2010-03-05 23:10:41 UTC (rev 16921)
@@ -10,6 +10,7 @@
 %newobject ::getInfo();
 %newobject ESLconnection::filter();
 %newobject ::recvEvent();
+%newobject ::sendEvent();
 %newobject ESLconnection::recvEventTimed();
 #else
 %newobject ESLconnection::sendRecv;
@@ -17,6 +18,7 @@
 %newobject ESLconnection::bgapi;
 %newobject ESLconnection::getInfo;
 %newobject ESLconnection::filter;
+%newobject ESLconnection::sendEvent;
 %newobject ESLconnection::recvEvent;
 %newobject ESLconnection::recvEventTimed;
 %newobject ESLconnection::execute;

Modified: freeswitch/trunk/libs/esl/java/esl_wrap.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/java/esl_wrap.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/java/esl_wrap.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -819,11 +819,11 @@
 }
 
 
-SWIGEXPORT jint JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1sendEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
-  jint jresult = 0 ;
+SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1sendEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
+  jlong jresult = 0 ;
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   ESLevent *arg2 = (ESLevent *) 0 ;
-  int result;
+  ESLevent *result = 0 ;
   
   (void)jenv;
   (void)jcls;
@@ -831,8 +831,8 @@
   (void)jarg2_;
   arg1 = *(ESLconnection **)&jarg1; 
   arg2 = *(ESLevent **)&jarg2; 
-  result = (int)(arg1)->sendEvent(arg2);
-  jresult = (jint)result; 
+  result = (ESLevent *)(arg1)->sendEvent(arg2);
+  *(ESLevent **)&jresult = result; 
   return jresult;
 }
 

Modified: freeswitch/trunk/libs/esl/java/org/freeswitch/esl/ESLconnection.java (16920 => 16921)


--- freeswitch/trunk/libs/esl/java/org/freeswitch/esl/ESLconnection.java	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/java/org/freeswitch/esl/ESLconnection.java	2010-03-05 23:10:41 UTC (rev 16921)
@@ -77,8 +77,9 @@
     return (cPtr == 0) ? null : new ESLevent(cPtr, true);
   }
 
-  public int sendEvent(ESLevent send_me) {
-    return eslJNI.ESLconnection_sendEvent(swigCPtr, this, ESLevent.getCPtr(send_me), send_me);
+  public ESLevent sendEvent(ESLevent send_me) {
+    long cPtr = eslJNI.ESLconnection_sendEvent(swigCPtr, this, ESLevent.getCPtr(send_me), send_me);
+    return (cPtr == 0) ? null : new ESLevent(cPtr, true);
   }
 
   public ESLevent recvEvent() {

Modified: freeswitch/trunk/libs/esl/java/org/freeswitch/esl/eslJNI.java (16920 => 16921)


--- freeswitch/trunk/libs/esl/java/org/freeswitch/esl/eslJNI.java	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/java/org/freeswitch/esl/eslJNI.java	2010-03-05 23:10:41 UTC (rev 16921)
@@ -40,7 +40,7 @@
   public final static native long ESLconnection_sendRecv(long jarg1, ESLconnection jarg1_, String jarg2);
   public final static native long ESLconnection_api(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
   public final static native long ESLconnection_bgapi(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
-  public final static native int ESLconnection_sendEvent(long jarg1, ESLconnection jarg1_, long jarg2, ESLevent jarg2_);
+  public final static native long ESLconnection_sendEvent(long jarg1, ESLconnection jarg1_, long jarg2, ESLevent jarg2_);
   public final static native long ESLconnection_recvEvent(long jarg1, ESLconnection jarg1_);
   public final static native long ESLconnection_recvEventTimed(long jarg1, ESLconnection jarg1_, int jarg2);
   public final static native long ESLconnection_filter(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);

Modified: freeswitch/trunk/libs/esl/lua/esl_wrap.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/lua/esl_wrap.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/lua/esl_wrap.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -2530,7 +2530,7 @@
   int SWIG_arg = -1;
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   ESLevent *arg2 = (ESLevent *) 0 ;
-  int result;
+  ESLevent *result = 0 ;
   
   SWIG_check_num_args("sendEvent",2,2)
   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"ESLconnection *");
@@ -2545,9 +2545,9 @@
     SWIG_fail_ptr("ESLconnection_sendEvent",2,SWIGTYPE_p_ESLevent);
   }
   
-  result = (int)(arg1)->sendEvent(arg2);
+  result = (ESLevent *)(arg1)->sendEvent(arg2);
   SWIG_arg=0;
-  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;

Modified: freeswitch/trunk/libs/esl/managed/ESLPINVOKE.cs (16920 => 16921)


--- freeswitch/trunk/libs/esl/managed/ESLPINVOKE.cs	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/managed/ESLPINVOKE.cs	2010-03-05 23:10:41 UTC (rev 16921)
@@ -278,7 +278,7 @@
   public static extern IntPtr ESLconnection_Bgapi(HandleRef jarg1, string jarg2, string jarg3);
 
   [DllImport("ESL", EntryPoint="CSharp_ESLconnection_SendEvent")]
-  public static extern int ESLconnection_SendEvent(HandleRef jarg1, HandleRef jarg2);
+  public static extern IntPtr ESLconnection_SendEvent(HandleRef jarg1, HandleRef jarg2);
 
   [DllImport("ESL", EntryPoint="CSharp_ESLconnection_RecvEvent")]
   public static extern IntPtr ESLconnection_RecvEvent(HandleRef jarg1);

Modified: freeswitch/trunk/libs/esl/managed/ESLconnection.cs (16920 => 16921)


--- freeswitch/trunk/libs/esl/managed/ESLconnection.cs	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/managed/ESLconnection.cs	2010-03-05 23:10:41 UTC (rev 16921)
@@ -86,8 +86,9 @@
     return ret;
   }
 
-  public int SendEvent(ESLevent send_me) {
-    int ret = ESLPINVOKE.ESLconnection_SendEvent(swigCPtr, ESLevent.getCPtr(send_me));
+  public ESLevent SendEvent(ESLevent send_me) {
+    IntPtr cPtr = ESLPINVOKE.ESLconnection_SendEvent(swigCPtr, ESLevent.getCPtr(send_me));
+    ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
     return ret;
   }
 

Modified: freeswitch/trunk/libs/esl/managed/esl_wrap.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/managed/esl_wrap.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/managed/esl_wrap.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -693,16 +693,16 @@
 }
 
 
-SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SendEvent(void * jarg1, void * jarg2) {
-  int jresult ;
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_SendEvent(void * jarg1, void * jarg2) {
+  void * jresult ;
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   ESLevent *arg2 = (ESLevent *) 0 ;
-  int result;
+  ESLevent *result = 0 ;
   
   arg1 = (ESLconnection *)jarg1; 
   arg2 = (ESLevent *)jarg2; 
-  result = (int)(arg1)->sendEvent(arg2);
-  jresult = result; 
+  result = (ESLevent *)(arg1)->sendEvent(arg2);
+  jresult = (void *)result; 
   return jresult;
 }
 

Modified: freeswitch/trunk/libs/esl/perl/esl_wrap.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/perl/esl_wrap.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/perl/esl_wrap.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -3123,7 +3123,7 @@
   {
     ESLconnection *arg1 = (ESLconnection *) 0 ;
     ESLevent *arg2 = (ESLevent *) 0 ;
-    int result;
+    ESLevent *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     void *argp2 = 0 ;
@@ -3144,8 +3144,8 @@
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_sendEvent" "', argument " "2"" of type '" "ESLevent *""'"); 
     }
     arg2 = reinterpret_cast< ESLevent * >(argp2);
-    result = (int)(arg1)->sendEvent(arg2);
-    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+    result = (ESLevent *)(arg1)->sendEvent(arg2);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     
     
     XSRETURN(argvi);

Modified: freeswitch/trunk/libs/esl/php/ESL.php (16920 => 16921)


--- freeswitch/trunk/libs/esl/php/ESL.php	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/php/ESL.php	2010-03-05 23:10:41 UTC (rev 16921)
@@ -161,7 +161,8 @@
 	}
 
 	function sendEvent($send_me) {
-		return ESLconnection_sendEvent($this->_cPtr,$send_me);
+		$r=ESLconnection_sendEvent($this->_cPtr,$send_me);
+		return is_resource($r) ? new ESLevent($r) : $r;
 	}
 
 	function recvEvent() {

Modified: freeswitch/trunk/libs/esl/php/esl_wrap.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/php/esl_wrap.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/php/esl_wrap.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -1091,7 +1091,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -1159,7 +1159,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
   convert_to_long_ex(args[1]);
   arg2 = (int) Z_LVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -1213,13 +1213,13 @@
   WRONG_PARAM_COUNT;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[0]);
   arg1 = (char *) Z_STRVAL_PP(args[0]);
   /*@SWIG@*/;
   
   if(arg_count > 1) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[1]);
     arg2 = (char *) Z_STRVAL_PP(args[1]);
     /*@SWIG@*/;
@@ -1254,7 +1254,7 @@
     }
   }
   if(arg_count > 1) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
     convert_to_long_ex(args[1]);
     arg2 = (int) Z_LVAL_PP(args[1]);
     /*@SWIG@*/;
@@ -1384,7 +1384,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   if(arg_count > 1) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[1]);
     arg2 = (char *) Z_STRVAL_PP(args[1]);
     /*@SWIG@*/;
@@ -1460,7 +1460,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -1557,7 +1557,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -1591,13 +1591,13 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[2]);
   arg3 = (char *) Z_STRVAL_PP(args[2]);
   /*@SWIG@*/;
@@ -1630,7 +1630,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -1719,25 +1719,25 @@
   }
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[0]);
   arg1 = (char *) Z_STRVAL_PP(args[0]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[2]);
   arg3 = (char *) Z_STRVAL_PP(args[2]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[3]);
   arg4 = (char *) Z_STRVAL_PP(args[3]);
   /*@SWIG@*/;
@@ -1765,19 +1765,19 @@
   }
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[0]);
   arg1 = (char *) Z_STRVAL_PP(args[0]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[2]);
   arg3 = (char *) Z_STRVAL_PP(args[2]);
   /*@SWIG@*/;
@@ -1803,7 +1803,7 @@
   }
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
   convert_to_long_ex(args[0]);
   arg1 = (int) Z_LVAL_PP(args[0]);
   /*@SWIG@*/;
@@ -1980,7 +1980,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -2013,7 +2013,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -2049,13 +2049,13 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   if(arg_count > 2) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[2]);
     arg3 = (char *) Z_STRVAL_PP(args[2]);
     /*@SWIG@*/;
@@ -2092,13 +2092,13 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   if(arg_count > 2) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[2]);
     arg3 = (char *) Z_STRVAL_PP(args[2]);
     /*@SWIG@*/;
@@ -2117,7 +2117,7 @@
 ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendEvent) {
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   ESLevent *arg2 = (ESLevent *) 0 ;
-  int result;
+  ESLevent *result = 0 ;
   zval **args[2];
   
   SWIG_ResetError();
@@ -2136,9 +2136,9 @@
       SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLconnection_sendEvent. Expected SWIGTYPE_p_ESLevent");
     }
   }
-  result = (int)(arg1)->sendEvent(arg2);
+  result = (ESLevent *)(arg1)->sendEvent(arg2);
   {
-    ZVAL_LONG(return_value,result);
+    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0);
   }
   return;
 fail:
@@ -2190,7 +2190,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
   convert_to_long_ex(args[1]);
   arg2 = (int) Z_LVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -2224,13 +2224,13 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[2]);
   arg3 = (char *) Z_STRVAL_PP(args[2]);
   /*@SWIG@*/;
@@ -2264,13 +2264,13 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[2]);
   arg3 = (char *) Z_STRVAL_PP(args[2]);
   /*@SWIG@*/;
@@ -2307,20 +2307,20 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   if(arg_count > 2) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[2]);
     arg3 = (char *) Z_STRVAL_PP(args[2]);
     /*@SWIG@*/;
     
   }
   if(arg_count > 3) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[3]);
     arg4 = (char *) Z_STRVAL_PP(args[3]);
     /*@SWIG@*/;
@@ -2358,20 +2358,20 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
   if(arg_count > 2) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[2]);
     arg3 = (char *) Z_STRVAL_PP(args[2]);
     /*@SWIG@*/;
     
   }
   if(arg_count > 3) {
-    /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+    /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
     convert_to_string_ex(args[3]);
     arg4 = (char *) Z_STRVAL_PP(args[3]);
     /*@SWIG@*/;
@@ -2405,7 +2405,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -2438,7 +2438,7 @@
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
   convert_to_string_ex(args[1]);
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
@@ -2489,7 +2489,7 @@
   }
   
   
-  /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+  /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
   convert_to_long_ex(args[0]);
   arg1 = (int) Z_LVAL_PP(args[0]);
   /*@SWIG@*/;

Modified: freeswitch/trunk/libs/esl/python/esl_wrap.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/python/esl_wrap.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/python/esl_wrap.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -4205,7 +4205,7 @@
   PyObject *resultobj = 0;
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   ESLevent *arg2 = (ESLevent *) 0 ;
-  int result;
+  ESLevent *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -4227,10 +4227,10 @@
   arg2 = reinterpret_cast< ESLevent * >(argp2);
   {
     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
-    result = (int)(arg1)->sendEvent(arg2);
+    result = (ESLevent *)(arg1)->sendEvent(arg2);
     SWIG_PYTHON_THREAD_END_ALLOW;
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN |  0 );
   SWIG_PYTHON_THREAD_END_BLOCK;
   return resultobj;
 fail:

Modified: freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -1902,7 +1902,7 @@
 } 
 
 
-/*@SWIG:/usr/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
+/*@SWIG:/usr/local/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
 SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
 {
   VALUE obj = args[0];
@@ -3102,7 +3102,7 @@
 _wrap_ESLconnection_sendEvent(int argc, VALUE *argv, VALUE self) {
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   ESLevent *arg2 = (ESLevent *) 0 ;
-  int result;
+  ESLevent *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -3122,8 +3122,8 @@
     SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "ESLevent *","sendEvent", 2, argv[0] )); 
   }
   arg2 = reinterpret_cast< ESLevent * >(argp2);
-  result = (int)(arg1)->sendEvent(arg2);
-  vresult = SWIG_From_int(static_cast< int >(result));
+  result = (ESLevent *)(arg1)->sendEvent(arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN |  0 );
   return vresult;
 fail:
   return Qnil;

Modified: freeswitch/trunk/libs/esl/src/esl.c (16920 => 16921)


--- freeswitch/trunk/libs/esl/src/esl.c	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/src/esl.c	2010-03-05 23:10:41 UTC (rev 16921)
@@ -453,15 +453,13 @@
 		
 	snprintf(event_buf, sizeof(event_buf), "sendevent %s\n", esl_event_name(event->event_id));
 	
-	if (send(handle->sock, event_buf, strlen(event_buf), 0)) goto fail;
-	if (send(handle->sock, txt, strlen(txt), 0)) goto fail;
-	if (send(handle->sock, "\n\n", 2, 0)) goto fail;
+	if (send(handle->sock, event_buf, strlen(event_buf), 0) <= 0) goto fail;
+	if (send(handle->sock, txt, strlen(txt), 0) <= 0) goto fail;
 	
 	free(txt);
 
-	return ESL_SUCCESS;
+	return esl_recv(handle);
 
-
  fail:
 
 	handle->connected = 0;

Modified: freeswitch/trunk/libs/esl/src/esl_oop.cpp (16920 => 16921)


--- freeswitch/trunk/libs/esl/src/esl_oop.cpp	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/src/esl_oop.cpp	2010-03-05 23:10:41 UTC (rev 16921)
@@ -186,9 +186,18 @@
 	return NULL;
 }
 
-int ESLconnection::sendEvent(ESLevent *send_me)
+ESLevent *ESLconnection::sendEvent(ESLevent *send_me)
 {
-	return esl_sendevent(&handle, send_me->event);
+	if (esl_sendevent(&handle, send_me->event) == ESL_SUCCESS) {
+		esl_event_t *e = handle.last_ievent ? handle.last_ievent : handle.last_event;
+		if (e) {
+			esl_event_t *event;
+			esl_event_dup(&event, e);
+			return new ESLevent(event, 1);
+		}
+	}
+
+	return new ESLevent("server_disconnected");
 }
 
 ESLevent *ESLconnection::recvEvent()

Modified: freeswitch/trunk/libs/esl/src/include/esl.h (16920 => 16921)


--- freeswitch/trunk/libs/esl/src/include/esl.h	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/src/include/esl.h	2010-03-05 23:10:41 UTC (rev 16921)
@@ -198,6 +198,7 @@
 #define esl_safe_free(_x) if (_x) free(_x); _x = NULL
 #define esl_strlen_zero(s) (!s || *(s) == '\0')
 #define esl_strlen_zero_buf(s) (*(s) == '\0')
+#define end_of(_s) *(*_s == '\0' ? _s : _s + strlen(_s) - 1)
 
 #ifdef WIN32
 #include <winsock2.h>

Modified: freeswitch/trunk/libs/esl/src/include/esl_oop.h (16920 => 16921)


--- freeswitch/trunk/libs/esl/src/include/esl_oop.h	2010-03-05 22:05:27 UTC (rev 16920)
+++ freeswitch/trunk/libs/esl/src/include/esl_oop.h	2010-03-05 23:10:41 UTC (rev 16921)
@@ -83,7 +83,7 @@
 	ESLevent *sendRecv(const char *cmd);
 	ESLevent *api(const char *cmd, const char *arg = NULL);
 	ESLevent *bgapi(const char *cmd, const char *arg = NULL);
-	int sendEvent(ESLevent *send_me);
+	ESLevent *sendEvent(ESLevent *send_me);
 	ESLevent *recvEvent();
 	ESLevent *recvEventTimed(int ms);
 	ESLevent *filter(const char *header, const char *value);