[Freeswitch-svn] [commit] r8252 - in freeswitch/trunk: . build src src/include src/mod/languages/mod_java src/mod/languages/mod_java/src/org/freeswitch/swig src/mod/languages/mod_lua src/mod/languages/mod_perl src/mod/languages/mod_python
Freeswitch SVN
anthm at freeswitch.org
Fri May 2 14:40:24 EDT 2008
Author: anthm
Date: Fri May 2 14:40:23 2008
New Revision: 8252
Added:
freeswitch/trunk/build/swigall.sh (contents, props changed)
Modified:
freeswitch/trunk/Makefile.am
freeswitch/trunk/src/include/switch_cpp.h
freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/trunk/src/switch_cpp.cpp
Log:
reswig
Modified: freeswitch/trunk/Makefile.am
==============================================================================
--- freeswitch/trunk/Makefile.am (original)
+++ freeswitch/trunk/Makefile.am Fri May 2 14:40:23 2008
@@ -301,8 +301,6 @@
everything: install
-installall: install
-
up: clean
svn update
$(MAKE) -j core
@@ -321,6 +319,10 @@
cd libs/sofia-sip && $(MAKE) clean
cd libs/openzap && $(MAKE) clean
+swigall:
+ @echo reswigging all
+ sh ./build/swigall.sh
+
sure: update-clean all
speedy-sure: update-clean
@@ -333,6 +335,8 @@
$(MAKE) all
$(MAKE) install
+installall: current
+
speedy-current: update-clean
svn update
$(MAKE) speedy-sure
Added: freeswitch/trunk/build/swigall.sh
==============================================================================
--- (empty file)
+++ freeswitch/trunk/build/swigall.sh Fri May 2 14:40:23 2008
@@ -0,0 +1,20 @@
+cd src/mod/languages/mod_lua
+make swigclean
+make mod_lua_wrap.cpp
+cd ../../../..
+
+cd src/mod/languages/mod_perl
+make swigclean
+make mod_perl_wrap.cpp
+cd ../../../..
+
+cd src/mod/languages/mod_python
+make reswig
+cd ../../../..
+
+cd src/mod/languages/mod_java
+make reswig
+cd ../../../..
+
+
+
Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h (original)
+++ freeswitch/trunk/src/include/switch_cpp.h Fri May 2 14:40:23 2008
@@ -250,7 +250,6 @@
SWITCH_DECLARE(char *) getDigits(
int maxdigits,
char *terminators,
- char *terminator,
int timeout);
SWITCH_DECLARE(int) transfer(char *extensions, char *dialplan, char *context);
Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java (original)
+++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java Fri May 2 14:40:23 2008
@@ -161,8 +161,8 @@
return freeswitchJNI.CoreSession_collectDigits(swigCPtr, this, timeout);
}
- public String getDigits(int maxdigits, String terminators, byte[] terminator, int timeout) {
- return freeswitchJNI.CoreSession_getDigits(swigCPtr, this, maxdigits, terminators, terminator, timeout);
+ public String getDigits(int maxdigits, String terminators, int timeout) {
+ return freeswitchJNI.CoreSession_getDigits(swigCPtr, this, maxdigits, terminators, timeout);
}
public int transfer(String extensions, String dialplan, String context) {
Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java (original)
+++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java Fri May 2 14:40:23 2008
@@ -91,7 +91,7 @@
public final static native int CoreSession_speak(long jarg1, CoreSession jarg1_, String jarg2);
public final static native void CoreSession_set_tts_parms(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
public final static native int CoreSession_collectDigits(long jarg1, CoreSession jarg1_, int jarg2);
- public final static native String CoreSession_getDigits(long jarg1, CoreSession jarg1_, int jarg2, String jarg3, byte[] jarg4, int jarg5);
+ public final static native String CoreSession_getDigits(long jarg1, CoreSession jarg1_, int jarg2, String jarg3, int jarg4);
public final static native int CoreSession_transfer(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4);
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);
public final static native int CoreSession_streamFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3);
Modified: freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp Fri May 2 14:40:23 2008
@@ -1714,13 +1714,12 @@
}
-SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1getDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jbyteArray jarg4, jint jarg5) {
+SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1getDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
jstring jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
- int arg5 ;
+ int arg4 ;
char *result = 0 ;
(void)jenv;
@@ -1733,18 +1732,10 @@
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3) return 0;
}
- {
- arg4 = (char*) jenv->GetByteArrayElements(jarg4, 0);
- if (!arg4) return 0;
- }
- arg5 = (int)jarg5;
- result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5);
+ arg4 = (int)jarg4;
+ result = (char *)(arg1)->getDigits(arg2,arg3,arg4);
if(result) jresult = jenv->NewStringUTF((const char *)result);
- {
- jenv->ReleaseByteArrayElements(jarg4, (jbyte*) arg4, 0);
- }
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
-
return jresult;
}
Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp Fri May 2 14:40:23 2008
@@ -4268,16 +4268,14 @@
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
- int arg5 ;
+ int arg4 ;
char *result = 0 ;
- SWIG_check_num_args("getDigits",5,5)
+ SWIG_check_num_args("getDigits",4,4)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *");
if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int");
if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *");
- if(!lua_isstring(L,4)) SWIG_fail_arg("getDigits",4,"char *");
- if(!lua_isnumber(L,5)) SWIG_fail_arg("getDigits",5,"int");
+ if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession);
@@ -4285,9 +4283,8 @@
arg2 = (int)lua_tonumber(L, 2);
arg3 = (char *)lua_tostring(L, 3);
- arg4 = (char *)lua_tostring(L, 4);
- arg5 = (int)lua_tonumber(L, 5);
- result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5);
+ arg4 = (int)lua_tonumber(L, 4);
+ result = (char *)(arg1)->getDigits(arg2,arg3,arg4);
SWIG_arg=0;
lua_pushstring(L,(const char*)result); SWIG_arg++;
return SWIG_arg;
Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp Fri May 2 14:40:23 2008
@@ -5517,8 +5517,7 @@
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
- int arg5 ;
+ int arg4 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -5527,16 +5526,13 @@
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
- int res4 ;
- char *buf4 = 0 ;
- int alloc4 = 0 ;
- int val5 ;
- int ecode5 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
int argvi = 0;
dXSARGS;
- if ((items < 5) || (items > 5)) {
- SWIG_croak("Usage: CoreSession_getDigits(self,maxdigits,terminators,terminator,timeout);");
+ if ((items < 4) || (items > 4)) {
+ SWIG_croak("Usage: CoreSession_getDigits(self,maxdigits,terminators,timeout);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
@@ -5553,29 +5549,22 @@
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_getDigits" "', 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_getDigits" "', argument " "4"" of type '" "char *""'");
- }
- arg4 = reinterpret_cast< char * >(buf4);
- ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
- if (!SWIG_IsOK(ecode5)) {
- SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "int""'");
+ ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "int""'");
}
- arg5 = static_cast< int >(val5);
- result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5);
+ arg4 = static_cast< int >(val4);
+ result = (char *)(arg1)->getDigits(arg2,arg3,arg4);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
XSRETURN(argvi);
fail:
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
SWIG_croak_null();
}
Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Fri May 2 14:40:23 2008
@@ -5912,8 +5912,7 @@
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
- int arg5 ;
+ int arg4 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -5922,20 +5921,14 @@
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
- int res4 ;
- char temp4[8+1] ;
- char *t4 = 0 ;
- size_t n4 = 0 ;
- int alloc4 = 0 ;
- int val5 ;
- int ecode5 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OOOOO:CoreSession_getDigits",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_getDigits",&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_getDigits" "', argument " "1"" of type '" "CoreSession *""'");
@@ -5951,24 +5944,13 @@
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_getDigits" "', argument " "3"" of type '" "char *""'");
}
arg3 = reinterpret_cast< char * >(buf3);
- res4 = SWIG_AsCharPtrAndSize(obj3, &t4, &n4, &alloc4);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "char *terminator""'");
- }
- if ( n4 > (size_t) 8 ) n4 = (size_t) 8;
- memcpy(temp4, t4, sizeof(char)*n4);
- if (alloc4 == SWIG_NEWOBJ) delete[] t4;
- temp4[n4 - 1] = 0;
- arg4 = (char *) temp4;
- ecode5 = SWIG_AsVal_int(obj4, &val5);
- if (!SWIG_IsOK(ecode5)) {
- SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "int""'");
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "int""'");
}
- arg5 = static_cast< int >(val5);
- result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5);
+ arg4 = static_cast< int >(val4);
+ result = (char *)(arg1)->getDigits(arg2,arg3,arg4);
resultobj = SWIG_FromCharPtr((const char *)result);
- arg4[8] = 0;
- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg4));
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
return resultobj;
fail:
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Fri May 2 14:40:23 2008
@@ -528,13 +528,13 @@
}
SWITCH_DECLARE(char *) CoreSession::getDigits(int maxdigits,
- char *terminators,
- char *terminator,
- int timeout)
+ char *terminators,
+ int timeout)
{
switch_status_t status;
sanity_check("");
begin_allow_threads();
+ char terminator;
memset(dtmf_buf, 0, sizeof(dtmf_buf));
status = switch_ivr_collect_digits_count(session,
@@ -542,7 +542,7 @@
sizeof(dtmf_buf),
maxdigits,
terminators,
- terminator,
+ &terminator,
(uint32_t) timeout, 0, 0);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "getDigits dtmf_buf: %s\n", dtmf_buf);
More information about the Freeswitch-svn
mailing list