[Freeswitch-svn] [commit] r8366 - in freeswitch/trunk/src: . include mod/languages/mod_java mod/languages/mod_java/src/org/freeswitch/swig mod/languages/mod_python

Freeswitch SVN anthm at freeswitch.org
Mon May 12 12:58:45 EDT 2008


Author: anthm
Date: Mon May 12 12:58:44 2008
New Revision: 8366

Modified:
   freeswitch/trunk/src/include/switch_cpp.h
   freeswitch/trunk/src/include/switch_event.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_python/freeswitch.py
   freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
   freeswitch/trunk/src/switch_cpp.cpp
   freeswitch/trunk/src/switch_event.c

Log:
fix build prob

Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h	(original)
+++ freeswitch/trunk/src/include/switch_cpp.h	Mon May 12 12:58:44 2008
@@ -144,7 +144,7 @@
 	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);

Modified: freeswitch/trunk/src/include/switch_event.h
==============================================================================
--- freeswitch/trunk/src/include/switch_event.h	(original)
+++ freeswitch/trunk/src/include/switch_event.h	Mon May 12 12:58:44 2008
@@ -232,7 +232,7 @@
   \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

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	Mon May 12 12:58:44 2008
@@ -117,6 +117,10 @@
     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);
   }

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	Mon May 12 12:58:44 2008
@@ -80,6 +80,7 @@
   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);

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	Mon May 12 12:58:44 2008
@@ -1453,6 +1453,28 @@
 }
 
 
+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 ;

Modified: freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py	(original)
+++ freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py	Mon May 12 12:58:44 2008
@@ -198,6 +198,7 @@
     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)

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	Mon May 12 12:58:44 2008
@@ -5255,6 +5255,40 @@
 }
 
 
+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 @@
 	 { (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},

Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp	(original)
+++ freeswitch/trunk/src/switch_cpp.cpp	Mon May 12 12:58:44 2008
@@ -270,13 +270,13 @@
 	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_xml_t cdr;
 	
-	sanity_check("");
+	sanity_check((char *)"");
 
 	switch_safe_free(xml_cdr_text);
 
@@ -561,7 +561,7 @@
 											  int timeout)
 {
     switch_status_t status;
-	sanity_check("");
+	sanity_check((char *)"");
 	begin_allow_threads();
 	char terminator;
 
@@ -623,7 +623,7 @@
 												  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, 

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Mon May 12 12:58:44 2008
@@ -297,7 +297,7 @@
 	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);



More information about the Freeswitch-svn mailing list