[Freeswitch-svn] [commit] r12121 - in freeswitch/trunk/libs/esl: . lua perl php python ruby src src/include

FreeSWITCH SVN anthm at freeswitch.org
Tue Feb 17 15:18:28 PST 2009


Author: anthm
Date: Tue Feb 17 17:18:28 2009
New Revision: 12121

Log:
add work-around for php

Modified:
   freeswitch/trunk/libs/esl/ESL.i
   freeswitch/trunk/libs/esl/lua/esl_wrap.cpp
   freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
   freeswitch/trunk/libs/esl/php/ESL.php
   freeswitch/trunk/libs/esl/php/esl_wrap.cpp
   freeswitch/trunk/libs/esl/php/test.php
   freeswitch/trunk/libs/esl/python/esl_wrap.cpp
   freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp
   freeswitch/trunk/libs/esl/src/esl_oop.cpp
   freeswitch/trunk/libs/esl/src/include/esl_oop.h

Modified: freeswitch/trunk/libs/esl/ESL.i
==============================================================================
--- freeswitch/trunk/libs/esl/ESL.i	(original)
+++ freeswitch/trunk/libs/esl/ESL.i	Tue Feb 17 17:18:28 2009
@@ -3,46 +3,5 @@
 #include "esl_oop.h"
 %}
 
-class ESLevent {
- public:
-	esl_event_t *event;
-	char *serialized_string;
-	int mine;
-	ESLevent(const char *type, const char *subclass_name = NULL);
-	virtual ~ESLevent();
-	const char *serialize(const char *format = NULL);
-	bool setPriority(esl_priority_t priority = ESL_PRIORITY_NORMAL);
-	const char *getHeader(char *header_name);
-	char *getBody(void);
-	const char *getType(void);
-	bool addBody(const char *value);
-	bool addHeader(const char *header_name, const char *value);
-	bool delHeader(const char *header_name);
-};
-
-
-
-class ESLconnection {
- private:
-	esl_handle_t handle;
-	ESLevent *last_event_obj;
- public:
-	ESLconnection(const char *host, const char *port, const char *password);
-	ESLconnection(int socket);
-	virtual ~ESLconnection();
-	int connected();
-	ESLevent *getInfo();
-	esl_status_t send(const char *cmd);
-	ESLevent *sendRecv(const char *cmd);
-	esl_status_t sendEvent(ESLevent *send_me);
-	ESLevent *recvEvent();
-	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 = NULL, const char *uuid = NULL);
-	int setBlockingExecute(const char *val);
-	int setEventLock(const char *val);
-};
-
-void eslSetLogLevel(int level);
 
+%include "esl_oop.h"

Modified: freeswitch/trunk/libs/esl/lua/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/lua/esl_wrap.cpp	(original)
+++ freeswitch/trunk/libs/esl/lua/esl_wrap.cpp	Tue Feb 17 17:18:28 2009
@@ -1687,14 +1687,16 @@
 static int _wrap_new_ESLevent__SWIG_0(lua_State* L) {
   int SWIG_arg = -1;
   char *arg1 = (char *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   ESLevent *result = 0 ;
   
-  SWIG_check_num_args("ESLevent",2,2)
+  SWIG_check_num_args("ESLevent",1,2)
   if(!lua_isstring(L,1)) SWIG_fail_arg("ESLevent",1,"char const *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("ESLevent",2,"char const *");
+  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("ESLevent",2,"char const *");
   arg1 = (char *)lua_tostring(L, 1);
-  arg2 = (char *)lua_tostring(L, 2);
+  if(lua_gettop(L)>=2){
+    arg2 = (char *)lua_tostring(L, 2);
+  }
   result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
   SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++; 
@@ -1710,13 +1712,47 @@
 
 static int _wrap_new_ESLevent__SWIG_1(lua_State* L) {
   int SWIG_arg = -1;
-  char *arg1 = (char *) 0 ;
+  esl_event_t *arg1 = (esl_event_t *) 0 ;
+  int arg2 = (int) 0 ;
+  ESLevent *result = 0 ;
+  
+  SWIG_check_num_args("ESLevent",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent",1,"esl_event_t *");
+  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("ESLevent",2,"int");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_esl_event_t,0))){
+    SWIG_fail_ptr("new_ESLevent",1,SWIGTYPE_p_esl_event_t);
+  }
+  
+  if(lua_gettop(L)>=2){
+    arg2 = (int)lua_tonumber(L, 2);
+  }
+  result = (ESLevent *)new ESLevent(arg1,arg2);
+  SWIG_arg=0;
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++; 
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
+static int _wrap_new_ESLevent__SWIG_2(lua_State* L) {
+  int SWIG_arg = -1;
+  ESLevent *arg1 = (ESLevent *) 0 ;
   ESLevent *result = 0 ;
   
   SWIG_check_num_args("ESLevent",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("ESLevent",1,"char const *");
-  arg1 = (char *)lua_tostring(L, 1);
-  result = (ESLevent *)new ESLevent((char const *)arg1);
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent",1,"ESLevent *");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
+    SWIG_fail_ptr("new_ESLevent",1,SWIGTYPE_p_ESLevent);
+  }
+  
+  result = (ESLevent *)new ESLevent(arg1);
   SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++; 
   return SWIG_arg;
@@ -1736,21 +1772,51 @@
   };
   
   argc = lua_gettop(L);
+  if ((argc >= 1) && (argc <= 2)) {
+    int _v;
+    {
+      void *ptr;
+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_esl_event_t, 0)) {
+        _v = 0;
+      } else {
+        _v = 1;
+      }
+    }
+    if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_1(L);
+      }
+      {
+        _v = lua_isnumber(L,argv[1]);
+      }
+      if (_v) {
+        return _wrap_new_ESLevent__SWIG_1(L);
+      }
+    }
+  }
   if (argc == 1) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      void *ptr;
+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLevent, 0)) {
+        _v = 0;
+      } else {
+        _v = 1;
+      }
     }
     if (_v) {
-      return _wrap_new_ESLevent__SWIG_1(L);
+      return _wrap_new_ESLevent__SWIG_2(L);
     }
   }
-  if (argc == 2) {
+  if ((argc >= 1) && (argc <= 2)) {
     int _v;
     {
       _v = lua_isstring(L,argv[0]);
     }
     if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_0(L);
+      }
       {
         _v = lua_isstring(L,argv[1]);
       }
@@ -1790,47 +1856,24 @@
 }
 
 
-static int _wrap_ESLevent_serialize__SWIG_0(lua_State* L) {
+static int _wrap_ESLevent_serialize(lua_State* L) {
   int SWIG_arg = -1;
   ESLevent *arg1 = (ESLevent *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   char *result = 0 ;
   
-  SWIG_check_num_args("serialize",2,2)
+  SWIG_check_num_args("serialize",1,2)
   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"ESLevent *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *");
+  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
     SWIG_fail_ptr("ESLevent_serialize",1,SWIGTYPE_p_ESLevent);
   }
   
-  arg2 = (char *)lua_tostring(L, 2);
-  result = (char *)(arg1)->serialize((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
-static int _wrap_ESLevent_serialize__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  char *result = 0 ;
-  
-  SWIG_check_num_args("serialize",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"ESLevent *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
-    SWIG_fail_ptr("ESLevent_serialize",1,SWIGTYPE_p_ESLevent);
+  if(lua_gettop(L)>=2){
+    arg2 = (char *)lua_tostring(L, 2);
   }
-  
-  result = (char *)(arg1)->serialize();
+  result = (char *)(arg1)->serialize((char const *)arg2);
   SWIG_arg=0;
   lua_pushstring(L,(const char*)result); SWIG_arg++;
   return SWIG_arg;
@@ -1843,73 +1886,27 @@
 }
 
 
-static int _wrap_ESLevent_serialize(lua_State* L) {
-  int argc;
-  int argv[3]={
-    1,2,3
-  };
-  
-  argc = lua_gettop(L);
-  if (argc == 1) {
-    int _v;
-    {
-      void *ptr;
-      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLevent, 0)) {
-        _v = 0;
-      } else {
-        _v = 1;
-      }
-    }
-    if (_v) {
-      return _wrap_ESLevent_serialize__SWIG_1(L);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    {
-      void *ptr;
-      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLevent, 0)) {
-        _v = 0;
-      } else {
-        _v = 1;
-      }
-    }
-    if (_v) {
-      {
-        _v = lua_isstring(L,argv[1]);
-      }
-      if (_v) {
-        return _wrap_ESLevent_serialize__SWIG_0(L);
-      }
-    }
-  }
-  
-  lua_pushstring(L,"No matching function for overloaded 'ESLevent_serialize'");
-  lua_error(L);return 0;
-}
-
-
-static int _wrap_ESLevent_setPriority__SWIG_0(lua_State* L) {
+static int _wrap_ESLevent_setPriority(lua_State* L) {
   int SWIG_arg = -1;
   ESLevent *arg1 = (ESLevent *) 0 ;
-  esl_priority_t arg2 ;
+  esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
   bool result;
   esl_priority_t *argp2 ;
   
-  SWIG_check_num_args("setPriority",2,2)
+  SWIG_check_num_args("setPriority",1,2)
   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"ESLevent *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"esl_priority_t");
+  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"esl_priority_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
     SWIG_fail_ptr("ESLevent_setPriority",1,SWIGTYPE_p_ESLevent);
   }
   
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_esl_priority_t,0))){
-    SWIG_fail_ptr("ESLevent_setPriority",2,SWIGTYPE_p_esl_priority_t);
+  if(lua_gettop(L)>=2){
+    if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_esl_priority_t,0))){
+      SWIG_fail_ptr("ESLevent_setPriority",2,SWIGTYPE_p_esl_priority_t);
+    }
+    arg2 = *argp2;
   }
