[Freeswitch-svn] [commit] r5156 - freeswitch/trunk/src/mod/languages/mod_python

Freeswitch SVN anthm at freeswitch.org
Fri May 11 14:39:19 EDT 2007


Author: anthm
Date: Fri May 11 14:39:19 2007
New Revision: 5156

Modified:
   freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
   freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h
   freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp

Log:
fix get_variable

Modified: freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp	(original)
+++ freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp	Fri May 11 14:39:19 2007
@@ -51,10 +51,10 @@
     switch_channel_set_variable(channel, var, val);
 }
 
-void SessionContainer::get_variable(char *var, char *val)
+char *SessionContainer::get_variable(char *var)
 {
-	sanity_check();
-    switch_channel_get_variable(channel, var);
+	sanity_check(NULL);
+    return switch_channel_get_variable(channel, var);
 }
 
 void SessionContainer::execute(char *app, char *data)

Modified: freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h	(original)
+++ freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h	Fri May 11 14:39:19 2007
@@ -34,7 +34,7 @@
 	int pre_answer();
 	void hangup(char *cause);
 	void set_variable(char *var, char *val);
-	void get_variable(char *var, char *val);
+	char *get_variable(char *var);
 	int play_file(char *file, char *timer_name);
 	void set_dtmf_callback(PyObject * pyfunc);
 	int speak_text(char *text);

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 11 14:39:19 2007
@@ -1045,14 +1045,14 @@
     PyObject *resultobj;
     SessionContainer *arg1 = (SessionContainer *) 0 ;
     char *arg2 ;
-    char *arg3 ;
+    char *result;
     PyObject * obj0 = 0 ;
     
-    if(!PyArg_ParseTuple(args,(char *)"Oss:SessionContainer_get_variable",&obj0,&arg2,&arg3)) goto fail;
+    if(!PyArg_ParseTuple(args,(char *)"Os:SessionContainer_get_variable",&obj0,&arg2)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_SessionContainer,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    (arg1)->get_variable(arg2,arg3);
+    result = (char *)(arg1)->get_variable(arg2);
     
-    Py_INCREF(Py_None); resultobj = Py_None;
+    resultobj = result ? PyString_FromString(result) : Py_BuildValue((char*)"");
     return resultobj;
     fail:
     return NULL;



More information about the Freeswitch-svn mailing list