This commit is contained in:
Mike Jerris 2018-08-22 19:54:37 +00:00
parent d3e320ef56
commit 798e5ea095
11 changed files with 24574 additions and 23332 deletions

View File

@ -235,10 +235,18 @@ public class CoreSession {
return freeswitchJNI.CoreSession_read(swigCPtr, this, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout);
}
public void detectSpeech(String arg0, String arg1, String arg2, String arg3) {
freeswitchJNI.CoreSession_detectSpeech(swigCPtr, this, arg0, arg1, arg2, arg3);
}
public String playAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, String terminators, String audio_files, String bad_input_audio_files, String digits_regex, String var_name, int digit_timeout, String transfer_on_failure) {
return freeswitchJNI.CoreSession_playAndGetDigits(swigCPtr, this, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name, digit_timeout, transfer_on_failure);
}
public String playAndDetectSpeech(String file, String engine, String grammar) {
return freeswitchJNI.CoreSession_playAndDetectSpeech(swigCPtr, this, file, engine, grammar);
}
public int streamFile(String file, int starting_sample_count) {
return freeswitchJNI.CoreSession_streamFile(swigCPtr, this, file, starting_sample_count);
}

View File

@ -140,7 +140,9 @@ public class freeswitchJNI {
public final static native String CoreSession_getDigits__SWIG_2(long jarg1, CoreSession jarg1_, int jarg2, String jarg3, int jarg4, int jarg5, int jarg6);
public final static native int CoreSession_transfer(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4);
public final static native String CoreSession_read(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, String jarg4, int jarg5, String jarg6, int jarg7);
public final static native void CoreSession_detectSpeech(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4, String jarg5);
public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9, String jarg10, int jarg11, String jarg12);
public final static native String CoreSession_playAndDetectSpeech(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4);
public final static native int CoreSession_streamFile(long jarg1, CoreSession jarg1_, String jarg2, int jarg3);
public final static native int CoreSession_sleep(long jarg1, CoreSession jarg1_, int jarg2, int jarg3);
public final static native int CoreSession_flushEvents(long jarg1, CoreSession jarg1_);

View File