-  arg2 = *argp2;
-  
   result = (bool)(arg1)->setPriority(arg2);
   SWIG_arg=0;
   lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
@@ -1923,82 +1920,6 @@
 }
 
 
-static int _wrap_ESLevent_setPriority__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  bool result;
-  
-  SWIG_check_num_args("setPriority",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"ESLevent *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
-    SWIG_fail_ptr("ESLevent_setPriority",1,SWIGTYPE_p_ESLevent);
-  }
-  
-  result = (bool)(arg1)->setPriority();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
-static int _wrap_ESLevent_setPriority(lua_State* L) {
-  int argc;
-  int argv[3]={
-    1,2,3
-  };
-  
-  argc = lua_gettop(L);
-  if (argc == 1) {
-    int _v;
-    {
-      void *ptr;
-      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLevent, 0)) {
-        _v = 0;
-      } else {
-        _v = 1;
-      }
-    }
-    if (_v) {
-      return _wrap_ESLevent_setPriority__SWIG_1(L);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    {
-      void *ptr;
-      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLevent, 0)) {
-        _v = 0;
-      } else {
-        _v = 1;
-      }
-    }
-    if (_v) {
-      {
-        void *ptr;
-        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_esl_priority_t, 0)) {
-          _v = 0;
-        } else {
-          _v = 1;
-        }
-      }
-      if (_v) {
-        return _wrap_ESLevent_setPriority__SWIG_0(L);
-      }
-    }
-  }
-  
-  lua_pushstring(L,"No matching function for overloaded 'ESLevent_setPriority'");
-  lua_error(L);return 0;
-}
-
-
 static int _wrap_ESLevent_getHeader(lua_State* L) {
   int SWIG_arg = -1;
   ESLevent *arg1 = (ESLevent *) 0 ;
@@ -2568,93 +2489,32 @@
 }
 
 
-static int _wrap_ESLconnection_execute__SWIG_0(lua_State* L) {
+static int _wrap_ESLconnection_execute(lua_State* L) {
   int SWIG_arg = -1;
   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;
   
-  SWIG_check_num_args("execute",4,4)
+  SWIG_check_num_args("execute",2,4)
   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"ESLconnection *");
   if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("execute",4,"char const *");
+  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("execute",4,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
     SWIG_fail_ptr("ESLconnection_execute",1,SWIGTYPE_p_ESLconnection);
   }
   
   arg2 = (char *)lua_tostring(L, 2);
-  arg3 = (char *)lua_tostring(L, 3);
-  arg4 = (char *)lua_tostring(L, 4);
-  result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
-  SWIG_arg=0;
-  {
-    esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
-    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+  if(lua_gettop(L)>=3){
+    arg3 = (char *)lua_tostring(L, 3);
   }
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
-static int _wrap_ESLconnection_execute__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  char *arg3 = (char *) 0 ;
-  esl_status_t result;
-  
-  SWIG_check_num_args("execute",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"ESLconnection *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
-    SWIG_fail_ptr("ESLconnection_execute",1,SWIGTYPE_p_ESLconnection);
-  }
-  
-  arg2 = (char *)lua_tostring(L, 2);
-  arg3 = (char *)lua_tostring(L, 3);
-  result = (arg1)->execute((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
-  {
-    esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
-    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+  if(lua_gettop(L)>=4){
+    arg4 = (char *)lua_tostring(L, 4);
   }
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
-static int _wrap_ESLconnection_execute__SWIG_2(lua_State* L) {
-  int SWIG_arg = -1;
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  esl_status_t result;
-  
-  SWIG_check_num_args("execute",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"ESLconnection *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
-    SWIG_fail_ptr("ESLconnection_execute",1,SWIGTYPE_p_ESLconnection);
-  }
-  
-  arg2 = (char *)lua_tostring(L, 2);
-  result = (arg1)->execute((char const *)arg2);
+  result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
   SWIG_arg=0;
   {
     esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
@@ -2670,91 +2530,6 @@
 }
 
 
-static int _wrap_ESLconnection_execute(lua_State* L) {
-  int argc;
-  int argv[5]={
-    1,2,3,4,5
-  };
-  
-  argc = lua_gettop(L);
-  if (argc == 2) {
-    int _v;
-    {
-      void *ptr;
-      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLconnection, 0)) {
-        _v = 0;
-      } else {
-        _v = 1;
-      }
-    }
-    if (_v) {
-      {
-        _v = lua_isstring(L,argv[1]);
-      }
-      if (_v) {
-        return _wrap_ESLconnection_execute__SWIG_2(L);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    {
-      void *ptr;
-      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLconnection, 0)) {
-        _v = 0;
-      } else {
-        _v = 1;
-      }
-    }
-    if (_v) {
-      {
-        _v = lua_isstring(L,argv[1]);
-      }
-      if (_v) {
-        {
-          _v = lua_isstring(L,argv[2]);
-        }
-        if (_v) {
-          return _wrap_ESLconnection_execute__SWIG_1(L);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    {
-      void *ptr;
-      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLconnection, 0)) {
-        _v = 0;
-      } else {
-        _v = 1;
-      }
-    }
-    if (_v) {
-      {
-        _v = lua_isstring(L,argv[1]);
-      }
-      if (_v) {
-        {
-          _v = lua_isstring(L,argv[2]);
-        }
-        if (_v) {
-          {
-            _v = lua_isstring(L,argv[3]);
-          }
-          if (_v) {
-            return _wrap_ESLconnection_execute__SWIG_0(L);
-          }
-        }
-      }
-    }
-  }
-  
-  lua_pushstring(L,"No matching function for overloaded 'ESLconnection_execute'");
-  lua_error(L);return 0;
-}
-
-
 static int _wrap_ESLconnection_setBlockingExecute(lua_State* L) {
   int SWIG_arg = -1;
   ESLconnection *arg1 = (ESLconnection *) 0 ;

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 17:18:28 2009
@@ -1956,7 +1956,7 @@
 XS(_wrap_new_ESLevent__SWIG_0) {
   {
     char *arg1 = (char *) 0 ;
-    char *arg2 = (char *) 0 ;
+    char *arg2 = (char *) NULL ;
     ESLevent *result = 0 ;
     int res1 ;
     char *buf1 = 0 ;
@@ -1967,7 +1967,7 @@
     int argvi = 0;
     dXSARGS;
     
-    if ((items < 2) || (items > 2)) {
+    if ((items < 1) || (items > 2)) {
       SWIG_croak("Usage: new_ESLevent(type,subclass_name);");
     }
     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
@@ -1975,11 +1975,13 @@
       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "char const *""'");
     }
     arg1 = reinterpret_cast< char * >(buf1);
-    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "char const *""'");
+    if (items > 1) {
+      res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "char const *""'");
+      }
+      arg2 = reinterpret_cast< char * >(buf2);
     }
-    arg2 = reinterpret_cast< char * >(buf2);
     result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -1995,28 +1997,67 @@
 
 XS(_wrap_new_ESLevent__SWIG_1) {
   {
-    char *arg1 = (char *) 0 ;
+    esl_event_t *arg1 = (esl_event_t *) 0 ;
+    int arg2 = (int) 0 ;
     ESLevent *result = 0 ;
-    int res1 ;
-    char *buf1 = 0 ;
-    int alloc1 = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int val2 ;
+    int ecode2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 2)) {
+      SWIG_croak("Usage: new_ESLevent(wrap_me,free_me);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_esl_event_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "esl_event_t *""'"); 
+    }
+    arg1 = reinterpret_cast< esl_event_t * >(argp1);
+    if (items > 1) {
+      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+      if (!SWIG_IsOK(ecode2)) {
+        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "int""'");
+      } 
+      arg2 = static_cast< int >(val2);
+    }
+    result = (ESLevent *)new ESLevent(arg1,arg2);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_new_ESLevent__SWIG_2) {
+  {
+    ESLevent *arg1 = (ESLevent *) 0 ;
+    ESLevent *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
     int argvi = 0;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: new_ESLevent(type);");
+      SWIG_croak("Usage: new_ESLevent(me);");
     }
-    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "char const *""'");
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "ESLevent *""'"); 
     }
-    arg1 = reinterpret_cast< char * >(buf1);
-    result = (ESLevent *)new ESLevent((char const *)arg1);
+    arg1 = reinterpret_cast< ESLevent * >(argp1);
+    result = (ESLevent *)new ESLevent(arg1);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
-    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+    
     XSRETURN(argvi);
   fail:
-    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+    
     SWIG_croak_null();
   }
 }
