pelims for java esl (needs work any voulenteers?)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13950 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-06-25 16:02:37 +00:00
parent 52febfcb76
commit 75c545d97a
8 changed files with 1412 additions and 0 deletions

25
libs/esl/java/Makefile Normal file
View File

@ -0,0 +1,25 @@
LOCAL_CFLAGS=-I../src/include -I/usr/java/jdk1.6.0_14/include -I/usr/java/jdk1.6.0_14/include/linux
GCC_WARNING_JUNK=-w
CLASSES=org/freeswitch/esl/*
all: esl.jar
esl_wrap.cpp:
swig -module esl -java -c++ $(LOCAL_CFLAGS) -package org.freeswitch.esl -outdir org/freeswitch/esl -o esl_wrap.cpp ../ESL.i
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(LOCAL_CFLAGS) $(CXXFLAGS) $(GCC_WARNING_JUNK) $(PERL_INC) -c esl_wrap.cpp -o esl_wrap.o
esl.jar: esl_wrap.o
mkdir -p classes
javac -sourcepath org -d classes $(CLASSES)
jar cf esl.jar -C classes org
clean:
rm -f *.o *.so *~ *.jar
swigclean:
rm -f esl_wrap.*
reswig: swigclean esl_wrap.cpp

1034
libs/esl/java/esl_wrap.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,119 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.freeswitch.esl;
public class ESLconnection {
private long swigCPtr;
protected boolean swigCMemOwn;
protected ESLconnection(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(ESLconnection obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if(swigCPtr != 0 && swigCMemOwn) {
swigCMemOwn = false;
eslJNI.delete_ESLconnection(swigCPtr);
}
swigCPtr = 0;
}
public ESLconnection(String host, String port, String password) {
this(eslJNI.new_ESLconnection__SWIG_0(host, port, password), true);
}
public ESLconnection(int socket) {
this(eslJNI.new_ESLconnection__SWIG_1(socket), true);
}
public int socketDescriptor() {
return eslJNI.ESLconnection_socketDescriptor(swigCPtr, this);
}
public int connected() {
return eslJNI.ESLconnection_connected(swigCPtr, this);
}
public ESLevent getInfo() {
long cPtr = eslJNI.ESLconnection_getInfo(swigCPtr, this);
return (cPtr == 0) ? null : new ESLevent(cPtr, false);
}
public int send(String cmd) {
return eslJNI.ESLconnection_send(swigCPtr, this, cmd);
}
public ESLevent sendRecv(String cmd) {
long cPtr = eslJNI.ESLconnection_sendRecv(swigCPtr, this, cmd);
return (cPtr == 0) ? null : new ESLevent(cPtr, false);
}
public ESLevent api(String cmd, String arg) {
long cPtr = eslJNI.ESLconnection_api(swigCPtr, this, cmd, arg);
return (cPtr == 0) ? null : new ESLevent(cPtr, false);
}
public ESLevent bgapi(String cmd, String arg) {
long cPtr = eslJNI.ESLconnection_bgapi(swigCPtr, this, cmd, arg);
return (cPtr == 0) ? null : new ESLevent(cPtr, false);
}
public int sendEvent(ESLevent send_me) {
return eslJNI.ESLconnection_sendEvent(swigCPtr, this, ESLevent.getCPtr(send_me), send_me);
}
public ESLevent recvEvent() {
long cPtr = eslJNI.ESLconnection_recvEvent(swigCPtr, this);
return (cPtr == 0) ? null : new ESLevent(cPtr, false);
}
public ESLevent recvEventTimed(int ms) {
long cPtr = eslJNI.ESLconnection_recvEventTimed(swigCPtr, this, ms);
return (cPtr == 0) ? null : new ESLevent(cPtr, false);
}
public ESLevent filter(String header, String value) {
long cPtr = eslJNI.ESLconnection_filter(swigCPtr, this, header, value);
return (cPtr == 0) ? null : new ESLevent(cPtr, false);
}
public int events(String etype, String value) {
return eslJNI.ESLconnection_events(swigCPtr, this, etype, value);
}
public int execute(String app, String arg, String uuid) {
return eslJNI.ESLconnection_execute(swigCPtr, this, app, arg, uuid);
}
public int executeAsync(String app, String arg, String uuid) {
return eslJNI.ESLconnection_executeAsync(swigCPtr, this, app, arg, uuid);
}
public int setAsyncExecute(String val) {
return eslJNI.ESLconnection_setAsyncExecute(swigCPtr, this, val);
}
public int setEventLock(String val) {
return eslJNI.ESLconnection_setEventLock(swigCPtr, this, val);
}
public int disconnect() {
return eslJNI.ESLconnection_disconnect(swigCPtr, this);
}
}

View File

@ -0,0 +1,113 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.freeswitch.esl;
public class ESLevent {
private long swigCPtr;
protected boolean swigCMemOwn;
protected ESLevent(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(ESLevent obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if(swigCPtr != 0 && swigCMemOwn) {
swigCMemOwn = false;
eslJNI.delete_ESLevent(swigCPtr);
}
swigCPtr = 0;
}
public void setEvent(SWIGTYPE_p_esl_event_t value) {
eslJNI.ESLevent_event_set(swigCPtr, this, SWIGTYPE_p_esl_event_t.getCPtr(value));
}
public SWIGTYPE_p_esl_event_t getEvent() {
long cPtr = eslJNI.ESLevent_event_get(swigCPtr, this);
return (cPtr == 0) ? null : new SWIGTYPE_p_esl_event_t(cPtr, false);
}
public void setSerialized_string(String value) {
eslJNI.ESLevent_serialized_string_set(swigCPtr, this, value);
}
public String getSerialized_string() {
return eslJNI.ESLevent_serialized_string_get(swigCPtr, this);
}
public void setMine(int value) {
eslJNI.ESLevent_mine_set(swigCPtr, this, value);
}
public int getMine() {
return eslJNI.ESLevent_mine_get(swigCPtr, this);
}
public ESLevent(String type, String subclass_name) {
this(eslJNI.new_ESLevent__SWIG_0(type, subclass_name), true);
}
public ESLevent(SWIGTYPE_p_esl_event_t wrap_me, int free_me) {
this(eslJNI.new_ESLevent__SWIG_1(SWIGTYPE_p_esl_event_t.getCPtr(wrap_me), free_me), true);
}
public ESLevent(ESLevent me) {
this(eslJNI.new_ESLevent__SWIG_2(ESLevent.getCPtr(me), me), true);
}
public String serialize(String format) {
return eslJNI.ESLevent_serialize(swigCPtr, this, format);
}
public boolean setPriority(SWIGTYPE_p_esl_priority_t priority) {
return eslJNI.ESLevent_setPriority(swigCPtr, this, SWIGTYPE_p_esl_priority_t.getCPtr(priority));
}
public String getHeader(String header_name) {
return eslJNI.ESLevent_getHeader(swigCPtr, this, header_name);
}
public String getBody() {
return eslJNI.ESLevent_getBody(swigCPtr, this);
}
public String getType() {
return eslJNI.ESLevent_getType(swigCPtr, this);
}
public boolean addBody(String value) {
return eslJNI.ESLevent_addBody(swigCPtr, this, value);
}
public boolean addHeader(String header_name, String value) {
return eslJNI.ESLevent_addHeader(swigCPtr, this, header_name, value);
}
public boolean delHeader(String header_name) {
return eslJNI.ESLevent_delHeader(swigCPtr, this, header_name);
}
public String firstHeader() {
return eslJNI.ESLevent_firstHeader(swigCPtr, this);
}
public String nextHeader() {
return eslJNI.ESLevent_nextHeader(swigCPtr, this);
}
}

View File

@ -0,0 +1,26 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.freeswitch.esl;
public class SWIGTYPE_p_esl_event_t {
private long swigCPtr;
protected SWIGTYPE_p_esl_event_t(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
protected SWIGTYPE_p_esl_event_t() {
swigCPtr = 0;
}
protected static long getCPtr(SWIGTYPE_p_esl_event_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@ -0,0 +1,26 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.freeswitch.esl;
public class SWIGTYPE_p_esl_priority_t {
private long swigCPtr;
protected SWIGTYPE_p_esl_priority_t(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
protected SWIGTYPE_p_esl_priority_t() {
swigCPtr = 0;
}
protected static long getCPtr(SWIGTYPE_p_esl_priority_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@ -0,0 +1,16 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.freeswitch.esl;
public class esl {
public static void eslSetLogLevel(int level) {
eslJNI.eslSetLogLevel(level);
}
}

View File

@ -0,0 +1,53 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.freeswitch.esl;
class eslJNI {
public final static native void ESLevent_event_set(long jarg1, ESLevent jarg1_, long jarg2);
public final static native long ESLevent_event_get(long jarg1, ESLevent jarg1_);
public final static native void ESLevent_serialized_string_set(long jarg1, ESLevent jarg1_, String jarg2);
public final static native String ESLevent_serialized_string_get(long jarg1, ESLevent jarg1_);
public final static native void ESLevent_mine_set(long jarg1, ESLevent jarg1_, int jarg2);
public final static native int ESLevent_mine_get(long jarg1, ESLevent jarg1_);
public final static native long new_ESLevent__SWIG_0(String jarg1, String jarg2);
public final static native long new_ESLevent__SWIG_1(long jarg1, int jarg2);
public final static native long new_ESLevent__SWIG_2(long jarg1, ESLevent jarg1_);
public final static native void delete_ESLevent(long jarg1);
public final static native String ESLevent_serialize(long jarg1, ESLevent jarg1_, String jarg2);
public final static native boolean ESLevent_setPriority(long jarg1, ESLevent jarg1_, long jarg2);
public final static native String ESLevent_getHeader(long jarg1, ESLevent jarg1_, String jarg2);
public final static native String ESLevent_getBody(long jarg1, ESLevent jarg1_);
public final static native String ESLevent_getType(long jarg1, ESLevent jarg1_);
public final static native boolean ESLevent_addBody(long jarg1, ESLevent jarg1_, String jarg2);
public final static native boolean ESLevent_addHeader(long jarg1, ESLevent jarg1_, String jarg2, String jarg3);
public final static native boolean ESLevent_delHeader(long jarg1, ESLevent jarg1_, String jarg2);
public final static native String ESLevent_firstHeader(long jarg1, ESLevent jarg1_);
public final static native String ESLevent_nextHeader(long jarg1, ESLevent jarg1_);
public final static native long new_ESLconnection__SWIG_0(String jarg1, String jarg2, String jarg3);
public final static native long new_ESLconnection__SWIG_1(int jarg1);
public final static native void delete_ESLconnection(long jarg1);
public final static native int ESLconnection_socketDescriptor(long jarg1, ESLconnection jarg1_);
public final static native int ESLconnection_connected(long jarg1, ESLconnection jarg1_);
public final static native long ESLconnection_getInfo(long jarg1, ESLconnection jarg1_);
public final static native int ESLconnection_send(long jarg1, ESLconnection jarg1_, String jarg2);
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_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);
public final static native int ESLconnection_events(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
public final static native int ESLconnection_execute(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3, String jarg4);
public final static native int ESLconnection_executeAsync(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3, String jarg4);
public final static native int ESLconnection_setAsyncExecute(long jarg1, ESLconnection jarg1_, String jarg2);
public final static native int ESLconnection_setEventLock(long jarg1, ESLconnection jarg1_, String jarg2);
public final static native int ESLconnection_disconnect(long jarg1, ESLconnection jarg1_);
public final static native void eslSetLogLevel(int jarg1);
}