@ -639,6 +639,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_API_1execute(J
if (result) jresult = jenv->NewStringUTF((const char *)result);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
free(result);
return jresult;
}
@ -661,6 +662,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_API_1executeSt
result = (char *)(arg1)->executeString((char const *)arg2);
if (result) jresult = jenv->NewStringUTF((const char *)result);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
free(result);
return jresult;
}
@ -2823,6 +2825,45 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1r
}
SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1detectSpeech(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5) {
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) NULL ;
char *arg4 = (char *) NULL ;
char *arg5 = (char *) NULL ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(CoreSession **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return ;
}
arg3 = 0;
if (jarg3) {
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3) return ;
}
arg4 = 0;
if (jarg4) {
arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0);
if (!arg4) return ;
}
arg5 = 0;
if (jarg5) {
arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0);
if (!arg5) return ;
}
(arg1)->detectSpeech(arg2,arg3,arg4,arg5);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
if (arg5) jenv->ReleaseStringUTFChars(jarg5, (const char *)arg5);
}
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndGetDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jstring jarg9, jstring jarg10, jint jarg11, jstring jarg12) {
jstring jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
@ -2890,6 +2931,43 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1p
}
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndDetectSpeech(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4) {
jstring jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
char *arg4 = (char *) 0 ;
char *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(CoreSession **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return 0;
}
arg3 = 0;
if (jarg3) {
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3) return 0;
}
arg4 = 0;
if (jarg4) {
arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0);
if (!arg4) return 0;
}
result = (char *)(arg1)->playAndDetectSpeech(arg2,arg3,arg4);
if (result) jresult = jenv->NewStringUTF((const char *)result);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
free(result);
return jresult;
}
SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1streamFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) {
jint jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;

View File

@ -6964,6 +6964,47 @@ fail:
}
static int _wrap_CoreSession_detectSpeech(lua_State* L) {
int SWIG_arg = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) NULL ;
char *arg4 = (char *) NULL ;
char *arg5 = (char *) NULL ;
SWIG_check_num_args("CoreSession::detectSpeech",2,5)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::detectSpeech",1,"CoreSession *");
if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::detectSpeech",2,"char *");
if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::detectSpeech",3,"char *");
if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::detectSpeech",4,"char *");
if(lua_gettop(L)>=5 && !SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("CoreSession::detectSpeech",5,"char *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_detectSpeech",1,SWIGTYPE_p_CoreSession);
}
arg2 = (char *)lua_tostring(L, 2);
if(lua_gettop(L)>=3){
arg3 = (char *)lua_tostring(L, 3);
}
if(lua_gettop(L)>=4){
arg4 = (char *)lua_tostring(L, 4);
}
if(lua_gettop(L)>=5){
arg5 = (char *)lua_tostring(L, 5);
}
(arg1)->detectSpeech(arg2,arg3,arg4,arg5);
return SWIG_arg;
if(0) SWIG_fail;
fail:
lua_error(L);
return SWIG_arg;
}
static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
int SWIG_arg = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@ -7027,6 +7068,40 @@ fail:
}
static int _wrap_CoreSession_playAndDetectSpeech(lua_State* L) {
int SWIG_arg = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
char *arg4 = (char *) 0 ;
char *result = 0 ;
SWIG_check_num_args("CoreSession::playAndDetectSpeech",4,4)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::playAndDetectSpeech",1,"CoreSession *");
if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::playAndDetectSpeech",2,"char *");
if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::playAndDetectSpeech",3,"char *");
if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::playAndDetectSpeech",4,"char *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_playAndDetectSpeech",1,SWIGTYPE_p_CoreSession);
}
arg2 = (char *)lua_tostring(L, 2);
arg3 = (char *)lua_tostring(L, 3);
arg4 = (char *)lua_tostring(L, 4);
result = (char *)(arg1)->playAndDetectSpeech(arg2,arg3,arg4);
lua_pushstring(L,(const char *)result); SWIG_arg++;
free(result);
return SWIG_arg;
if(0) SWIG_fail;
fail:
lua_error(L);
return SWIG_arg;
}
static int _wrap_CoreSession_streamFile(lua_State* L) {
int SWIG_arg = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@ -7702,7 +7777,9 @@ static swig_lua_method swig_CoreSession_methods[]= {
{ "getDigits", _wrap_CoreSession_getDigits},
{ "transfer", _wrap_CoreSession_transfer},
{ "read", _wrap_CoreSession_read},
{ "detectSpeech", _wrap_CoreSession_detectSpeech},
{ "playAndGetDigits", _wrap_CoreSession_playAndGetDigits},
{ "playAndDetectSpeech", _wrap_CoreSession_playAndDetectSpeech},
{ "streamFile", _wrap_CoreSession_streamFile},
{ "sleep", _wrap_CoreSession_sleep},
{ "flushEvents", _wrap_CoreSession_flushEvents},

View File

@ -39,7 +39,7 @@ swigclean: clean
rm -f freeswitch_wrap.cxx managed/swig.cs
freeswitch_wrap.cxx:
swig2.0 -I../../../include -v -O -c++ -csharp -namespace FreeSWITCH.Native -dllimport mod_managed -DSWIG_CSHARP_NO_STRING_HELPER freeswitch.i
swig3.0 -I../../../include -v -O -c++ -csharp -namespace FreeSWITCH.Native -dllimport mod_managed -DSWIG_CSHARP_NO_STRING_HELPER freeswitch.i
rm -f ./managed/swig.cs
cat *.cs > ./managed/swig.cs
rm -f *.cs

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -442,7 +442,9 @@ sub DESTROY {
*getDigits = *freeswitchc::CoreSession_getDigits;
*transfer = *freeswitchc::CoreSession_transfer;
*read = *freeswitchc::CoreSession_read;
*detectSpeech = *freeswitchc::CoreSession_detectSpeech;
*playAndGetDigits = *freeswitchc::CoreSession_playAndGetDigits;
*playAndDetectSpeech = *freeswitchc::CoreSession_playAndDetectSpeech;
*streamFile = *freeswitchc::CoreSession_streamFile;
*sleep = *freeswitchc::CoreSession_sleep;
*flushEvents = *freeswitchc::CoreSession_flushEvents;
@ -513,6 +515,12 @@ sub DESTROY {
*unsetInputCallback = *freeswitchc::Session_unsetInputCallback;
*setHangupHook = *freeswitchc::Session_setHangupHook;
*ready = *freeswitchc::Session_ready;
*swig_callback_mutex_get = *freeswitchc::Session_callback_mutex_get;
*swig_callback_mutex_set = *freeswitchc::Session_callback_mutex_set;
*swig_destroying_get = *freeswitchc::Session_destroying_get;
*swig_destroying_set = *freeswitchc::Session_destroying_set;
*swig_event_idx_get = *freeswitchc::Session_event_idx_get;
*swig_event_idx_set = *freeswitchc::Session_event_idx_set;
*swig_suuid_get = *freeswitchc::Session_suuid_get;
*swig_suuid_set = *freeswitchc::Session_suuid_set;
*swig_cb_function_get = *freeswitchc::Session_cb_function_get;

View File

@ -1552,15 +1552,16 @@ SWIG_Perl_SetModule(swig_module_info *module) {
#define SWIGTYPE_p_switch_event_types_t swig_types[19]
#define SWIGTYPE_p_switch_input_args_t swig_types[20]
#define SWIGTYPE_p_switch_input_type_t swig_types[21]
#define SWIGTYPE_p_switch_priority_t swig_types[22]
#define SWIGTYPE_p_switch_queue_t swig_types[23]
#define SWIGTYPE_p_switch_state_handler_table_t swig_types[24]
#define SWIGTYPE_p_switch_status_t swig_types[25]
#define SWIGTYPE_p_switch_stream_handle_t swig_types[26]
#define SWIGTYPE_p_uint32_t swig_types[27]
#define SWIGTYPE_p_void swig_types[28]
static swig_type_info *swig_types[30];
static swig_module_info swig_module = {swig_types, 29, 0, 0, 0, 0};
#define SWIGTYPE_p_switch_mutex_t swig_types[22]
#define SWIGTYPE_p_switch_priority_t swig_types[23]
#define SWIGTYPE_p_switch_queue_t swig_types[24]
#define SWIGTYPE_p_switch_state_handler_table_t swig_types[25]
#define SWIGTYPE_p_switch_status_t swig_types[26]
#define SWIGTYPE_p_switch_stream_handle_t swig_types[27]
#define SWIGTYPE_p_uint32_t swig_types[28]
#define SWIGTYPE_p_void swig_types[29]
static swig_type_info *swig_types[31];
static swig_module_info swig_module = {swig_types, 30, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@ -7629,6 +7630,83 @@ XS(_wrap_CoreSession_read) {
}
XS(_wrap_CoreSession_detectSpeech) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) NULL ;
char *arg4 = (char *) NULL ;
char *arg5 = (char *) NULL ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
int res4 ;
char *buf4 = 0 ;
int alloc4 = 0 ;
int res5 ;
char *buf5 = 0 ;
int alloc5 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 5)) {
SWIG_croak("Usage: CoreSession_detectSpeech(self,arg0,arg1,arg2,arg3);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_detectSpeech" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_detectSpeech" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
if (items > 2) {
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_detectSpeech" "', argument " "3"" of type '" "char *""'");
}
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 '" "CoreSession_detectSpeech" "', argument " "4"" of type '" "char *""'");
}
arg4 = reinterpret_cast< char * >(buf4);
}
if (items > 4) {
res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
if (!SWIG_IsOK(res5)) {
SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_detectSpeech" "', argument " "5"" of type '" "char *""'");
}
arg5 = reinterpret_cast< char * >(buf5);
}
(arg1)->detectSpeech(arg2,arg3,arg4,arg5);
ST(argvi) = sv_newmortal();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
SWIG_croak_null();
}
}
XS(_wrap_CoreSession_playAndGetDigits) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
@ -7779,6 +7857,68 @@ XS(_wrap_CoreSession_playAndGetDigits) {
}
XS(_wrap_CoreSession_playAndDetectSpeech) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
char *arg4 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
int res4 ;
char *buf4 = 0 ;
int alloc4 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 4) || (items > 4)) {
SWIG_croak("Usage: CoreSession_playAndDetectSpeech(self,file,engine,grammar);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_playAndDetectSpeech" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_playAndDetectSpeech" "', argument " "2"" of type '" "char *""'");
}
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 '" "CoreSession_playAndDetectSpeech" "', argument " "3"" of type '" "char *""'");
}
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 '" "CoreSession_playAndDetectSpeech" "', argument " "4"" of type '" "char *""'");
}
arg4 = reinterpret_cast< char * >(buf4);
result = (char *)(arg1)->playAndDetectSpeech(arg2,arg3,arg4);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
free(result);
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
SWIG_croak_null();
}
}
XS(_wrap_CoreSession_streamFile) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
@ -9856,6 +9996,201 @@ XS(_wrap_Session_ready) {
}
XS(_wrap_Session_callback_mutex_set) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
switch_mutex_t *arg2 = (switch_mutex_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_callback_mutex_set(self,callback_mutex);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_callback_mutex_set" "', argument " "1"" of type '" "PERL::Session *""'");
}
arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_switch_mutex_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_callback_mutex_set" "', argument " "2"" of type '" "switch_mutex_t *""'");
}
arg2 = reinterpret_cast< switch_mutex_t * >(argp2);
if (arg1) (arg1)->callback_mutex = arg2;
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Session_callback_mutex_get) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
switch_mutex_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_callback_mutex_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_callback_mutex_get" "', argument " "1"" of type '" "PERL::Session *""'");
}
arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (switch_mutex_t *) ((arg1)->callback_mutex);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_switch_mutex_t, 0 | 0); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Session_destroying_set) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_destroying_set(self,destroying);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroying_set" "', argument " "1"" of type '" "PERL::Session *""'");
}
arg1 = reinterpret_cast< PERL::Session * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Session_destroying_set" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
if (arg1) (arg1)->destroying = arg2;
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Session_destroying_get) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_destroying_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroying_get" "', argument " "1"" of type '" "PERL::Session *""'");
}
arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (int) ((arg1)->destroying);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Session_event_idx_set) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_event_idx_set(self,event_idx);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_event_idx_set" "', argument " "1"" of type '" "PERL::Session *""'");
}
arg1 = reinterpret_cast< PERL::Session * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Session_event_idx_set" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
if (arg1) (arg1)->event_idx = arg2;
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Session_event_idx_get) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_event_idx_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_event_idx_get" "', argument " "1"" of type '" "PERL::Session *""'");
}
arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (int) ((arg1)->event_idx);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Session_suuid_set) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
@ -10281,6 +10616,7 @@ static swig_type_info _swigt__p_switch_event_t = {"_p_switch_event_t", "switch_e
static swig_type_info _swigt__p_switch_event_types_t = {"_p_switch_event_types_t", "switch_event_types_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_input_args_t = {"_p_switch_input_args_t", "switch_input_args_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_input_type_t = {"_p_switch_input_type_t", "switch_input_type_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_mutex_t = {"_p_switch_mutex_t", "switch_mutex_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_priority_t = {"_p_switch_priority_t", "switch_priority_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_queue_t = {"_p_switch_queue_t", "switch_queue_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_state_handler_table_t = {"_p_switch_state_handler_table_t", "switch_state_handler_table_t *", 0, 0, (void*)0, 0};
@ -10312,6 +10648,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_switch_event_types_t,
&_swigt__p_switch_input_args_t,
&_swigt__p_switch_input_type_t,
&_swigt__p_switch_mutex_t,
&_swigt__p_switch_priority_t,
&_swigt__p_switch_queue_t,
&_swigt__p_switch_state_handler_table_t,
@ -10343,6 +10680,7 @@ static swig_cast_info _swigc__p_switch_event_t[] = { {&_swigt__p_switch_event_t
static swig_cast_info _swigc__p_switch_event_types_t[] = { {&_swigt__p_switch_event_types_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_input_args_t[] = { {&_swigt__p_switch_input_args_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_input_type_t[] = { {&_swigt__p_switch_input_type_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_mutex_t[] = { {&_swigt__p_switch_mutex_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_priority_t[] = { {&_swigt__p_switch_priority_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_queue_t[] = { {&_swigt__p_switch_queue_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_state_handler_table_t[] = { {&_swigt__p_switch_state_handler_table_t, 0, 0, 0},{0, 0, 0, 0}};
@ -10374,6 +10712,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_switch_event_types_t,
_swigc__p_switch_input_args_t,
_swigc__p_switch_input_type_t,
_swigc__p_switch_mutex_t,
_swigc__p_switch_priority_t,
_swigc__p_switch_queue_t,
_swigc__p_switch_state_handler_table_t,
@ -10519,7 +10858,9 @@ static swig_command_info swig_commands[] = {
{"freeswitchc::CoreSession_getDigits", _wrap_CoreSession_getDigits},
{"freeswitchc::CoreSession_transfer", _wrap_CoreSession_transfer},
{"freeswitchc::CoreSession_read", _wrap_CoreSession_read},
{"freeswitchc::CoreSession_detectSpeech", _wrap_CoreSession_detectSpeech},
{"freeswitchc::CoreSession_playAndGetDigits", _wrap_CoreSession_playAndGetDigits},
{"freeswitchc::CoreSession_playAndDetectSpeech", _wrap_CoreSession_playAndDetectSpeech},
{"freeswitchc::CoreSession_streamFile", _wrap_CoreSession_streamFile},
{"freeswitchc::CoreSession_sleep", _wrap_CoreSession_sleep},
{"freeswitchc::CoreSession_flushEvents", _wrap_CoreSession_flushEvents},
@ -10562,6 +10903,12 @@ static swig_command_info swig_commands[] = {
{"freeswitchc::Session_unsetInputCallback", _wrap_Session_unsetInputCallback},
{"freeswitchc::Session_setHangupHook", _wrap_Session_setHangupHook},
{"freeswitchc::Session_ready", _wrap_Session_ready},
{"freeswitchc::Session_callback_mutex_set", _wrap_Session_callback_mutex_set},
{"freeswitchc::Session_callback_mutex_get", _wrap_Session_callback_mutex_get},
{"freeswitchc::Session_destroying_set", _wrap_Session_destroying_set},
{"freeswitchc::Session_destroying_get", _wrap_Session_destroying_get},
{"freeswitchc::Session_event_idx_set", _wrap_Session_event_idx_set},
{"freeswitchc::Session_event_idx_get", _wrap_Session_event_idx_get},
{"freeswitchc::Session_suuid_set", _wrap_Session_suuid_set},
{"freeswitchc::Session_suuid_get", _wrap_Session_suuid_get},
{"freeswitchc::Session_cb_function_set", _wrap_Session_cb_function_set},

View File

@ -518,9 +518,15 @@ class CoreSession(_object):
def read(self, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout=0):
return _freeswitch.CoreSession_read(self, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout)
def detectSpeech(self, arg0, arg1=None, arg2=None, arg3=None):
return _freeswitch.CoreSession_detectSpeech(self, arg0, arg1, arg2, arg3)
def playAndGetDigits(self, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name=None, digit_timeout=0, transfer_on_failure=None):
return _freeswitch.CoreSession_playAndGetDigits(self, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name, digit_timeout, transfer_on_failure)
def playAndDetectSpeech(self, file, engine, grammar):
return _freeswitch.CoreSession_playAndDetectSpeech(self, file, engine, grammar)
def streamFile(self, file, starting_sample_count=0):
return _freeswitch.CoreSession_streamFile(self, file, starting_sample_count)

View File

@ -4329,6 +4329,7 @@ SWIGINTERN PyObject *_wrap_API_execute(PyObject *SWIGUNUSEDPARM(self), PyObject
resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
free(result);
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@ -4364,6 +4365,7 @@ SWIGINTERN PyObject *_wrap_API_executeString(PyObject *SWIGUNUSEDPARM(self), PyO
result = (char *)(arg1)->executeString((char const *)arg2);
resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
free(result);
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@ -8401,6 +8403,81 @@ fail:
}
SWIGINTERN PyObject *_wrap_CoreSession_detectSpeech(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) NULL ;
char *arg4 = (char *) NULL ;
char *arg5 = (char *) NULL ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
int res4 ;
char *buf4 = 0 ;
int alloc4 = 0 ;
int res5 ;
char *buf5 = 0 ;
int alloc5 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
PyObject * obj4 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO|OOO:CoreSession_detectSpeech",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_detectSpeech" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_detectSpeech" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
if (obj2) {
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_detectSpeech" "', argument " "3"" of type '" "char *""'");
}
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 '" "CoreSession_detectSpeech" "', argument " "4"" of type '" "char *""'");
}
arg4 = reinterpret_cast< char * >(buf4);
}
if (obj4) {
res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
if (!SWIG_IsOK(res5)) {
SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_detectSpeech" "', argument " "5"" of type '" "char *""'");
}
arg5 = reinterpret_cast< char * >(buf5);
}
(arg1)->detectSpeech(arg2,arg3,arg4,arg5);
resultobj = SWIG_Py_Void();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return NULL;
}
SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@ -8546,6 +8623,65 @@ fail:
}
SWIGINTERN PyObject *_wrap_CoreSession_playAndDetectSpeech(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
char *arg4 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
int res4 ;
char *buf4 = 0 ;
int alloc4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
char *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_playAndDetectSpeech",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_playAndDetectSpeech" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_playAndDetectSpeech" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_playAndDetectSpeech" "', argument " "3"" of type '" "char *""'");
}
arg3 = reinterpret_cast< char * >(buf3);
res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_playAndDetectSpeech" "', argument " "4"" of type '" "char *""'");
}
arg4 = reinterpret_cast< char * >(buf4);
result = (char *)(arg1)->playAndDetectSpeech(arg2,arg3,arg4);
resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
free(result);
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
return NULL;
}
SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@ -10456,7 +10592,9 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"CoreSession_getDigits", _wrap_CoreSession_getDigits, METH_VARARGS, NULL},
{ (char *)"CoreSession_transfer", _wrap_CoreSession_transfer, METH_VARARGS, NULL},
{ (char *)"CoreSession_read", _wrap_CoreSession_read, METH_VARARGS, NULL},
{ (char *)"CoreSession_detectSpeech", _wrap_CoreSession_detectSpeech, METH_VARARGS, NULL},
{ (char *)"CoreSession_playAndGetDigits", _wrap_CoreSession_playAndGetDigits, METH_VARARGS, NULL},
{ (char *)"CoreSession_playAndDetectSpeech", _wrap_CoreSession_playAndDetectSpeech, METH_VARARGS, NULL},
{ (char *)"CoreSession_streamFile", _wrap_CoreSession_streamFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_sleep", _wrap_CoreSession_sleep, METH_VARARGS, NULL},
{ (char *)"CoreSession_flushEvents", _wrap_CoreSession_flushEvents, METH_VARARGS, NULL},