@@ -2028,19 +2069,32 @@
   {
     unsigned long _index = 0;
     SWIG_TypeRank _rank = 0; 
-    if (items == 1) {
+    if ((items >= 1) && (items <= 2)) {
       SWIG_TypeRank _ranki = 0;
       SWIG_TypeRank _rankm = 0;
       SWIG_TypeRank _pi = 1;
       int _v = 0;
       {
-        int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_esl_event_t, 0);
         _v = SWIG_CheckState(res);
       }
       if (!_v) goto check_1;
       _ranki += _v*_pi;
       _rankm += _pi;
       _pi *= SWIG_MAXCASTRANK;
+      if (items > 1) {
+        {
+          {
+            int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
+            _v = SWIG_CheckState(res);
+          }
+        }
+        if (!_v) goto check_1;
+        _ranki += _v*_pi;
+        _rankm += _pi;
+        _pi *= SWIG_MAXCASTRANK;
+      }
       if (!_index || (_ranki < _rank)) {
         _rank = _ranki; _index = 1;
         if (_rank == _rankm) goto dispatch;
@@ -2048,39 +2102,64 @@
     }
   check_1:
     
-    if (items == 2) {
+    if (items == 1) {
       SWIG_TypeRank _ranki = 0;
       SWIG_TypeRank _rankm = 0;
       SWIG_TypeRank _pi = 1;
       int _v = 0;
       {
-        int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLevent, 0);
         _v = SWIG_CheckState(res);
       }
       if (!_v) goto check_2;
       _ranki += _v*_pi;
       _rankm += _pi;
       _pi *= SWIG_MAXCASTRANK;
+      if (!_index || (_ranki < _rank)) {
+        _rank = _ranki; _index = 2;
+        if (_rank == _rankm) goto dispatch;
+      }
+    }
+  check_2:
+    
+    if ((items >= 1) && (items <= 2)) {
+      SWIG_TypeRank _ranki = 0;
+      SWIG_TypeRank _rankm = 0;
+      SWIG_TypeRank _pi = 1;
+      int _v = 0;
       {
-        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
+        int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
         _v = SWIG_CheckState(res);
       }
-      if (!_v) goto check_2;
+      if (!_v) goto check_3;
       _ranki += _v*_pi;
       _rankm += _pi;
       _pi *= SWIG_MAXCASTRANK;
+      if (items > 1) {
+        {
+          int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
+          _v = SWIG_CheckState(res);
+        }
+        if (!_v) goto check_3;
+        _ranki += _v*_pi;
+        _rankm += _pi;
+        _pi *= SWIG_MAXCASTRANK;
+      }
       if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 2;
+        _rank = _ranki; _index = 3;
         if (_rank == _rankm) goto dispatch;
       }
     }
-  check_2:
+  check_3:
     
   dispatch:
     switch(_index) {
     case 1:
       ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLevent__SWIG_1); return;
     case 2:
+      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLevent__SWIG_2); return;
+    case 3:
       ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLevent__SWIG_0); return;
     }
   }
@@ -2118,10 +2197,10 @@
 }
 
 
