mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-13 07:41:51 +00:00
FS-4868 --resolve This patch also adds freeswitch.ready() which will return false once shutdown has started
This commit is contained in:
@@ -177,7 +177,7 @@ public class CoreSession {
|
||||
return freeswitchJNI.CoreSession_recordFile(swigCPtr, this, file_name, time_limit, silence_threshold, silence_hits);
|
||||
}
|
||||
|
||||
public int originate(CoreSession a_leg_session, String dest, int timeout, SWIGTYPE_p_switch_state_handler_table_t handlers) {
|
||||
protected int originate(CoreSession a_leg_session, String dest, int timeout, SWIGTYPE_p_switch_state_handler_table_t handlers) {
|
||||
return freeswitchJNI.CoreSession_originate(swigCPtr, this, CoreSession.getCPtr(a_leg_session), a_leg_session, dest, timeout, SWIGTYPE_p_switch_state_handler_table_t.getCPtr(handlers));
|
||||
}
|
||||
|
||||
|
||||
@@ -69,4 +69,8 @@ public class JavaSession extends CoreSession {
|
||||
return new SWIGTYPE_p_switch_status_t(freeswitchJNI.JavaSession_run_dtmf_callback(swigCPtr, this, SWIGTYPE_p_void.getCPtr(input), SWIGTYPE_p_switch_input_type_t.getCPtr(itype)), true);
|
||||
}
|
||||
|
||||
public int originate(JavaSession aleg, String destination, int timeout) {
|
||||
return freeswitchJNI.JavaSession_originate(swigCPtr, this, JavaSession.getCPtr(aleg), aleg, destination, timeout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,10 @@ public class freeswitch {
|
||||
freeswitchJNI.consoleCleanLog(msg);
|
||||
}
|
||||
|
||||
public static boolean running() {
|
||||
return freeswitchJNI.running();
|
||||
}
|
||||
|
||||
public static boolean email(String to, String from, String headers, String body, String file, String convert_cmd, String convert_ext) {
|
||||
return freeswitchJNI.email(to, from, headers, body, file, convert_cmd, convert_ext);
|
||||
}
|
||||
@@ -62,4 +66,8 @@ public class freeswitch {
|
||||
return (cPtr == 0) ? null : new SWIGTYPE_p_JavaVM(cPtr, false);
|
||||
}
|
||||
|
||||
public static void setOriginateStateHandler(org.freeswitch.StateHandler stateHandler) throws java.util.TooManyListenersException {
|
||||
freeswitchJNI.setOriginateStateHandler(stateHandler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class freeswitchJNI {
|
||||
public final static native String getGlobalVariable(String jarg1);
|
||||
public final static native void consoleLog(String jarg1, String jarg2);
|
||||
public final static native void consoleCleanLog(String jarg1);
|
||||
public final static native boolean running();
|
||||
public final static native boolean email(String jarg1, String jarg2, String jarg3, String jarg4, String jarg5, String jarg6, String jarg7);
|
||||
public final static native long new_IVRMenu(long jarg1, IVRMenu jarg1_, String jarg2, String jarg3, String jarg4, String jarg5, String jarg6, String jarg7, String jarg8, String jarg9, String jarg10, int jarg11, int jarg12, int jarg13, int jarg14, int jarg15, int jarg16);
|
||||
public final static native void delete_IVRMenu(long jarg1);
|
||||
@@ -162,6 +163,7 @@ class freeswitchJNI {
|
||||
public final static native long dtmf_callback(long jarg1, long jarg2, long jarg3, long jarg4, long jarg5);
|
||||
public final static native void javaVM_set(long jarg1);
|
||||
public final static native long javaVM_get();
|
||||
public final static native void setOriginateStateHandler(org.freeswitch.StateHandler jarg1) throws java.util.TooManyListenersException;
|
||||
public final static native long new_JavaSession__SWIG_0();
|
||||
public final static native long new_JavaSession__SWIG_1(String jarg1);
|
||||
public final static native long new_JavaSession__SWIG_2(long jarg1);
|
||||
@@ -172,5 +174,6 @@ class freeswitchJNI {
|
||||
public final static native void JavaSession_setHangupHook(long jarg1, JavaSession jarg1_, org.freeswitch.HangupHook jarg2);
|
||||
public final static native void JavaSession_check_hangup_hook(long jarg1, JavaSession jarg1_);
|
||||
public final static native long JavaSession_run_dtmf_callback(long jarg1, JavaSession jarg1_, long jarg2, long jarg3);
|
||||
public final static native int JavaSession_originate(long jarg1, JavaSession jarg1_, long jarg2, JavaSession jarg2_, String jarg3, int jarg4);
|
||||
public final static native long SWIGJavaSessionUpcast(long jarg1);
|
||||
}
|
||||
|
||||
@@ -199,6 +199,7 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
|
||||
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
|
||||
|
||||
|
||||
#include "switch.h"
|
||||
#include "switch_cpp.h"
|
||||
#include "freeswitch_java.h"
|
||||
|
||||
@@ -286,6 +287,18 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_consoleCleanLog(J
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_running(JNIEnv *jenv, jclass jcls) {
|
||||
jboolean jresult = 0 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
result = (bool)running();
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_email(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5, jstring jarg6, jstring jarg7) {
|
||||
jboolean jresult = 0 ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
@@ -3176,6 +3189,16 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_javaVM_1get(JNIE
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_setOriginateStateHandler(JNIEnv *jenv, jclass jcls, jobject jarg1) {
|
||||
jobject arg1 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = jarg1;
|
||||
setOriginateStateHandler(arg1);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_new_1JavaSession_1_1SWIG_10(JNIEnv *jenv, jclass jcls) {
|
||||
jlong jresult = 0 ;
|
||||
JavaSession *result = 0 ;
|
||||
@@ -3331,6 +3354,33 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1run
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1originate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jint jarg4) {
|
||||
jint jresult = 0 ;
|
||||
JavaSession *arg1 = (JavaSession *) 0 ;
|
||||
JavaSession *arg2 = (JavaSession *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
int arg4 ;
|
||||
int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
(void)jarg2_;
|
||||
arg1 = *(JavaSession **)&jarg1;
|
||||
arg2 = *(JavaSession **)&jarg2;
|
||||
arg3 = 0;
|
||||
if (jarg3) {
|
||||
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
|
||||
if (!arg3) return 0;
|
||||
}
|
||||
arg4 = (int)jarg4;
|
||||
result = (int)(arg1)->originate(arg2,arg3,arg4);
|
||||
jresult = (jint)result;
|
||||
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_SWIGJavaSessionUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
jlong baseptr = 0;
|
||||
(void)jenv;
|
||||
|
||||
Reference in New Issue
Block a user