fix esl sendevent issue and change the sendEvent method to return the reply text like sendRecv etc
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16921 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8111b4beb4
commit
1baa8d5eee
|
@ -10,6 +10,7 @@
|
|||
%newobject ::getInfo();
|
||||
%newobject ESLconnection::filter();
|
||||
%newobject ::recvEvent();
|
||||
%newobject ::sendEvent();
|
||||
%newobject ESLconnection::recvEventTimed();
|
||||
#else
|
||||
%newobject ESLconnection::sendRecv;
|
||||
|
@ -17,6 +18,7 @@
|
|||
%newobject ESLconnection::bgapi;
|
||||
%newobject ESLconnection::getInfo;
|
||||
%newobject ESLconnection::filter;
|
||||
%newobject ESLconnection::sendEvent;
|
||||
%newobject ESLconnection::recvEvent;
|
||||
%newobject ESLconnection::recvEventTimed;
|
||||
%newobject ESLconnection::execute;
|
||||
|
|
|
@ -819,11 +819,11 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1bgapi(JNI
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jint JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1sendEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
|
||||
jint jresult = 0 ;
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1sendEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
|
||||
jlong jresult = 0 ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
|
@ -831,8 +831,8 @@ SWIGEXPORT jint JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1sendEvent(
|
|||
(void)jarg2_;
|
||||
arg1 = *(ESLconnection **)&jarg1;
|
||||
arg2 = *(ESLevent **)&jarg2;
|
||||
result = (int)(arg1)->sendEvent(arg2);
|
||||
jresult = (jint)result;
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
*(ESLevent **)&jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,8 +77,9 @@ public class ESLconnection {
|
|||
return (cPtr == 0) ? null : new ESLevent(cPtr, true);
|
||||
}
|
||||
|
||||
public int sendEvent(ESLevent send_me) {
|
||||
return eslJNI.ESLconnection_sendEvent(swigCPtr, this, ESLevent.getCPtr(send_me), send_me);
|
||||
public ESLevent sendEvent(ESLevent send_me) {
|
||||
long cPtr = eslJNI.ESLconnection_sendEvent(swigCPtr, this, ESLevent.getCPtr(send_me), send_me);
|
||||
return (cPtr == 0) ? null : new ESLevent(cPtr, true);
|
||||
}
|
||||
|
||||
public ESLevent recvEvent() {
|
||||
|
|
|
@ -40,7 +40,7 @@ class eslJNI {
|
|||
public final static native long ESLconnection_sendRecv(long jarg1, ESLconnection jarg1_, String jarg2);
|
||||
public final static native long ESLconnection_api(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
|
||||
public final static native long ESLconnection_bgapi(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
|
||||
public final static native int ESLconnection_sendEvent(long jarg1, ESLconnection jarg1_, long jarg2, ESLevent jarg2_);
|
||||
public final static native long ESLconnection_sendEvent(long jarg1, ESLconnection jarg1_, long jarg2, ESLevent jarg2_);
|
||||
public final static native long ESLconnection_recvEvent(long jarg1, ESLconnection jarg1_);
|
||||
public final static native long ESLconnection_recvEventTimed(long jarg1, ESLconnection jarg1_, int jarg2);
|
||||
public final static native long ESLconnection_filter(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
|
||||
|
|
|
@ -2530,7 +2530,7 @@ static int _wrap_ESLconnection_sendEvent(lua_State* L) {
|
|||
int SWIG_arg = -1;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("sendEvent",2,2)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"ESLconnection *");
|
||||
|
@ -2545,9 +2545,9 @@ static int _wrap_ESLconnection_sendEvent(lua_State* L) {
|
|||
SWIG_fail_ptr("ESLconnection_sendEvent",2,SWIGTYPE_p_ESLevent);
|
||||
}
|
||||
|
||||
result = (int)(arg1)->sendEvent(arg2);
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
SWIG_arg=0;
|
||||
lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
|
||||
SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
|
|
|
@ -278,7 +278,7 @@ class ESLPINVOKE {
|
|||
public static extern IntPtr ESLconnection_Bgapi(HandleRef jarg1, string jarg2, string jarg3);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_ESLconnection_SendEvent")]
|
||||
public static extern int ESLconnection_SendEvent(HandleRef jarg1, HandleRef jarg2);
|
||||
public static extern IntPtr ESLconnection_SendEvent(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_ESLconnection_RecvEvent")]
|
||||
public static extern IntPtr ESLconnection_RecvEvent(HandleRef jarg1);
|
||||
|
|
|
@ -86,8 +86,9 @@ public class ESLconnection : IDisposable {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public int SendEvent(ESLevent send_me) {
|
||||
int ret = ESLPINVOKE.ESLconnection_SendEvent(swigCPtr, ESLevent.getCPtr(send_me));
|
||||
public ESLevent SendEvent(ESLevent send_me) {
|
||||
IntPtr cPtr = ESLPINVOKE.ESLconnection_SendEvent(swigCPtr, ESLevent.getCPtr(send_me));
|
||||
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -693,16 +693,16 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Bgapi(void * jarg1, char * ja
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SendEvent(void * jarg1, void * jarg2) {
|
||||
int jresult ;
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_SendEvent(void * jarg1, void * jarg2) {
|
||||
void * jresult ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (ESLevent *)jarg2;
|
||||
result = (int)(arg1)->sendEvent(arg2);
|
||||
jresult = result;
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
|
|
@ -3123,7 +3123,7 @@ XS(_wrap_ESLconnection_sendEvent) {
|
|||
{
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
ESLevent *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
void *argp2 = 0 ;
|
||||
|
@ -3144,8 +3144,8 @@ XS(_wrap_ESLconnection_sendEvent) {
|
|||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_sendEvent" "', argument " "2"" of type '" "ESLevent *""'");
|
||||
}
|
||||
arg2 = reinterpret_cast< ESLevent * >(argp2);
|
||||
result = (int)(arg1)->sendEvent(arg2);
|
||||
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
|
|
|
@ -161,7 +161,8 @@ class ESLconnection {
|
|||
}
|
||||
|
||||
function sendEvent($send_me) {
|
||||
return ESLconnection_sendEvent($this->_cPtr,$send_me);
|
||||
$r=ESLconnection_sendEvent($this->_cPtr,$send_me);
|
||||
return is_resource($r) ? new ESLevent($r) : $r;
|
||||
}
|
||||
|
||||
function recvEvent() {
|
||||
|
|
|
@ -1091,7 +1091,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1159,7 +1159,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_set) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
convert_to_long_ex(args[1]);
|
||||
arg2 = (int) Z_LVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1213,13 +1213,13 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_0) {
|
|||
WRONG_PARAM_COUNT;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[0]);
|
||||
arg1 = (char *) Z_STRVAL_PP(args[0]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
if(arg_count > 1) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1254,7 +1254,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_1) {
|
|||
}
|
||||
}
|
||||
if(arg_count > 1) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
convert_to_long_ex(args[1]);
|
||||
arg2 = (int) Z_LVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1384,7 +1384,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
if(arg_count > 1) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1460,7 +1460,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1557,7 +1557,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addBody) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1591,13 +1591,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addHeader) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1630,7 +1630,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_delHeader) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1719,25 +1719,25 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) {
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[0]);
|
||||
arg1 = (char *) Z_STRVAL_PP(args[0]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[3]);
|
||||
arg4 = (char *) Z_STRVAL_PP(args[3]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1765,19 +1765,19 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) {
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[0]);
|
||||
arg1 = (char *) Z_STRVAL_PP(args[0]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1803,7 +1803,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_2) {
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
convert_to_long_ex(args[0]);
|
||||
arg1 = (int) Z_LVAL_PP(args[0]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -1980,7 +1980,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_send) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2013,7 +2013,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendRecv) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2049,13 +2049,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_api) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
if(arg_count > 2) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2092,13 +2092,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
if(arg_count > 2) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2117,7 +2117,7 @@ fail:
|
|||
ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendEvent) {
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
ESLevent *result = 0 ;
|
||||
zval **args[2];
|
||||
|
||||
SWIG_ResetError();
|
||||
|
@ -2136,9 +2136,9 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendEvent) {
|
|||
SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLconnection_sendEvent. Expected SWIGTYPE_p_ESLevent");
|
||||
}
|
||||
}
|
||||
result = (int)(arg1)->sendEvent(arg2);
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
{
|
||||
ZVAL_LONG(return_value,result);
|
||||
SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0);
|
||||
}
|
||||
return;
|
||||
fail:
|
||||
|
@ -2190,7 +2190,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEventTimed) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
convert_to_long_ex(args[1]);
|
||||
arg2 = (int) Z_LVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2224,13 +2224,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_filter) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2264,13 +2264,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_events) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2307,20 +2307,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
if(arg_count > 2) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
}
|
||||
if(arg_count > 3) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[3]);
|
||||
arg4 = (char *) Z_STRVAL_PP(args[3]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2358,20 +2358,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_executeAsync) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
if(arg_count > 2) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
}
|
||||
if(arg_count > 3) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[3]);
|
||||
arg4 = (char *) Z_STRVAL_PP(args[3]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2405,7 +2405,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setAsyncExecute) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2438,7 +2438,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[1]);
|
||||
arg2 = (char *) Z_STRVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
@ -2489,7 +2489,7 @@ ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel) {
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
convert_to_long_ex(args[0]);
|
||||
arg1 = (int) Z_LVAL_PP(args[0]);
|
||||
/*@SWIG@*/;
|
||||
|
|
|
@ -4205,7 +4205,7 @@ SWIGINTERN PyObject *_wrap_ESLconnection_sendEvent(PyObject *SWIGUNUSEDPARM(self
|
|||
PyObject *resultobj = 0;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
ESLevent *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
void *argp2 = 0 ;
|
||||
|
@ -4227,10 +4227,10 @@ SWIGINTERN PyObject *_wrap_ESLconnection_sendEvent(PyObject *SWIGUNUSEDPARM(self
|
|||
arg2 = reinterpret_cast< ESLevent * >(argp2);
|
||||
{
|
||||
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
|
||||
result = (int)(arg1)->sendEvent(arg2);
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
SWIG_PYTHON_THREAD_END_ALLOW;
|
||||
}
|
||||
resultobj = SWIG_From_int(static_cast< int >(result));
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return resultobj;
|
||||
fail:
|
||||
|
|
|
@ -1902,7 +1902,7 @@ SWIG_ruby_failed(void)
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
|
||||
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
||||
{
|
||||
VALUE obj = args[0];
|
||||
|
@ -3102,7 +3102,7 @@ SWIGINTERN VALUE
|
|||
_wrap_ESLconnection_sendEvent(int argc, VALUE *argv, VALUE self) {
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
ESLevent *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
void *argp2 = 0 ;
|
||||
|
@ -3122,8 +3122,8 @@ _wrap_ESLconnection_sendEvent(int argc, VALUE *argv, VALUE self) {
|
|||
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "ESLevent *","sendEvent", 2, argv[0] ));
|
||||
}
|
||||
arg2 = reinterpret_cast< ESLevent * >(argp2);
|
||||
result = (int)(arg1)->sendEvent(arg2);
|
||||
vresult = SWIG_From_int(static_cast< int >(result));
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
|
||||
return vresult;
|
||||
fail:
|
||||
return Qnil;
|
||||
|
|
|
@ -453,14 +453,12 @@ ESL_DECLARE(esl_status_t) esl_sendevent(esl_handle_t *handle, esl_event_t *event
|
|||
|
||||
snprintf(event_buf, sizeof(event_buf), "sendevent %s\n", esl_event_name(event->event_id));
|
||||
|
||||
if (send(handle->sock, event_buf, strlen(event_buf), 0)) goto fail;
|
||||
if (send(handle->sock, txt, strlen(txt), 0)) goto fail;
|
||||
if (send(handle->sock, "\n\n", 2, 0)) goto fail;
|
||||
if (send(handle->sock, event_buf, strlen(event_buf), 0) <= 0) goto fail;
|
||||
if (send(handle->sock, txt, strlen(txt), 0) <= 0) goto fail;
|
||||
|
||||
free(txt);
|
||||
|
||||
return ESL_SUCCESS;
|
||||
|
||||
return esl_recv(handle);
|
||||
|
||||
fail:
|
||||
|
||||
|
|
|
@ -186,9 +186,18 @@ ESLevent *ESLconnection::executeAsync(const char *app, const char *arg, const ch
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int ESLconnection::sendEvent(ESLevent *send_me)
|
||||
ESLevent *ESLconnection::sendEvent(ESLevent *send_me)
|
||||
{
|
||||
return esl_sendevent(&handle, send_me->event);
|
||||
if (esl_sendevent(&handle, send_me->event) == ESL_SUCCESS) {
|
||||
esl_event_t *e = handle.last_ievent ? handle.last_ievent : handle.last_event;
|
||||
if (e) {
|
||||
esl_event_t *event;
|
||||
esl_event_dup(&event, e);
|
||||
return new ESLevent(event, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return new ESLevent("server_disconnected");
|
||||
}
|
||||
|
||||
ESLevent *ESLconnection::recvEvent()
|
||||
|
|
|
@ -198,6 +198,7 @@ typedef enum {
|
|||
#define esl_safe_free(_x) if (_x) free(_x); _x = NULL
|
||||
#define esl_strlen_zero(s) (!s || *(s) == '\0')
|
||||
#define esl_strlen_zero_buf(s) (*(s) == '\0')
|
||||
#define end_of(_s) *(*_s == '\0' ? _s : _s + strlen(_s) - 1)
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h>
|
||||
|
|
|
@ -83,7 +83,7 @@ class ESLconnection {
|
|||
ESLevent *sendRecv(const char *cmd);
|
||||
ESLevent *api(const char *cmd, const char *arg = NULL);
|
||||
ESLevent *bgapi(const char *cmd, const char *arg = NULL);
|
||||
int sendEvent(ESLevent *send_me);
|
||||
ESLevent *sendEvent(ESLevent *send_me);
|
||||
ESLevent *recvEvent();
|
||||
ESLevent *recvEventTimed(int ms);
|
||||
ESLevent *filter(const char *header, const char *value);
|
||||
|
|
Loading…
Reference in New Issue