-XS(_wrap_ESLevent_serialize__SWIG_0) {
+XS(_wrap_ESLevent_serialize) {
   {
     ESLevent *arg1 = (ESLevent *) 0 ;
-    char *arg2 = (char *) 0 ;
+    char *arg2 = (char *) NULL ;
     char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
@@ -2131,7 +2210,7 @@
     int argvi = 0;
     dXSARGS;
     
-    if ((items < 2) || (items > 2)) {
+    if ((items < 1) || (items > 2)) {
       SWIG_croak("Usage: ESLevent_serialize(self,format);");
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
@@ -2139,11 +2218,13 @@
       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_serialize" "', argument " "1"" of type '" "ESLevent *""'"); 
     }
     arg1 = reinterpret_cast< ESLevent * >(argp1);
-    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialize" "', argument " "2"" of type '" "char const *""'");
+    if (items > 1) {
+      res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialize" "', argument " "2"" of type '" "char const *""'");
+      }
+      arg2 = reinterpret_cast< char * >(buf2);
     }
-    arg2 = reinterpret_cast< char * >(buf2);
     result = (char *)(arg1)->serialize((char const *)arg2);
     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
     
@@ -2157,108 +2238,10 @@
 }
 
 
-XS(_wrap_ESLevent_serialize__SWIG_1) {
-  {
-    ESLevent *arg1 = (ESLevent *) 0 ;
-    char *result = 0 ;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    int argvi = 0;
-    dXSARGS;
-    
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: ESLevent_serialize(self);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_serialize" "', argument " "1"" of type '" "ESLevent *""'"); 
-    }
-    arg1 = reinterpret_cast< ESLevent * >(argp1);
-    result = (char *)(arg1)->serialize();
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
-    
-    XSRETURN(argvi);
-  fail:
-    
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_ESLevent_serialize) {
-  dXSARGS;
-  
-  {
-    unsigned long _index = 0;
-    SWIG_TypeRank _rank = 0; 
-    if (items == 1) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLevent, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_1;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 1;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_1:
-    
-    if (items == 2) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLevent, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_2;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_2;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 2;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_2:
-    
-  dispatch:
-    switch(_index) {
-    case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_ESLevent_serialize__SWIG_1); return;
-    case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_ESLevent_serialize__SWIG_0); return;
-    }
-  }
-  
-  croak("No matching function for overloaded 'ESLevent_serialize'");
-  XSRETURN(0);
-}
-
-
-XS(_wrap_ESLevent_setPriority__SWIG_0) {
+XS(_wrap_ESLevent_setPriority) {
   {
     ESLevent *arg1 = (ESLevent *) 0 ;
-    esl_priority_t arg2 ;
+    esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
     bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
@@ -2267,7 +2250,7 @@
     int argvi = 0;
     dXSARGS;
     
-    if ((items < 2) || (items > 2)) {
+    if ((items < 1) || (items > 2)) {
       SWIG_croak("Usage: ESLevent_setPriority(self,priority);");
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
@@ -2275,15 +2258,17 @@
       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_setPriority" "', argument " "1"" of type '" "ESLevent *""'"); 
     }
     arg1 = reinterpret_cast< ESLevent * >(argp1);
-    {
-      res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_esl_priority_t,  0 );
-      if (!SWIG_IsOK(res2)) {
-        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'"); 
-      }  
-      if (!argp2) {
-        SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'");
-      } else {
-        arg2 = *(reinterpret_cast< esl_priority_t * >(argp2));
+    if (items > 1) {
+      {
+        res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_esl_priority_t,  0 );
+        if (!SWIG_IsOK(res2)) {
+          SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'"); 
+        }  
+        if (!argp2) {
+          SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'");
+        } else {
+          arg2 = *(reinterpret_cast< esl_priority_t * >(argp2));
+        }
       }
     }
     result = (bool)(arg1)->setPriority(arg2);
@@ -2297,105 +2282,6 @@
 }
 
 
-XS(_wrap_ESLevent_setPriority__SWIG_1) {
-  {
-    ESLevent *arg1 = (ESLevent *) 0 ;
-    bool result;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    int argvi = 0;
-    dXSARGS;
-    
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: ESLevent_setPriority(self);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_setPriority" "', argument " "1"" of type '" "ESLevent *""'"); 
-    }
-    arg1 = reinterpret_cast< ESLevent * >(argp1);
-    result = (bool)(arg1)->setPriority();
-    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
-    
-    XSRETURN(argvi);
-  fail:
-    
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_ESLevent_setPriority) {
-  dXSARGS;
-  
-  {
-    unsigned long _index = 0;
-    SWIG_TypeRank _rank = 0; 
-    if (items == 1) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLevent, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_1;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 1;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_1:
-    
-    if (items == 2) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLevent, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_2;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_esl_priority_t, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_2;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 2;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_2:
-    
-  dispatch:
-    switch(_index) {
-    case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_ESLevent_setPriority__SWIG_1); return;
-    case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_ESLevent_setPriority__SWIG_0); return;
-    }
-  }
-  
-  croak("No matching function for overloaded 'ESLevent_setPriority'");
-  XSRETURN(0);
-}
-
-
 XS(_wrap_ESLevent_getHeader) {
   {
     ESLevent *arg1 = (ESLevent *) 0 ;
@@ -3142,12 +3028,12 @@
 }
 
 
-XS(_wrap_ESLconnection_execute__SWIG_0) {
+XS(_wrap_ESLconnection_execute) {
   {
     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 ;
@@ -3163,7 +3049,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 );
@@ -3176,16 +3062,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++ ;
     
@@ -3203,228 +3093,6 @@
 }
 
 
-XS(_wrap_ESLconnection_execute__SWIG_1) {
-  {
-    ESLconnection *arg1 = (ESLconnection *) 0 ;
-    char *arg2 = (char *) 0 ;
-    char *arg3 = (char *) 0 ;
-    esl_status_t result;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    int res2 ;
-    char *buf2 = 0 ;
-    int alloc2 = 0 ;
-    int res3 ;
-    char *buf3 = 0 ;
-    int alloc3 = 0 ;
-    int argvi = 0;
-    dXSARGS;
-    
-    if ((items < 3) || (items > 3)) {
-      SWIG_croak("Usage: ESLconnection_execute(self,app,arg);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_execute" "', 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_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);
-    result = (arg1)->execute((char const *)arg2,(char const *)arg3);
-    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++ ;
-    
-    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-    XSRETURN(argvi);
-  fail:
-    
-    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_ESLconnection_execute__SWIG_2) {
-  {
-    ESLconnection *arg1 = (ESLconnection *) 0 ;
-    char *arg2 = (char *) 0 ;
-    esl_status_t 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_execute(self,app);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_execute" "', 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_execute" "', argument " "2"" of type '" "char const *""'");
-    }
-    arg2 = reinterpret_cast< char * >(buf2);
-    result = (arg1)->execute((char const *)arg2);
-    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++ ;
-    
-    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-    XSRETURN(argvi);
-  fail:
-    
-    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_ESLconnection_execute) {
-  dXSARGS;
-  
-  {
-    unsigned long _index = 0;
-    SWIG_TypeRank _rank = 0; 
-    if (items == 2) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLconnection, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_1;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_1;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 1;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_1:
-    
-    if (items == 3) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLconnection, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_2;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_2;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_2;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 2;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_2:
-    
-    if (items == 4) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLconnection, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_3;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_3;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_3;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      {
-        int res = SWIG_AsCharPtrAndSize(ST(3), 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_3;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 3;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_3:
-    
-  dispatch:
-    switch(_index) {
-    case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_ESLconnection_execute__SWIG_2); return;
-    case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_ESLconnection_execute__SWIG_1); return;
-    case 3:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_ESLconnection_execute__SWIG_0); return;
-    }
-  }
-  
-  croak("No matching function for overloaded 'ESLconnection_execute'");
-  XSRETURN(0);
-}
-
-
 XS(_wrap_ESLconnection_setBlockingExecute) {
   {
     ESLconnection *arg1 = (ESLconnection *) 0 ;

Modified: freeswitch/trunk/libs/esl/php/ESL.php
==============================================================================
--- freeswitch/trunk/libs/esl/php/ESL.php	(original)
+++ freeswitch/trunk/libs/esl/php/ESL.php	Tue Feb 17 17:18:28 2009
@@ -52,10 +52,10 @@
 		return null;
 	}
 
-	function __construct($type,$subclass_name=null) {
+	function __construct($type_or_wrap_me_or_me,$subclass_name_or_free_me=null) {
 		switch (func_num_args()) {
-		case 1: $r=new_ESLevent($type); break;
-		default: $r=new_ESLevent($type,$subclass_name);
+		case 1: $r=new_ESLevent($type_or_wrap_me_or_me); break;
+		default: $r=new_ESLevent($type_or_wrap_me_or_me,$subclass_name_or_free_me);
 		}
 		$this->_cPtr=$r;
 	}

Modified: freeswitch/trunk/libs/esl/php/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/php/esl_wrap.cpp	(original)
+++ freeswitch/trunk/libs/esl/php/esl_wrap.cpp	Tue Feb 17 17:18:28 2009
@@ -1207,14 +1207,16 @@
 
 ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_0) {
   char *arg1 = (char *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   ESLevent *result = 0 ;
   zval **args[2];
+  int arg_count;
   
   SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
-  }
+  arg_count = ZEND_NUM_ARGS();
+  if(arg_count<1 || arg_count>2 ||
+    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+  WRONG_PARAM_COUNT;
   
   
   /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
@@ -1222,12 +1224,13 @@
   arg1 = (char *) Z_STRVAL_PP(args[0]);
   /*@SWIG@*/;
   
-  
-  /*@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 > 1) {
+    /*@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@*/;
+    
+  }
   result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
   {
     SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1);
@@ -1239,7 +1242,42 @@
 
 
 ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_1) {
-  char *arg1 = (char *) 0 ;
+  esl_event_t *arg1 = (esl_event_t *) 0 ;
+  int arg2 = (int) 0 ;
+  ESLevent *result = 0 ;
+  zval **args[2];
+  int arg_count;
+  
+  SWIG_ResetError();
+  arg_count = ZEND_NUM_ARGS();
+  if(arg_count<1 || arg_count>2 ||
+    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+  WRONG_PARAM_COUNT;
+  
+  {
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_esl_event_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESLevent. Expected SWIGTYPE_p_esl_event_t");
+    }
+  }
+  if(arg_count > 1) {
+    /*@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@*/;
+    
+  }
+  result = (ESLevent *)new ESLevent(arg1,arg2);
+  {
+    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1);
+  }
+  return;
+fail:
+  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_2) {
+  ESLevent *arg1 = (ESLevent *) 0 ;
   ESLevent *result = 0 ;
   zval **args[1];
   
@@ -1248,13 +1286,12 @@
     WRONG_PARAM_COUNT;
   }
   
-  
-  /*@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@*/;
-  
-  result = (ESLevent *)new ESLevent((char const *)arg1);
+  {
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESLevent. Expected SWIGTYPE_p_ESLevent");
+    }
+  }
+  result = (ESLevent *)new ESLevent(arg1);
   {
     SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1);
   }
@@ -1270,17 +1307,39 @@
   
   argc = ZEND_NUM_ARGS();
   zend_get_parameters_array_ex(argc,argv);
+  if ((argc >= 1) && (argc <= 2)) {
+    int _v;
+    {
+      void *tmp;
+      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_esl_event_t, 0) >= 0);
+    }
+    if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+      }
+      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
+      if (_v) {
+        return _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+      }
+    }
+  }
   if (argc == 1) {
     int _v;
-    _v = (Z_TYPE_PP(argv[0]) == IS_STRING); 
+    {
+      void *tmp;
+      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0);
+    }
     if (_v) {
-      return _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+      return _wrap_new_ESLevent__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
     }
   }
