From d5e4046dafef47ca43b12613157515730caff42d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 12 May 2008 16:58:44 +0000 Subject: [PATCH] fix build prob git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8366 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_cpp.h | 2 +- src/include/switch_event.h | 2 +- .../src/org/freeswitch/swig/CoreSession.java | 4 +++ .../org/freeswitch/swig/freeswitchJNI.java | 1 + .../languages/mod_java/switch_swig_wrap.cpp | 22 ++++++++++++ src/mod/languages/mod_python/freeswitch.py | 1 + .../languages/mod_python/mod_python_wrap.cpp | 35 +++++++++++++++++++ src/switch_cpp.cpp | 10 +++--- src/switch_event.c | 2 +- 9 files changed, 71 insertions(+), 8 deletions(-) diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h index ab7d43295e..3663157f82 100644 --- a/src/include/switch_cpp.h +++ b/src/include/switch_cpp.h @@ -144,7 +144,7 @@ class Event { SWITCH_DECLARE(bool) setPriority(switch_priority_t priority = SWITCH_PRIORITY_NORMAL); SWITCH_DECLARE(char *)getHeader(char *header_name); SWITCH_DECLARE(char *)getBody(void); - SWITCH_DECLARE(char *)getType(void); + SWITCH_DECLARE(const char *)getType(void); SWITCH_DECLARE(bool) addBody(const char *value); SWITCH_DECLARE(bool) addHeader(const char *header_name, const char *value); SWITCH_DECLARE(bool) delHeader(const char *header_name); diff --git a/src/include/switch_event.h b/src/include/switch_event.h index 937a5e0d51..827fa9fb0c 100644 --- a/src/include/switch_event.h +++ b/src/include/switch_event.h @@ -232,7 +232,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_bind(const char *id, switch_event_t \param event the event id to render the name of \return the rendered name */ -SWITCH_DECLARE(char *) switch_event_name(switch_event_types_t event); +SWITCH_DECLARE(const char *) switch_event_name(switch_event_types_t event); /*! \brief return the event id that matches a given event name diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java index cf8fcb1f47..8c774e3aa9 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java @@ -117,6 +117,10 @@ public class CoreSession { return freeswitchJNI.CoreSession_getVariable(swigCPtr, this, var); } + public SWIGTYPE_p_switch_status_t process_callback_result(String ret) { + return new SWIGTYPE_p_switch_status_t(freeswitchJNI.CoreSession_process_callback_result(swigCPtr, this, ret), true); + } + public int recordFile(String file_name, int max_len, int silence_threshold, int silence_secs) { return freeswitchJNI.CoreSession_recordFile__SWIG_0(swigCPtr, this, file_name, max_len, silence_threshold, silence_secs); } diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java index a1fecf5a0b..b9d1c37ebf 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java @@ -80,6 +80,7 @@ class freeswitchJNI { public final static native void CoreSession_setPrivate(long jarg1, CoreSession jarg1_, String jarg2, long jarg3); public final static native long CoreSession_getPrivate(long jarg1, CoreSession jarg1_, String jarg2); public final static native String CoreSession_getVariable(long jarg1, CoreSession jarg1_, String jarg2); + public final static native long CoreSession_process_callback_result(long jarg1, CoreSession jarg1_, String jarg2); public final static native int CoreSession_recordFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4, int jarg5); public final static native int CoreSession_recordFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4); public final static native int CoreSession_recordFile__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2, int jarg3); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 04dd6b8cef..d5128c1ca1 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -1453,6 +1453,28 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1g } +SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1process_1callback_1result(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { + jlong jresult = 0 ; + CoreSession *arg1 = (CoreSession *) 0 ; + char *arg2 = (char *) 0 ; + switch_status_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CoreSession **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + result = (arg1)->process_callback_result(arg2); + *(switch_status_t **)&jresult = new switch_status_t((switch_status_t &)result); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + return jresult; +} + + SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1recordFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jint jarg4, jint jarg5) { jint jresult = 0 ; CoreSession *arg1 = (CoreSession *) 0 ; diff --git a/src/mod/languages/mod_python/freeswitch.py b/src/mod/languages/mod_python/freeswitch.py index e09ed673d8..4717f554e1 100644 --- a/src/mod/languages/mod_python/freeswitch.py +++ b/src/mod/languages/mod_python/freeswitch.py @@ -198,6 +198,7 @@ class CoreSession(_object): def setPrivate(*args): return _freeswitch.CoreSession_setPrivate(*args) def getPrivate(*args): return _freeswitch.CoreSession_getPrivate(*args) def getVariable(*args): return _freeswitch.CoreSession_getVariable(*args) + def process_callback_result(*args): return _freeswitch.CoreSession_process_callback_result(*args) def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args) def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args) def originate(*args): return _freeswitch.CoreSession_originate(*args) diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 898e2cef25..6befd3be19 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -5255,6 +5255,40 @@ fail: } +SWIGINTERN PyObject *_wrap_CoreSession_process_callback_result(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + CoreSession *arg1 = (CoreSession *) 0 ; + char *arg2 = (char *) 0 ; + switch_status_t result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_process_callback_result",&obj0,&obj1)) 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_process_callback_result" "', 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_process_callback_result" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (arg1)->process_callback_result(arg2); + resultobj = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + SWIGINTERN PyObject *_wrap_CoreSession_recordFile__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; @@ -7323,6 +7357,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"CoreSession_setPrivate", _wrap_CoreSession_setPrivate, METH_VARARGS, NULL}, { (char *)"CoreSession_getPrivate", _wrap_CoreSession_getPrivate, METH_VARARGS, NULL}, { (char *)"CoreSession_getVariable", _wrap_CoreSession_getVariable, METH_VARARGS, NULL}, + { (char *)"CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result, METH_VARARGS, NULL}, { (char *)"CoreSession_recordFile", _wrap_CoreSession_recordFile, METH_VARARGS, NULL}, { (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL}, { (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL}, diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 302e602db8..79af801dd9 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -270,13 +270,13 @@ SWITCH_DECLARE(char *)Event::getBody(void) return NULL; } -SWITCH_DECLARE(char *)Event::getType(void) +SWITCH_DECLARE(const char *)Event::getType(void) { if (event) { return switch_event_name(event->event_id); } - return "invalid"; + return (char *) "invalid"; } SWITCH_DECLARE_CONSTRUCTOR Stream::Stream() @@ -393,7 +393,7 @@ SWITCH_DECLARE(char *) CoreSession::getXMLCDR() switch_xml_t cdr; - sanity_check(""); + sanity_check((char *)""); switch_safe_free(xml_cdr_text); @@ -561,7 +561,7 @@ SWITCH_DECLARE(char *) CoreSession::getDigits(int maxdigits, int timeout) { switch_status_t status; - sanity_check(""); + sanity_check((char *)""); begin_allow_threads(); char terminator; @@ -623,7 +623,7 @@ SWITCH_DECLARE(char *) CoreSession::playAndGetDigits(int min_digits, char *digits_regex) { switch_status_t status; - sanity_check(""); + sanity_check((char *)""); begin_allow_threads(); memset(dtmf_buf, 0, sizeof(dtmf_buf)); status = switch_play_and_get_digits( session, diff --git a/src/switch_event.c b/src/switch_event.c index 1506095bd7..50bab12d5e 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -297,7 +297,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_running(void) return SYSTEM_RUNNING ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; } -SWITCH_DECLARE(char *) switch_event_name(switch_event_types_t event) +SWITCH_DECLARE(const char *) switch_event_name(switch_event_types_t event) { switch_assert(BLOCK != NULL); switch_assert(RUNTIME_POOL != NULL);