-  if (argc == 2) {
+  if ((argc >= 1) && (argc <= 2)) {
     int _v;
     _v = (Z_TYPE_PP(argv[0]) == IS_STRING); 
     if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+      }
       _v = (Z_TYPE_PP(argv[1]) == IS_STRING); 
       if (_v) {
         return _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -1311,16 +1370,18 @@
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize__SWIG_0) {
+ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) {
   ESLevent *arg1 = (ESLevent *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   char *result = 0 ;
   zval **args[2];
+  int arg_count;
   
   SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
-  }
+  arg_count = ZEND_NUM_ARGS();
+  if(arg_count<1 || arg_count>2 ||
+    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+  WRONG_PARAM_COUNT;
   
   {
     if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) {
@@ -1328,43 +1389,14 @@
     }
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
-  
-  /*@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@*/;
-  
-  result = (char *)(arg1)->serialize((char const *)arg2);
-  {
-    if(!result) {
-      ZVAL_NULL(return_value);
-    } else {
-      ZVAL_STRING(return_value,result, 1);
-    }
-  }
-  return;
-fail:
-  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
-}
-
-
-ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize__SWIG_1) {
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  char *result = 0 ;
-  zval **args[1];
-  
-  SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
-  }
-  
-  {
-    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) {
-      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_serialize. Expected SWIGTYPE_p_ESLevent");
-    }
+  if(arg_count > 1) {
+    /*@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(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
-  result = (char *)(arg1)->serialize();
+  result = (char *)(arg1)->serialize((char const *)arg2);
   {
     if(!result) {
       ZVAL_NULL(return_value);
@@ -1378,53 +1410,19 @@
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) {
-  int argc;
-  zval **argv[2];
-  
-  argc = ZEND_NUM_ARGS();
-  zend_get_parameters_array_ex(argc,argv);
-  if (argc == 1) {
-    int _v;
-    {
-      void *tmp;
-      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0);
-    }
-    if (_v) {
-      return _wrap_ESLevent_serialize__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    {
-      void *tmp;
-      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0);
-    }
-    if (_v) {
-      _v = (Z_TYPE_PP(argv[1]) == IS_STRING); 
-      if (_v) {
-        return _wrap_ESLevent_serialize__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-      }
-    }
-  }
-  
-  SWIG_ErrorCode() = E_ERROR;
-  SWIG_ErrorMsg() = "No matching function for overloaded 'ESLevent_serialize'";
-  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
-}
-
-
-ZEND_NAMED_FUNCTION(_wrap_ESLevent_setPriority__SWIG_0) {
+ZEND_NAMED_FUNCTION(_wrap_ESLevent_setPriority) {
   ESLevent *arg1 = (ESLevent *) 0 ;
-  esl_priority_t arg2 ;
+  esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
   bool result;
   esl_priority_t *tmp2 ;
   zval **args[2];
+  int arg_count;
   
   SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
-  }
+  arg_count = ZEND_NUM_ARGS();
+  if(arg_count<1 || arg_count>2 ||
+    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+  WRONG_PARAM_COUNT;
   
   {
     if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) {
@@ -1432,11 +1430,13 @@
     }
   }
   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
-  {
-    if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_esl_priority_t, 0) < 0 || tmp2 == NULL) {
-      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLevent_setPriority. Expected SWIGTYPE_p_esl_priority_t");
+  if(arg_count > 1) {
+    {
+      if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_esl_priority_t, 0) < 0 || tmp2 == NULL) {
+        SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLevent_setPriority. Expected SWIGTYPE_p_esl_priority_t");
+      }
+      arg2 = *tmp2;
     }
-    arg2 = *tmp2;
   }
   result = (bool)(arg1)->setPriority(arg2);
   {
@@ -1448,68 +1448,6 @@
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_ESLevent_setPriority__SWIG_1) {
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  bool result;
-  zval **args[1];
-  
-  SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
-  }
-  
-  {
-    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) {
-      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_setPriority. Expected SWIGTYPE_p_ESLevent");
-    }
-  }
-  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
-  result = (bool)(arg1)->setPriority();
-  {
-    ZVAL_BOOL(return_value,(result)?1:0);
-  }
-  return;
-fail:
-  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
-}
-
-
-ZEND_NAMED_FUNCTION(_wrap_ESLevent_setPriority) {
-  int argc;
-  zval **argv[2];
-  
-  argc = ZEND_NUM_ARGS();
-  zend_get_parameters_array_ex(argc,argv);
-  if (argc == 1) {
-    int _v;
-    {
-      void *tmp;
-      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0);
-    }
-    if (_v) {
-      return _wrap_ESLevent_setPriority__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    {
-      void *tmp;
-      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0);
-    }
-    if (_v) {
-      /* typecheck SWIGTYPE */ 
-      if (_v) {
-        return _wrap_ESLevent_setPriority__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-      }
-    }
-  }
-  
-  SWIG_ErrorCode() = E_ERROR;
-  SWIG_ErrorMsg() = "No matching function for overloaded 'ESLevent_setPriority'";
-  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
-}
-
-
 ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) {
   ESLevent *arg1 = (ESLevent *) 0 ;
   char *arg2 = (char *) 0 ;
@@ -2122,18 +2060,20 @@
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute__SWIG_0) {
+ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) {
   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;
   zval **args[4];
+  int arg_count;
   
   SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
-  }
+  arg_count = ZEND_NUM_ARGS();
+  if(arg_count<2 || arg_count>4 ||
+    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+  WRONG_PARAM_COUNT;
   
   {
     if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) {
@@ -2147,94 +2087,21 @@
   arg2 = (char *) Z_STRVAL_PP(args[1]);
   /*@SWIG@*/;
   
-  
-  /*@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/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@*/;
-  
-  result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
-  {
-    esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
-    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
-  }
-  return;
-fail:
-  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
-}
-
-
-ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute__SWIG_1) {
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  char *arg3 = (char *) 0 ;
-  esl_status_t result;
-  zval **args[3];
-  
-  SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
-  }
-  
-  {
-    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) {
-      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_execute. Expected SWIGTYPE_p_ESLconnection");
-    }
-  }
-  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
-  
-  /*@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/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@*/;
-  
-  result = (arg1)->execute((char const *)arg2,(char const *)arg3);
-  {
-    esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
-    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
-  }
-  return;
-fail:
-  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
-}
-
-
-ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute__SWIG_2) {
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  esl_status_t result;
-  zval **args[2];
-  
-  SWIG_ResetError();
-  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
-    WRONG_PARAM_COUNT;
+  if(arg_count > 2) {
+    /*@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(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) {
-      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_execute. Expected SWIGTYPE_p_ESLconnection");
-    }
+  if(arg_count > 3) {
+    /*@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@*/;
+    
   }
-  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
-  
-  /*@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@*/;
-  
-  result = (arg1)->execute((char const *)arg2);
+  result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
   {
     esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
     SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
@@ -2245,67 +2112,6 @@
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) {
-  int argc;
-  zval **argv[4];
-  
-  argc = ZEND_NUM_ARGS();
-  zend_get_parameters_array_ex(argc,argv);
-  if (argc == 2) {
-    int _v;
-    {
-      void *tmp;
-      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLconnection, 0) >= 0);
-    }
-    if (_v) {
-      _v = (Z_TYPE_PP(argv[1]) == IS_STRING); 
-      if (_v) {
-        return _wrap_ESLconnection_execute__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    {
-      void *tmp;
-      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLconnection, 0) >= 0);
-    }
-    if (_v) {
-      _v = (Z_TYPE_PP(argv[1]) == IS_STRING); 
-      if (_v) {
-        _v = (Z_TYPE_PP(argv[2]) == IS_STRING); 
-        if (_v) {
-          return _wrap_ESLconnection_execute__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    {
-      void *tmp;
-      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLconnection, 0) >= 0);
-    }
-    if (_v) {
-      _v = (Z_TYPE_PP(argv[1]) == IS_STRING); 
-      if (_v) {
-        _v = (Z_TYPE_PP(argv[2]) == IS_STRING); 
-        if (_v) {
-          _v = (Z_TYPE_PP(argv[3]) == IS_STRING); 
-          if (_v) {
-            return _wrap_ESLconnection_execute__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-          }
-        }
-      }
-    }
-  }
-  
-  SWIG_ErrorCode() = E_ERROR;
-  SWIG_ErrorMsg() = "No matching function for overloaded 'ESLconnection_execute'";
-  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
-}
-
-
 ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setBlockingExecute) {
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   char *arg2 = (char *) 0 ;

Modified: freeswitch/trunk/libs/esl/php/test.php
==============================================================================
--- freeswitch/trunk/libs/esl/php/test.php	(original)
+++ freeswitch/trunk/libs/esl/php/test.php	Tue Feb 17 17:18:28 2009
@@ -2,4 +2,6 @@
 require_once('ESL.php');
 
 $esl = new eslConnection('127.0.0.1', '8021', 'ClueCon');
-echo $esl->sendRecv("api status");
+$e = $esl->sendRecv("api status");
+print $e->getBody();
+

Modified: freeswitch/trunk/libs/esl/python/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/python/esl_wrap.cpp	(original)
+++ freeswitch/trunk/libs/esl/python/esl_wrap.cpp	Tue Feb 17 17:18:28 2009
@@ -3025,7 +3025,7 @@
 SWIGINTERN PyObject *_wrap_new_ESLevent__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   char *arg1 = (char *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   ESLevent *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
@@ -3036,17 +3036,19 @@
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:new_ESLevent",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O|O:new_ESLevent",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "char const *""'");
   }
   arg1 = reinterpret_cast< char * >(buf1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "char const *""'");
+  if (obj1) {
+    res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "char const *""'");
+    }
+    arg2 = reinterpret_cast< char * >(buf2);
   }
-  arg2 = reinterpret_cast< char * >(buf2);
   result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_NEW |  0 );
   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -3061,25 +3063,55 @@
 
 SWIGINTERN PyObject *_wrap_new_ESLevent__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  char *arg1 = (char *) 0 ;
+  esl_event_t *arg1 = (esl_event_t *) 0 ;
+  int arg2 = (int) 0 ;
   ESLevent *result = 0 ;
-  int res1 ;
-  char *buf1 = 0 ;
-  int alloc1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O|O:new_ESLevent",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_esl_event_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "esl_event_t *""'"); 
+  }
+  arg1 = reinterpret_cast< esl_event_t * >(argp1);
+  if (obj1) {
+    ecode2 = SWIG_AsVal_int(obj1, &val2);
+    if (!SWIG_IsOK(ecode2)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "int""'");
+    } 
+    arg2 = static_cast< int >(val2);
+  }
+  result = (ESLevent *)new ESLevent(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_ESLevent__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  ESLevent *result = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
   PyObject * obj0 = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:new_ESLevent",&obj0)) SWIG_fail;
-  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "char const *""'");
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "ESLevent *""'"); 
   }
-  arg1 = reinterpret_cast< char * >(buf1);
-  result = (ESLevent *)new ESLevent((char const *)arg1);
+  arg1 = reinterpret_cast< ESLevent * >(argp1);
+  result = (ESLevent *)new ESLevent(arg1);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_NEW |  0 );
-  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
   return resultobj;
 fail:
-  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
   return NULL;
 }
 
@@ -3094,19 +3126,41 @@
   for (ii = 0; (ii < argc) && (ii < 2); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
+  if ((argc >= 1) && (argc <= 2)) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_esl_event_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_1(self, args);
+      }
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_ESLevent__SWIG_1(self, args);
+      }
+    }
+  }
   if (argc == 1) {
     int _v;
-    int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
-      return _wrap_new_ESLevent__SWIG_1(self, args);
+      return _wrap_new_ESLevent__SWIG_2(self, args);
     }
   }
-  if (argc == 2) {
+  if ((argc >= 1) && (argc <= 2)) {
     int _v;
     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_0(self, args);
+      }
       int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
@@ -3119,7 +3173,8 @@
   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_ESLevent'.\n"
     "  Possible C/C++ prototypes are:\n"
     "    ESLevent(char const *,char const *)\n"
-    "    ESLevent(char const *)\n");
+    "    ESLevent(esl_event_t *,int)\n"
+    "    ESLevent(ESLevent *)\n");
   return NULL;
 }
 
@@ -3146,10 +3201,10 @@
 }
 
 
-SWIGINTERN PyObject *_wrap_ESLevent_serialize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_ESLevent_serialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   ESLevent *arg1 = (ESLevent *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -3159,17 +3214,19 @@
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:ESLevent_serialize",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O|O:ESLevent_serialize",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_serialize" "', argument " "1"" of type '" "ESLevent *""'"); 
   }
   arg1 = reinterpret_cast< ESLevent * >(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialize" "', argument " "2"" of type '" "char const *""'");
+  if (obj1) {
+    res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialize" "', argument " "2"" of type '" "char const *""'");
+    }
+    arg2 = reinterpret_cast< char * >(buf2);
   }
-  arg2 = reinterpret_cast< char * >(buf2);
   result = (char *)(arg1)->serialize((char const *)arg2);
   resultobj = SWIG_FromCharPtr((const char *)result);
   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -3180,74 +3237,10 @@
 }
 
 
-SWIGINTERN PyObject *_wrap_ESLevent_serialize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_ESLevent_setPriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   ESLevent *arg1 = (ESLevent *) 0 ;
-  char *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:ESLevent_serialize",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_serialize" "', argument " "1"" of type '" "ESLevent *""'"); 
-  }
-  arg1 = reinterpret_cast< ESLevent * >(argp1);
-  result = (char *)(arg1)->serialize();
-  resultobj = SWIG_FromCharPtr((const char *)result);
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_ESLevent_serialize(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[3];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_ESLevent_serialize__SWIG_1(self, args);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_ESLevent_serialize__SWIG_0(self, args);
-      }
-    }
-  }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'ESLevent_serialize'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    serialize(ESLevent *,char const *)\n"
-    "    serialize(ESLevent *)\n");
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_ESLevent_setPriority__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  esl_priority_t arg2 ;
+  esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
   bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -3256,23 +3249,25 @@
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:ESLevent_setPriority",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O|O:ESLevent_setPriority",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_setPriority" "', argument " "1"" of type '" "ESLevent *""'"); 
   }
   arg1 = reinterpret_cast< ESLevent * >(argp1);
-  {
-    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_esl_priority_t,  0  | 0);
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'"); 
-    }  
-    if (!argp2) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'");
-    } else {
-      esl_priority_t * temp = reinterpret_cast< esl_priority_t * >(argp2);
-      arg2 = *temp;
-      if (SWIG_IsNewObj(res2)) delete temp;
+  if (obj1) {
+    {
+      res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_esl_priority_t,  0  | 0);
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'"); 
+      }  
+      if (!argp2) {
+        SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'");
+      } else {
+        esl_priority_t * temp = reinterpret_cast< esl_priority_t * >(argp2);
+        arg2 = *temp;
+        if (SWIG_IsNewObj(res2)) delete temp;
+      }
     }
   }
   result = (bool)(arg1)->setPriority(arg2);
@@ -3283,70 +3278,6 @@
 }
 
 
-SWIGINTERN PyObject *_wrap_ESLevent_setPriority__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:ESLevent_setPriority",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_setPriority" "', argument " "1"" of type '" "ESLevent *""'"); 
-  }
-  arg1 = reinterpret_cast< ESLevent * >(argp1);
-  result = (bool)(arg1)->setPriority();
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_ESLevent_setPriority(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[3];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_ESLevent_setPriority__SWIG_1(self, args);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_esl_priority_t, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_ESLevent_setPriority__SWIG_0(self, args);
-      }
-    }
-  }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'ESLevent_setPriority'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    setPriority(ESLevent *,esl_priority_t)\n"
-    "    setPriority(ESLevent *)\n");
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_ESLevent_getHeader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   ESLevent *arg1 = (ESLevent *) 0 ;
@@ -3973,12 +3904,12 @@
 }
 
 
-SWIGINTERN PyObject *_wrap_ESLconnection_execute__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_ESLconnection_execute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   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 ;
@@ -3996,7 +3927,7 @@
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:ESLconnection_execute",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO|OO:ESLconnection_execute",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_execute" "', argument " "1"" of type '" "ESLconnection *""'"); 
@@ -4007,16 +3938,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(obj2, &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(obj3, &buf4, NULL, &alloc4);
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ESLconnection_execute" "', argument " "4"" of type '" "char const *""'");
+  if (obj2) {
+    res3 = SWIG_AsCharPtrAndSize(obj2, &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 (obj3) {
+    res4 = SWIG_AsCharPtrAndSize(obj3, &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);
   resultobj = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN |  0 );
   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -4031,158 +3966,6 @@
 }
 
 
-SWIGINTERN PyObject *_wrap_ESLconnection_execute__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  char *arg3 = (char *) 0 ;
-  esl_status_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int res2 ;
-  char *buf2 = 0 ;
-  int alloc2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OOO:ESLconnection_execute",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_execute" "', argument " "1"" of type '" "ESLconnection *""'"); 
-  }
-  arg1 = reinterpret_cast< ESLconnection * >(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_execute" "', argument " "2"" of type '" "char const *""'");
-  }
-  arg2 = reinterpret_cast< char * >(buf2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &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);
-  result = (arg1)->execute((char const *)arg2,(char const *)arg3);
-  resultobj = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN |  0 );
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return resultobj;
-fail:
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_ESLconnection_execute__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  esl_status_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int res2 ;
-  char *buf2 = 0 ;
-  int alloc2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:ESLconnection_execute",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_execute" "', argument " "1"" of type '" "ESLconnection *""'"); 
-  }
-  arg1 = reinterpret_cast< ESLconnection * >(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_execute" "', argument " "2"" of type '" "char const *""'");
-  }
-  arg2 = reinterpret_cast< char * >(buf2);
-  result = (arg1)->execute((char const *)arg2);
-  resultobj = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN |  0 );
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  return resultobj;
-fail:
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_ESLconnection_execute(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[5];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLconnection, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_ESLconnection_execute__SWIG_2(self, args);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLconnection, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_ESLconnection_execute__SWIG_1(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLconnection, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_ESLconnection_execute__SWIG_0(self, args);
-          }
-        }
-      }
-    }
-  }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'ESLconnection_execute'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    execute(ESLconnection *,char const *,char const *,char const *)\n"
-    "    execute(ESLconnection *,char const *,char const *)\n"
-    "    execute(ESLconnection *,char const *)\n");
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_ESLconnection_setBlockingExecute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   ESLconnection *arg1 = (ESLconnection *) 0 ;

Modified: freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp	(original)
+++ freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp	Tue Feb 17 17:18:28 2009
@@ -2139,7 +2139,7 @@
 SWIGINTERN VALUE
 _wrap_new_ESLevent__SWIG_0(int argc, VALUE *argv, VALUE self) {
   char *arg1 = (char *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   ESLevent *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
@@ -2148,19 +2148,21 @@
   char *buf2 = 0 ;
   int alloc2 = 0 ;
   
-  if ((argc < 2) || (argc > 2)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  if ((argc < 1) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
   }
   res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLevent", 1, argv[0] ));
   }
   arg1 = reinterpret_cast< char * >(buf1);
-  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","ESLevent", 2, argv[1] ));
+  if (argc > 1) {
+    res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","ESLevent", 2, argv[1] ));
+    }
+    arg2 = reinterpret_cast< char * >(buf2);
   }
-  arg2 = reinterpret_cast< char * >(buf2);
   result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);DATA_PTR(self) = result;
   
   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -2173,6 +2175,39 @@
 }
 
 
+SWIGINTERN VALUE
+_wrap_new_ESLevent__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  esl_event_t *arg1 = (esl_event_t *) 0 ;
+  int arg2 = (int) 0 ;
+  ESLevent *result = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_esl_event_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "esl_event_t *","ESLevent", 1, argv[0] )); 
+  }
+  arg1 = reinterpret_cast< esl_event_t * >(argp1);
+  if (argc > 1) {
+    ecode2 = SWIG_AsVal_int(argv[1], &val2);
+    if (!SWIG_IsOK(ecode2)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ESLevent", 2, argv[1] ));
+    } 
+    arg2 = static_cast< int >(val2);
+  }
+  result = (ESLevent *)new ESLevent(arg1,arg2);DATA_PTR(self) = result;
+  
+  return self;
+fail:
+  return Qnil;
+}
+
+
 #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
 SWIGINTERN VALUE
 _wrap_ESLevent_allocate(VALUE self) {
@@ -2191,27 +2226,24 @@
   
 
 SWIGINTERN VALUE
-_wrap_new_ESLevent__SWIG_1(int argc, VALUE *argv, VALUE self) {
-  char *arg1 = (char *) 0 ;
+_wrap_new_ESLevent__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  ESLevent *arg1 = (ESLevent *) 0 ;
   ESLevent *result = 0 ;
-  int res1 ;
-  char *buf1 = 0 ;
-  int alloc1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
   
   if ((argc < 1) || (argc > 1)) {
     rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
   }
-  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLevent", 1, argv[0] ));
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","ESLevent", 1, argv[0] )); 
   }
-  arg1 = reinterpret_cast< char * >(buf1);
-  result = (ESLevent *)new ESLevent((char const *)arg1);DATA_PTR(self) = result;
+  arg1 = reinterpret_cast< ESLevent * >(argp1);
+  result = (ESLevent *)new ESLevent(arg1);DATA_PTR(self) = result;
   
-  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
   return self;
 fail:
-  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
   return Qnil;
 }
 
@@ -2226,19 +2258,41 @@
   for (ii = 0; (ii < argc); ++ii) {
     argv[ii] = args[ii];
   }
+  if ((argc >= 1) && (argc <= 2)) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_esl_event_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_1(nargs, args, self);
+      }
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_ESLevent__SWIG_1(nargs, args, self);
+      }
+    }
+  }
   if (argc == 1) {
     int _v;
-    int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
-      return _wrap_new_ESLevent__SWIG_1(nargs, args, self);
+      return _wrap_new_ESLevent__SWIG_2(nargs, args, self);
     }
   }
-  if (argc == 2) {
+  if ((argc >= 1) && (argc <= 2)) {
     int _v;
     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
+      if (argc <= 1) {
+        return _wrap_new_ESLevent__SWIG_0(nargs, args, self);
+      }
       int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
@@ -2250,7 +2304,8 @@
 fail:
   Ruby_Format_OverloadedError( argc, 2, "ESLevent.new", 
     "    ESLevent.new(char const *type, char const *subclass_name)\n"
-    "    ESLevent.new(char const *type)\n");
+    "    ESLevent.new(esl_event_t *wrap_me, int free_me)\n"
+    "    ESLevent.new(ESLevent *me)\n");
   
   return Qnil;
 }
@@ -2262,9 +2317,9 @@
 }
 
 SWIGINTERN VALUE
-_wrap_ESLevent_serialize__SWIG_0(int argc, VALUE *argv, VALUE self) {
+_wrap_ESLevent_serialize(int argc, VALUE *argv, VALUE self) {
   ESLevent *arg1 = (ESLevent *) 0 ;
-  char *arg2 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
   char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -2273,19 +2328,21 @@
   int alloc2 = 0 ;
   VALUE vresult = Qnil;
   
-  if ((argc < 1) || (argc > 1)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  if ((argc < 0) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
   }
   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","serialize", 1, self )); 
   }
   arg1 = reinterpret_cast< ESLevent * >(argp1);
-  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","serialize", 2, argv[0] ));
+  if (argc > 0) {
+    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","serialize", 2, argv[0] ));
+    }
+    arg2 = reinterpret_cast< char * >(buf2);
   }
-  arg2 = reinterpret_cast< char * >(buf2);
   result = (char *)(arg1)->serialize((char const *)arg2);
   vresult = SWIG_FromCharPtr((const char *)result);
   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -2297,76 +2354,9 @@
 
 
 SWIGINTERN VALUE
-_wrap_ESLevent_serialize__SWIG_1(int argc, VALUE *argv, VALUE self) {
+_wrap_ESLevent_setPriority(int argc, VALUE *argv, VALUE self) {
   ESLevent *arg1 = (ESLevent *) 0 ;
-  char *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  VALUE vresult = Qnil;
-  
-  if ((argc < 0) || (argc > 0)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
-  }
-  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","serialize", 1, self )); 
-  }
-  arg1 = reinterpret_cast< ESLevent * >(argp1);
-  result = (char *)(arg1)->serialize();
-  vresult = SWIG_FromCharPtr((const char *)result);
-  return vresult;
-fail:
-  return Qnil;
-}
-
-
-SWIGINTERN VALUE _wrap_ESLevent_serialize(int nargs, VALUE *args, VALUE self) {
-  int argc;
-  VALUE argv[3];
-  int ii;
-  
-  argc = nargs + 1;
-  argv[0] = self;
-  if (argc > 3) SWIG_fail;
-  for (ii = 1; (ii < argc); ++ii) {
-    argv[ii] = args[ii-1];
-  }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_ESLevent_serialize__SWIG_1(nargs, args, self);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_ESLevent_serialize__SWIG_0(nargs, args, self);
-      }
-    }
-  }
-  
-fail:
-  Ruby_Format_OverloadedError( argc, 3, "ESLevent.serialize", 
-    "    char const * ESLevent.serialize(char const *format)\n"
-    "    char const * ESLevent.serialize()\n");
-  
-  return Qnil;
-}
-
-
-SWIGINTERN VALUE
-_wrap_ESLevent_setPriority__SWIG_0(int argc, VALUE *argv, VALUE self) {
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  esl_priority_t arg2 ;
+  esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
   bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -2374,23 +2364,25 @@
   int res2 = 0 ;
   VALUE vresult = Qnil;
   
-  if ((argc < 1) || (argc > 1)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  if ((argc < 0) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
   }
   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","setPriority", 1, self )); 
   }
   arg1 = reinterpret_cast< ESLevent * >(argp1);
-  {
-    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_esl_priority_t,  0 );
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "esl_priority_t","setPriority", 2, argv[0] )); 
-    }  
-    if (!argp2) {
-      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "esl_priority_t","setPriority", 2, argv[0]));
-    } else {
-      arg2 = *(reinterpret_cast< esl_priority_t * >(argp2));
+  if (argc > 0) {
+    {
+      res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_esl_priority_t,  0 );
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "esl_priority_t","setPriority", 2, argv[0] )); 
+      }  
+      if (!argp2) {
+        SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "esl_priority_t","setPriority", 2, argv[0]));
+      } else {
+        arg2 = *(reinterpret_cast< esl_priority_t * >(argp2));
+      }
     }
   }
   result = (bool)(arg1)->setPriority(arg2);
@@ -2402,74 +2394,6 @@
 
 
 SWIGINTERN VALUE
-_wrap_ESLevent_setPriority__SWIG_1(int argc, VALUE *argv, VALUE self) {
-  ESLevent *arg1 = (ESLevent *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  VALUE vresult = Qnil;
-  
-  if ((argc < 0) || (argc > 0)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
-  }
-  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","setPriority", 1, self )); 
-  }
-  arg1 = reinterpret_cast< ESLevent * >(argp1);
-  result = (bool)(arg1)->setPriority();
-  vresult = SWIG_From_bool(static_cast< bool >(result));
-  return vresult;
-fail:
-  return Qnil;
-}
-
-
-SWIGINTERN VALUE _wrap_ESLevent_setPriority(int nargs, VALUE *args, VALUE self) {
-  int argc;
-  VALUE argv[3];
-  int ii;
-  
-  argc = nargs + 1;
-  argv[0] = self;
-  if (argc > 3) SWIG_fail;
-  for (ii = 1; (ii < argc); ++ii) {
-    argv[ii] = args[ii-1];
-  }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_ESLevent_setPriority__SWIG_1(nargs, args, self);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_esl_priority_t, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_ESLevent_setPriority__SWIG_0(nargs, args, self);
-      }
-    }
-  }
-  
-fail:
-  Ruby_Format_OverloadedError( argc, 3, "ESLevent.setPriority", 
-    "    bool ESLevent.setPriority(esl_priority_t priority)\n"
-    "    bool ESLevent.setPriority()\n");
-  
-  return Qnil;
-}
-
-
-SWIGINTERN VALUE
 _wrap_ESLevent_getHeader(int argc, VALUE *argv, VALUE self) {
   ESLevent *arg1 = (ESLevent *) 0 ;
   char *arg2 = (char *) 0 ;
@@ -3108,11 +3032,11 @@
 
 
 SWIGINTERN VALUE
-_wrap_ESLconnection_execute__SWIG_0(int argc, VALUE *argv, VALUE self) {
+_wrap_ESLconnection_execute(int argc, VALUE *argv, VALUE self) {
   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 ;
@@ -3127,8 +3051,8 @@
   int alloc4 = 0 ;
   VALUE vresult = Qnil;
   
-  if ((argc < 3) || (argc > 3)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  if ((argc < 1) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
   }
   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
@@ -3140,16 +3064,20 @@
     SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","execute", 2, argv[0] ));
   }
   arg2 = reinterpret_cast< char * >(buf2);
-  res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","execute", 3, argv[1] ));
+  if (argc > 1) {
+    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","execute", 3, argv[1] ));
+    }
+    arg3 = reinterpret_cast< char * >(buf3);
   }
-  arg3 = reinterpret_cast< char * >(buf3);
-  res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","execute", 4, argv[2] ));
+  if (argc > 2) {
+    res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","execute", 4, argv[2] ));
+    }
+    arg4 = reinterpret_cast< char * >(buf4);
   }
-  arg4 = reinterpret_cast< char * >(buf4);
   result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
   vresult = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN |  0 );
   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -3165,160 +3093,6 @@
 
 
 SWIGINTERN VALUE
-_wrap_ESLconnection_execute__SWIG_1(int argc, VALUE *argv, VALUE self) {
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  char *arg3 = (char *) 0 ;
-  esl_status_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int res2 ;
-  char *buf2 = 0 ;
-  int alloc2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
-  VALUE vresult = Qnil;
-  
-  if ((argc < 2) || (argc > 2)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
-  }
-  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","execute", 1, self )); 
-  }
-  arg1 = reinterpret_cast< ESLconnection * >(argp1);
-  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","execute", 2, argv[0] ));
-  }
-  arg2 = reinterpret_cast< char * >(buf2);
-  res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","execute", 3, argv[1] ));
-  }
-  arg3 = reinterpret_cast< char * >(buf3);
-  result = (arg1)->execute((char const *)arg2,(char const *)arg3);
-  vresult = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN |  0 );
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return vresult;
-fail:
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return Qnil;
-}
-
-
-SWIGINTERN VALUE
-_wrap_ESLconnection_execute__SWIG_2(int argc, VALUE *argv, VALUE self) {
-  ESLconnection *arg1 = (ESLconnection *) 0 ;
-  char *arg2 = (char *) 0 ;
-  esl_status_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int res2 ;
-  char *buf2 = 0 ;
-  int alloc2 = 0 ;
-  VALUE vresult = Qnil;
-  
-  if ((argc < 1) || (argc > 1)) {
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
-  }
-  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","execute", 1, self )); 
-  }
-  arg1 = reinterpret_cast< ESLconnection * >(argp1);
-  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","execute", 2, argv[0] ));
-  }
-  arg2 = reinterpret_cast< char * >(buf2);
-  result = (arg1)->execute((char const *)arg2);
-  vresult = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN |  0 );
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  return vresult;
-fail:
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  return Qnil;
-}
-
-
-SWIGINTERN VALUE _wrap_ESLconnection_execute(int nargs, VALUE *args, VALUE self) {
-  int argc;
-  VALUE argv[5];
-  int ii;
-  
-  argc = nargs + 1;
-  argv[0] = self;
-  if (argc > 5) SWIG_fail;
-  for (ii = 1; (ii < argc); ++ii) {
-    argv[ii] = args[ii-1];
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLconnection, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_ESLconnection_execute__SWIG_2(nargs, args, self);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLconnection, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_ESLconnection_execute__SWIG_1(nargs, args, self);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLconnection, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_ESLconnection_execute__SWIG_0(nargs, args, self);
-          }
-        }
-      }
-    }
-  }
-  
-fail:
-  Ruby_Format_OverloadedError( argc, 5, "ESLconnection.execute", 
-    "    esl_status_t ESLconnection.execute(char const *app, char const *arg, char const *uuid)\n"
-    "    esl_status_t ESLconnection.execute(char const *app, char const *arg)\n"
-    "    esl_status_t ESLconnection.execute(char const *app)\n");
-  
-  return Qnil;
-}
-
-
-SWIGINTERN VALUE
 _wrap_ESLconnection_setBlockingExecute(int argc, VALUE *argv, VALUE self) {
   ESLconnection *arg1 = (ESLconnection *) 0 ;
   char *arg2 = (char *) 0 ;

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 17:18:28 2009
@@ -1,7 +1,8 @@
 #include <esl.h>
 #include <esl_oop.h>
 
-#define construct_common() memset(&handle, 0, sizeof(handle)); last_event_obj = NULL
+#define connection_construct_common() memset(&handle, 0, sizeof(handle)); last_event_obj = NULL
+#define event_construct_common() event = NULL; serialized_string = NULL; mine = 0
 
 void eslSetLogLevel(int level)
 {
@@ -10,7 +11,7 @@
 
 ESLconnection::ESLconnection(const char *host, const char *port, const char *password)
 {
-	construct_common();
+	connection_construct_common();
 	int x_port = atoi(port);
 
 	esl_connect(&handle, host, x_port, password);
@@ -19,7 +20,7 @@
 
 ESLconnection::ESLconnection(int socket)
 {
-	construct_common();
+	connection_construct_common();
 	memset(&handle, 0, sizeof(handle));
 	esl_attach_handle(&handle, (esl_socket_t)socket, NULL);
 }
@@ -150,6 +151,8 @@
 {
 	esl_event_types_t event_id;
 	
+	event_construct_common();
+
 	if (esl_name_event(type, &event_id) != ESL_SUCCESS) {
 		event_id = ESL_EVENT_MESSAGE;
 	}
@@ -170,14 +173,28 @@
 
 ESLevent::ESLevent(esl_event_t *wrap_me, int free_me)
 {
+	event_construct_common();
 	event = wrap_me;
 	mine = free_me;
 	serialized_string = NULL;
 }
 
-ESLevent::~ESLevent()
+
+ESLevent::ESLevent(ESLevent *me)
 {
+	/* workaround for silly php thing */
+	event = me->event;
+	mine = me->mine;
+	serialized_string = NULL;
+	me->event = NULL;
+	me->mine = 0;
+	esl_safe_free(me->serialized_string);
+	delete me;
+}
 
+ESLevent::~ESLevent()
+{
+	
 	if (serialized_string) {
 		free(serialized_string);
 	}

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 17:18:28 2009
@@ -51,6 +51,7 @@
 
 	ESLevent(const char *type, const char *subclass_name = NULL);
 	ESLevent(esl_event_t *wrap_me, int free_me = 0);
+	ESLevent(ESLevent *me);
 	virtual ~ESLevent();
 	const char *serialize(const char *format = NULL);
 	bool setPriority(esl_priority_t priority = ESL_PRIORITY_NORMAL);



More information about the Freeswitch-svn mailing list